Repository navigation
refactor(cost-map): remove openrouter rows, part 5 of 5 - #45669
Conversation
… google block) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
kerry seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
| @@ -71088,46 +70705,6 @@ | |||
| "supports_vision": true, | |||
| "supports_web_search": true | |||
| }, | |||
There was a problem hiding this comment.
Deleting this row makes get_model_info("openrouter/mistralai/mistral-large-4-0") raise ModelNotMappedError and removes its token limits. Other providers’ rows cannot replace it, and OpenRouter has no replacement lookup. Router callers can also fail before merging user-supplied details. Keep the metadata available; removing it unconditionally violates the repository rule against breaking existing behavior without a user-controlled flag
Rule Used: What: avoid backwards-incompatible changes without a user-controlled flag Why: they break current behavior for users relying on existing functionality Bad: #22164 added _run_post_custom_auth_checks unconditi... (source)
Knowledge Base Used: Provider adapters and capabilities
| @@ -68807,324 +68807,6 @@ | |||
| "supports_tool_choice": true, | |||
| "supports_vision": true | |||
| }, | |||
There was a problem hiding this comment.
Deleting these prices breaks SDK completion_cost() for rebuilt OpenRouter streams, even when usage.cost survives. For models such as openrouter/cohere/command-a-plus, that helper still reads the map and raises when lookup fails. Without a reported charge, request logging also loses its price fallback. Teach the SDK helper to use the reported charge and preserve the fallback before deleting these rows
Knowledge Base Used: Provider adapters and capabilities
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ve_openrouter_cost_map_5 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Merging this PR will not alter performance
|
Summary
Part 5 of 5 of removing the redundant
litellm_provider: openrouterrows from the cost map (OpenRouter bills fromusage.costsince #45640; see #45665 for why this is split into 5 stacked deletion-only PRs). Stacked on part 4Deletes the last six small blocks, 21 rows including
openrouter/anthropic/claude-sonnet-5.5andopenrouter/mistralai/mistral-large-4-0, frommodel_prices_and_context_window.jsonandlitellm/model_prices_and_context_window_backup.json, and dropsopenrouter/anthropic/claude-sonnet-5.5fromSONNET_5_5_VARIANTSintests/unit/test_claude_sonnet_5_config.py. After this PR nolitellm_provider: openrouterrow is left. The resulting files are byte-identical to the single-PR version in #45623Check against the base branch:
Caveats once all five parts are in:
litellm.get_model_info("openrouter/...")andget_max_tokensraiseModelNotMappedErrorfor these modelscompletion_cost()on a rebuilt stream response raises for OpenRouter modelslitellm.openrouter_models, use theopenrouter/prefixusage.cost, spend for that request falls back to the map and is 0Link to Devin session: https://app.devin.ai/sessions/24b478924abd4f92b269b1556a5fcca6
Open in Devin Desktop: https://app.devin.ai/desktop/session/24b478924abd4f92b269b1556a5fcca6?variant=devin
Requested by: @kerry-berri
Note
Devin errored when opening this Pull Request as kerry-berri.
As a fallback, Devin opened this PR as itself.