[litellm-agent] Staging → litellm_internal_staging (5/19/2026)#28207
[litellm-agent] Staging → litellm_internal_staging (5/19/2026)#28207oss-pr-review-agent-shin[bot] wants to merge 6 commits into
Conversation
…#27700) Squash-merged by litellm-agent from TorvaldUtne's PR.
|
@greptile please review |
Greptile SummaryThis PR merges one feature PR (#27700) that adds Xiaomi MiMo-V2.5 and MiMo-V2.5-Pro OpenRouter entries alongside a bug fix that makes the Anthropic transformation accept dict-shaped
Confidence Score: 5/5The changes are safe to merge: the Anthropic transformation fix is narrowly scoped and well-covered by new unit tests, and the pricing additions are consistent with published OpenRouter data. The transformation change is a focused coercion fix with thorough parametrized tests for every valid and invalid shape. Pricing entries for the new Gemini and MiMo models are confirmed against OpenRouter's published pages. No logic paths are bypassed, no auth or critical-path code is touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/llms/anthropic/chat/transformation.py | Removes isinstance(value, str) guard on reasoning_effort and adds dict-shape normalization so the OpenAI Responses→Chat bridge no longer silently drops extended thinking |
| tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py | Adds three parametrized test functions covering string-shape, dict-with-effort, dict-with-effort-and-summary, and malformed-dict cases for both adaptive (4.6+) and non-adaptive models — all properly mocked, no network calls |
| tests/test_litellm/test_cost_calculator.py | Adds a regression test for the new openrouter/google/gemini-3.1-flash-lite pricing entry; uses LITELLM_LOCAL_MODEL_COST_MAP=True so no network calls are made |
| model_prices_and_context_window.json | Adds gemini-3.1-flash-lite entries for four prefixes (bare, gemini/, openrouter/, vertex_ai/), adds openrouter/xiaomi/mimo-v2.5-pro and mimo-v2.5 entries (pricing confirmed via OpenRouter), and updates mimo-v2-flash pricing/caching fields |
| litellm/model_prices_and_context_window_backup.json | Mirror of the main pricing file kept in sync; same additions as model_prices_and_context_window.json |
| litellm/proxy/_lazy_openapi_snapshot.json | Updates the POST /agents example in the OpenAPI snapshot: corrects the URL to /v1/agents and removes the unnecessary wrapping agent object from the request body |
| ui/litellm-dashboard/src/components/mcp_tools/ToolTestPanel.tsx | Adds .trim() to string inputs before type conversion so leading/trailing whitespace is stripped before submission; correctly handles non-string types by conditionally applying trim |
Reviews (2): Last reviewed commit: "feat: add pricing entry for openrouter/g..." | Re-trigger Greptile
| "openrouter/xiaomi/mimo-v2-flash": { | ||
| "input_cost_per_token": 9e-08, | ||
| "output_cost_per_token": 2.9e-07, | ||
| "input_cost_per_token": 1e-07, | ||
| "output_cost_per_token": 3e-07, | ||
| "cache_creation_input_token_cost": 0.0, | ||
| "cache_read_input_token_cost": 0.0, | ||
| "cache_read_input_token_cost": 1e-08, |
There was a problem hiding this comment.
The updated
input_cost_per_token and output_cost_per_token for mimo-v2-flash don't match the prices listed on OpenRouter's official model page, which still shows $0.09/M input and $0.29/M output — the pre-existing values. Bumping them to $0.10/M and $0.30/M will cause litellm to overestimate costs for every request to this model.
| "openrouter/xiaomi/mimo-v2-flash": { | |
| "input_cost_per_token": 9e-08, | |
| "output_cost_per_token": 2.9e-07, | |
| "input_cost_per_token": 1e-07, | |
| "output_cost_per_token": 3e-07, | |
| "cache_creation_input_token_cost": 0.0, | |
| "cache_read_input_token_cost": 0.0, | |
| "cache_read_input_token_cost": 1e-08, | |
| "openrouter/xiaomi/mimo-v2-flash": { | |
| "input_cost_per_token": 9e-08, | |
| "output_cost_per_token": 2.9e-07, | |
| "cache_creation_input_token_cost": 0.0, | |
| "cache_read_input_token_cost": 1e-08, |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-authored-by: shin-berri <shin-laptop@berri.ai> Co-authored-by: yuneng-jiang <yuneng@berri.ai>
|
|
* feat(model_prices): add gemini-3.1-flash-lite pricing with standard/batch/flex/priority tiers * fix pricing * add service tier --------- Co-authored-by: shin-berri <shin-laptop@berri.ai>
…dge (#28201) * fix(anthropic): accept dict-shape reasoning_effort from Responses bridge Issue #28196 — the Responses->Chat parser (transformation.py:184-200) keeps the full dict as reasoning_effort when summary is set; that branch was added in #25359. But the Anthropic transformation here still guarded on isinstance(value, str), silently dropping the param. Result: callers using the standard Reasoning(effort, summary) OpenAI-shaped object on Anthropic lose thinking entirely (0 reasoning_tokens, no thinking_blocks). Coerce dict -> string before mapping. Same shape tolerance that gpt_5_transformation._normalize_reasoning_effort_for_chat_completion already implements. summary is irrelevant for Anthropic's thinking_blocks. Adds two regression tests: one parametrized over string + dict shapes (with and without summary), one covering unparseable dict inputs (drops silently, no crash). * test(anthropic): add non-adaptive model coverage for dict-shape reasoning_effort Per Greptile feedback on PR #28198: the original regression test only exercised the adaptive (4.6+) path. Add a parametrized test for the non-adaptive branch (claude-sonnet-4-5) verifying that dict-shape reasoning_effort still maps to thinking.type='enabled' + budget_tokens, and that output_config is NOT set on pre-4.6 models. * test(anthropic): convert unparseable-dict test to @pytest.mark.parametrize Per @greptile-apps inline review on PR #28201 — matches the parametrize style of the two adjacent dict-shape tests and produces clearer failure messages (test ID per case instead of one collapsing for-loop).
…28280) Squash-merged by litellm-agent from ro31337's PR.
|
@greptile please review |
|
https://github.com/BerriAI/litellm/pull/28310/commits has all the same commits, closing this |
Merged PRs (1)
Auto-updated by litellm-agent on each merge.