Skip to content

[litellm-agent] Staging → litellm_internal_staging (5/19/2026)#28207

Closed
oss-pr-review-agent-shin[bot] wants to merge 6 commits into
litellm_internal_stagingfrom
shin_agent_oss_staging_05_19_2026
Closed

[litellm-agent] Staging → litellm_internal_staging (5/19/2026)#28207
oss-pr-review-agent-shin[bot] wants to merge 6 commits into
litellm_internal_stagingfrom
shin_agent_oss_staging_05_19_2026

Conversation

@oss-pr-review-agent-shin

@oss-pr-review-agent-shin oss-pr-review-agent-shin Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Merged PRs (1)

# Title
#27700 feat: add Xiaomi MiMo-V2.5-Pro and MiMo-V2.5 OpenRouter model entries

Auto-updated by litellm-agent on each merge.

…#27700)

Squash-merged by litellm-agent from TorvaldUtne's PR.
@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@greptile-apps

greptile-apps Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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 reasoning_effort values produced by the OpenAI Responses→Chat bridge.

  • Anthropic transformation fix: Removes the hard isinstance(value, str) guard on reasoning_effort and coerces {"effort": "low", "summary": "concise"} dicts to a plain string before mapping, preventing silent disabling of extended thinking when the Responses bridge is in use. Three parametrized test suites cover string, dict-with-effort, dict-with-effort-and-summary, and malformed-dict shapes across adaptive (4.6+) and non-adaptive models.
  • Model pricing entries: Adds gemini-3.1-flash-lite for four prefixes (bare, gemini/, openrouter/, vertex_ai/) and the two new Xiaomi MiMo-V2.5 variants; MiMo-V2.5 multimodal flags (vision, audio, video) match OpenRouter's published description of it as a "native omnimodal model".
  • UI tweak: ToolTestPanel.tsx trims leading/trailing whitespace from string inputs before type conversion.

Confidence Score: 5/5

The 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.

Important Files Changed

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

Comment on lines 27796 to +27800
"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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Suggested change
"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

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

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>
@CLAassistant

CLAassistant commented May 19, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
4 out of 6 committers have signed the CLA.

✅ TorvaldUtne
✅ mubashir1osmani
✅ ro31337
✅ cwang-otto
❌ oss-agent-shin
❌ IshaMeera
You have signed the CLA already but the status is still pending? Let us recheck it.

mubashir1osmani and others added 4 commits May 19, 2026 08:57
* 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).
@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@Sameerlite

Copy link
Copy Markdown
Collaborator

https://github.com/BerriAI/litellm/pull/28310/commits has all the same commits, closing this

@Sameerlite Sameerlite closed this May 20, 2026
@Sameerlite Sameerlite deleted the shin_agent_oss_staging_05_19_2026 branch May 22, 2026 12:07
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.

8 participants