Skip to content

support open router in /model UI and make the underlying api call set the right provider - #179

Merged
chauncygu merged 4 commits into
SAIL-Research-Lab:mainfrom
albertcheng:main
Aug 16, 2026
Merged

support open router in /model UI and make the underlying api call set the right provider#179
chauncygu merged 4 commits into
SAIL-Research-Lab:mainfrom
albertcheng:main

Conversation

@albertcheng

Copy link
Copy Markdown
Contributor

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

@chauncygu
chauncygu merged commit 7f5144f into SAIL-Research-Lab:main Aug 16, 2026
6 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants