-
Notifications
You must be signed in to change notification settings - Fork 0
fix: OPENROUTER_API_KEY + chain-routed static safety-nets #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d12f214
fix: add OPENROUTER_API_KEY to LiteLLM container env
fbd7388
refactor: remove static agent-* safety-net entries from LiteLLM config
32fc19f
style: split long export line in render_pod_yaml for readability
1654dfd
fix: add local-qwen-3.6 static safety-nets + clean export statements
062fbc1
fix: add capability flags + reorder fallback chains
f032937
fix: chain-routed static safety-nets + reduce timeout to 120s
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 Critical Correctness Issue: Broken Static Safety-Net Chain Routing
The current configuration for the static safety-net entries (
agent-reasoning-core,agent-complex-core,agent-medium-core, andagent-simple-core) will completely fail to route when OpenRouter is down.Why this happens:
openai/) or an explicitcustom_llm_providerto know how to route a model. Without these, and without anapi_base, LiteLLM defaults to the public OpenAI API (https://api.openai.com/v1/chat/completions) and will attempt to call it with the model nameagent-advanced-core, resulting in a401 Unauthorizedor404 Not Founderror.model_listunless you configure a loopback HTTP call to itself (which is highly inefficient, prone to connection pool exhaustion, and increases latency).Recommended Solution:
Point all static safety-net entries directly to the local classifier (
openai/local-qwen-3.6) with the correctapi_baseandapi_key, just likeagent-advanced-coredoes. This guarantees that if OpenRouter is down, any tier's safety net will immediately and successfully route to the local model without nested loopback overhead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
False positive — LiteLLM does support internal model group routing without a provider prefix. Verified live: agent-simple-core (which chains through model: agent-medium-core → agent-complex-core → agent-reasoning-core → agent-advanced-core → openai/local-qwen-3.6) returns HTTP 200 in 0.55s on the dev deployment. LiteLLM correctly resolves bare model group names as internal references. If it were falling through to OpenAI's public API as claimed, we would see 401/404 errors, not successful responses.