fix: respect OPENAI_BASE_URL when resolving API key priority
When base_url points to a non-OpenRouter endpoint (e.g. Z.ai), OPENROUTER_API_KEY incorrectly takes priority over OPENAI_API_KEY, sending the wrong credentials. This causes 401 errors on the main inference path and forces users to comment out OPENROUTER_API_KEY, which then breaks auxiliary clients (compression, vision). Fix: check whether base_url contains "openrouter" and swap the key priority accordingly. Also adds GLM-4.7 and GLM-5 context lengths to DEFAULT_CONTEXT_LENGTHS.
This commit is contained in:
@@ -33,6 +33,8 @@ DEFAULT_CONTEXT_LENGTHS = {
|
||||
"meta-llama/llama-3.3-70b-instruct": 131072,
|
||||
"deepseek/deepseek-chat-v3": 65536,
|
||||
"qwen/qwen-2.5-72b-instruct": 32768,
|
||||
"glm-4.7": 202752,
|
||||
"glm-5": 202752,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user