Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion scripts/check_llm_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,22 @@ def check_gemini(api_key: str, **_: str) -> dict:
key, "https://api.cerebras.ai/v1/models", "Cerebras"
),
"openrouter": lambda key, **kw: check_openrouter(key, **kw),
"minimax": lambda key, **kw: check_minimax(key),
"deepseek": lambda key, **_: check_openai_compatible(
key, "https://api.deepseek.com/v1/models", "DeepSeek"
),
"together": lambda key, **_: check_openai_compatible(
key, "https://api.together.xyz/v1/models", "Together AI"
),
"mistral": lambda key, **_: check_openai_compatible(
key, "https://api.mistral.ai/v1/models", "Mistral"
),
"xai": lambda key, **_: check_openai_compatible(
key, "https://api.x.ai/v1/models", "xAI"
),
"perplexity": lambda key, **_: check_openai_compatible(
key, "https://api.perplexity.ai/v1/models", "Perplexity"
),
Comment on lines +321 to +335
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add matching API-key env-var resolution for the newly supported providers.

These new provider routes are fine, but core/framework/runner/runner.py::_get_api_key_env_var is still missing deepseek, xai, and perplexity mappings, so those models fall back to OPENAI_API_KEY. That can cause incorrect credential detection despite native support being added here.

Suggested follow-up patch (outside this file)
--- a/core/framework/runner/runner.py
+++ b/core/framework/runner/runner.py
@@
     elif model_lower.startswith("openrouter/"):
         return "OPENROUTER_API_KEY"
+    elif model_lower.startswith("deepseek/") or model_lower.startswith("deepseek-"):
+        return "DEEPSEEK_API_KEY"
@@
     elif model_lower.startswith("together/"):
         return "TOGETHER_API_KEY"
+    elif model_lower.startswith("xai/") or model_lower.startswith("grok-"):
+        return "XAI_API_KEY"
+    elif model_lower.startswith("perplexity/"):
+        return "PERPLEXITY_API_KEY"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/check_llm_key.py` around lines 321 - 335, The provider-to-env-var map
in the function _get_api_key_env_var is missing entries for the newly supported
providers; add mappings for "deepseek" -> "DEEPSEEK_API_KEY", "xai" ->
"XAI_API_KEY", and "perplexity" -> "PERPLEXITY_API_KEY" (alongside existing
entries like "together" etc.) so those providers resolve to their own API key
env vars instead of falling back to OPENAI_API_KEY; update the mapping logic in
_get_api_key_env_var to return these specific env var names for the
corresponding provider keys.

"minimax": lambda key, **_: check_minimax(key),
# Kimi For Coding uses an Anthropic-compatible endpoint; check via /v1/messages
# with empty messages (same as check_anthropic, triggers 400 not 401).
"kimi": lambda key, **kw: check_anthropic_compatible(
Expand Down
Loading