support open router in /model UI and make the underlying api call set the right provider - #179
Merged
Merged
Conversation
get most recent updates from official github repo.
deorth-kku
pushed a commit
to deorth-kku/cheetahclaws
that referenced
this pull request
Aug 25, 2026
…arch-Lab#179 Multi-level gateway model IDs (openrouter/<vendor>/<model>) broke four things that only bit gateway routes: - stream_openai_compat re-derived the provider from an already-stripped model string, so openrouter/deepseek/* resolved to the DeepSeek API and picked up DeepSeek-only request fields (extra_body.thinking, reasoning_effort) plus the wrong output caps; openrouter/openai/* sent max_completion_tokens instead of the max_tokens OpenRouter documents. stream() now passes the resolved provider via config['_provider_name']. - COSTS/_MODEL_CONTEXT_LIMITS are keyed by plain model name, so every openrouter/* route priced at $0.00 (the quota dollar budget never fired for a gateway that bills real money) and inherited a flat 128k context window. New lookup_model_key() drops the vendor path and the @provider/quant routing suffix; context falls back to the vendor's own window when the per-model registry has no entry. - The @<provider>[/<quant>] suffix made prompt-family overlay routing tail to 'fp8', silently dropping claude.md/qwen.md. Tests: tests/test_openrouter_provider.py 11 -> 23 cases. Docs: usage.md (OpenRouter setup + provider pinning), recipes.md, architecture.md, i18n READMEs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Now, you can use the following commands to use open router as the LLM provider
/model openrouter/deepseek/deepseek-v4-flast@gmicloud
/config openrouter_api_key=xxxxxxx