Repository navigation
fix(catalog): add current OpenRouter Claude routes (sonnet 5, opus 4.8/-fast, opus 4.7-fast, fable 5) - #33070
Conversation
…8/-fast, opus 4.7-fast, fable 5)
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Greptile SummaryThis PR adds five missing OpenRouter Claude model entries (
Confidence Score: 4/5Safe to merge; changes are additive catalog entries with no impact on existing routes or runtime logic The change is purely additive — five new JSON entries and one new test. The pricing math checks out against the PR description's quoted OpenRouter values. The only open question is whether the capability flags (computer use, extended reasoning, adaptive thinking) are accurate for claude-fable-5, which appears to have had its flags copied from claude-opus-4.7 rather than sourced per-model from OpenRouter's API response. The capability flags in both JSON files for openrouter/anthropic/claude-fable-5 deserve a second look to confirm they reflect what OpenRouter actually exposes for that route
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds five new OpenRouter Claude model entries (sonnet-5, opus-4.8, opus-4.8-fast, opus-4.7-fast, fable-5) with pricing sourced from OpenRouter's API; all entries share identical capability flags copied from the existing claude-opus-4.7 entry, which may not be accurate for every model (e.g. claude-fable-5) |
| litellm/model_prices_and_context_window_backup.json | Identical additions to the bundled backup JSON, kept in sync with the root file; matches the root file exactly |
| tests/test_litellm/litellm_core_utils/test_get_model_cost_map.py | Adds a regression test verifying the five new routes are present in the backup with the correct provider, per-token costs, and 1M/128k token limits; uses only local file loading — no network calls |
Reviews (1): Last reviewed commit: "fix(catalog): add current OpenRouter Cla..." | Re-trigger Greptile
| "supports_xhigh_reasoning_effort": true | ||
| }, | ||
| "openrouter/anthropic/claude-opus-4.8": { | ||
| "supports_adaptive_thinking": true, | ||
| "cache_creation_input_token_cost": 6.25e-06, | ||
| "cache_read_input_token_cost": 5e-07, | ||
| "input_cost_per_token": 5e-06, | ||
| "litellm_provider": "openrouter", | ||
| "max_input_tokens": 1000000, | ||
| "max_output_tokens": 128000, | ||
| "max_tokens": 128000, | ||
| "mode": "chat", | ||
| "output_cost_per_token": 2.5e-05, | ||
| "source": "https://openrouter.ai/anthropic/claude-opus-4.8", | ||
| "supports_assistant_prefill": false, | ||
| "supports_computer_use": true, | ||
| "supports_function_calling": true, | ||
| "supports_pdf_input": true, | ||
| "supports_prompt_caching": true, | ||
| "supports_reasoning": true, | ||
| "supports_response_schema": true, | ||
| "supports_max_reasoning_effort": true, | ||
| "supports_tool_choice": true, | ||
| "supports_vision": true, | ||
| "supports_xhigh_reasoning_effort": true | ||
| }, | ||
| "openrouter/anthropic/claude-opus-4.8-fast": { |
There was a problem hiding this comment.
Capability flags copied verbatim from
claude-opus-4.7 for claude-fable-5
All five new entries share identical capability flags (including supports_computer_use, supports_reasoning, supports_adaptive_thinking, supports_xhigh_reasoning_effort). This appears to have been copied wholesale from the existing openrouter/anthropic/claude-opus-4.7 entry. For claude-fable-5 in particular — a creative/storytelling-oriented model — it's worth verifying that OpenRouter actually exposes computer use, extended reasoning, and adaptive thinking on this route, since incorrectly advertising those capabilities can cause litellm to attempt features the model doesn't support and produce unexpected errors or incorrect behavior at call time.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
…ing-param flag check
|
Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level |
Relevant issues
Fixes #33068
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
Five Claude routes that OpenRouter currently serves had no
openrouter/*entry in the catalog, so litellm resolved zero cost and the generic 200k/64k fallback window for them; cost tracking silently reported nothing and the reported limits were wrong. The live pricing and token limits added here were read straight off the OpenRouter models API so cost tracking matches what OpenRouter actually billsConfirmed against
https://openrouter.ai/api/v1/modelsat capture time:Before (base
c2141b1113, issue reproduction; every route falls back to zero cost and the wrong window):After (this branch
ed5eebee35, live proxy started withpython litellm/proxy/proxy_cli.py --config config.yaml, queried over HTTP):I could not run a live
/chat/completionsagainst OpenRouter to show spend tracking end to end because this environment has noOPENROUTER_API_KEY; happy to add that run if a key is providedType
🐛 Bug Fix
Changes
Added the five current OpenRouter Claude routes (
openrouter/anthropic/claude-sonnet-5,claude-opus-4.8,claude-opus-4.8-fast,claude-opus-4.7-fast,claude-fable-5) to bothmodel_prices_and_context_window.jsonand the bundledlitellm/model_prices_and_context_window_backup.json, mirroring the shape of the existingopenrouter/anthropic/claude-opus-4.7entry. Cache read/write token costs follow Anthropic's standard 0.1x/1.25x-of-input ratios, which line up with the OpenRouterinput_cache_read/input_cache_writevaluesAdded
test_shipped_backup_has_current_openrouter_claude_routesintests/test_litellm/litellm_core_utils/test_get_model_cost_map.py, a regression test that asserts each of the five routes ships in the bundled backup with the correct provider, per-token costs, and 1M/128k token limits. It fails on the base branch (the keys don't exist) and passes hereLink to Devin session: https://app.devin.ai/sessions/b0a16337125d4d89a007f589c00298f5