Skip to content

fix: get_model_info now returns supports_xhigh/none/minimal_reasoning_effort fields - #25099

Closed
abhishekDeshmukh74 wants to merge 2 commits into
BerriAI:mainfrom
abhishekDeshmukh74:fix/get-model-info-xhigh-reasoning-effort
Closed

abhishekDeshmukh74 wants to merge 2 commits into
BerriAI:mainfrom
abhishekDeshmukh74:fix/get-model-info-xhigh-reasoning-effort

Conversation

@abhishekDeshmukh74

Copy link
Copy Markdown

Relevant issues

Fixes #25096

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Type

🐛 Bug Fix

Changes

Root Cause

litellm.get_model_info was not returning supports_xhigh_reasoning_effort (and related reasoning-effort capability flags) even though the values exist in model_prices_and_context_window.json.

The _get_model_info_helper function in litellm/utils.py builds a ModelInfoBase TypedDict object by explicitly passing each field in the constructor. Four capability fields were missing from that constructor call:

  • supports_xhigh_reasoning_effort
  • supports_none_reasoning_effort
  • supports_minimal_reasoning_effort
  • supports_parallel_function_calling

This meant that calling litellm.get_model_info("gpt-5.4").get("supports_xhigh_reasoning_effort") returned None even though litellm.model_cost["gpt-5.4"]["supports_xhigh_reasoning_effort"] was True.

Fix

litellm/utils.py — Add the four missing fields to the ModelInfoBase(...) constructor call in _get_model_info_helper:

supports_parallel_function_calling=_model_info.get("supports_parallel_function_calling", None),
supports_none_reasoning_effort=_model_info.get("supports_none_reasoning_effort", None),
supports_xhigh_reasoning_effort=_model_info.get("supports_xhigh_reasoning_effort", None),
supports_minimal_reasoning_effort=_model_info.get("supports_minimal_reasoning_effort", None),

litellm/types/utils.py — Add supports_minimal_reasoning_effort to the ProviderSpecificModelInfo TypedDict. The field was already present in model_prices_and_context_window.json and used in gpt_5_transformation.py but not declared in the type definition.

tests/test_litellm/test_utils.py — Add test_get_model_info_shows_supports_xhigh_reasoning_effort regression test that verifies get_model_info returns the same values for supports_xhigh_reasoning_effort, supports_none_reasoning_effort, and supports_minimal_reasoning_effort as litellm.model_cost for gpt-5.4.

…l_info

get_model_info was not returning supports_xhigh_reasoning_effort,
supports_none_reasoning_effort, or supports_minimal_reasoning_effort
even though these fields exist in model_prices_and_context_window.json.

The _get_model_info_helper function builds a ModelInfoBase object by
explicitly passing each field, but these three reasoning-effort capability
fields were missing from the constructor call. Also added
supports_parallel_function_calling which was similarly omitted.

Changes:
- litellm/utils.py: add the four missing fields to ModelInfoBase(...)
  constructor in _get_model_info_helper
- litellm/types/utils.py: add supports_minimal_reasoning_effort to
  ProviderSpecificModelInfo TypedDict (it was already in the JSON and
  used in gpt_5_transformation.py but not in the type definition)
- tests/test_litellm/test_utils.py: add regression test for the bug
  (issue BerriAI#25096)

Fixes BerriAI#25096
@vercel

vercel Bot commented Apr 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 3, 2026 7:54pm

Request Review

@codspeed

codspeed Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing abhishekDeshmukh74:fix/get-model-info-xhigh-reasoning-effort (2726432) with main (d4a3a5e)

Open in CodSpeed

@greptile-apps

greptile-apps Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a gap in litellm.get_model_info where four capability fields (supports_xhigh_reasoning_effort, supports_none_reasoning_effort, supports_minimal_reasoning_effort, supports_parallel_function_calling) were silently dropped even though the values existed in model_prices_and_context_window.json. The root cause was that _get_model_info_helper explicitly constructs a ModelInfoBase TypedDict and simply omitted those four fields from the constructor call.

  • litellm/utils.py: Adds the four missing fields to the ModelInfoBase(...) constructor in _get_model_info_helper, making get_model_info consistent with litellm.model_cost.
  • litellm/types/utils.py: Adds supports_minimal_reasoning_effort to ProviderSpecificModelInfo — the field was already used in transformation code and the JSON cost map but was undeclared in the TypedDict.
  • tests/test_litellm/test_utils.py: Adds a clean regression test for all four fixed fields against gpt-5.4, with proper try/finally teardown that restores both litellm.model_cost and the LITELLM_LOCAL_MODEL_COST_MAP env-var (addressing concerns from the prior review).

Both issues flagged in the previous Greptile review (global state leak, missing supports_parallel_function_calling assertion) have been resolved in this iteration.

Confidence Score: 5/5

Safe to merge — targeted, additive fix with no backwards-incompatible changes and a proper regression test.

All changes are purely additive: new fields in a TypedDict and new keyword arguments in a constructor call. No existing behaviour is altered. The regression test covers all four fixed fields and cleans up global state. Both previous review concerns are resolved. No P0 or P1 findings remain.

No files require special attention.

Important Files Changed

Filename Overview
litellm/types/utils.py Adds supports_minimal_reasoning_effort to ProviderSpecificModelInfo TypedDict, which was present in the JSON cost map and used in transformation code but missing from the type definition.
litellm/utils.py Adds four previously-omitted capability fields (supports_parallel_function_calling, supports_none_reasoning_effort, supports_xhigh_reasoning_effort, supports_minimal_reasoning_effort) to the ModelInfoBase constructor call in _get_model_info_helper, closing the gap between litellm.model_cost and litellm.get_model_info.
tests/test_litellm/test_utils.py Adds regression test test_get_model_info_shows_supports_xhigh_reasoning_effort covering all four fixed fields for gpt-5.4; properly restores litellm.model_cost and the env-var in a try/finally block, addressing the global-state concern raised in the prior review.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["litellm.get_model_info(model)"] --> B["_get_model_info_helper()"]
    B --> C["_model_info = litellm.model_cost[model]"]
    C --> D["ModelInfoBase(...) constructor"]
    D --> E["supports_function_calling ✅"]
    D --> F["supports_vision ✅"]
    D --> G["supports_reasoning ✅"]
    D --> H["supports_computer_use ✅"]
    D --> I["supports_parallel_function_calling\n(was missing, now fixed ✅)"]
    D --> J["supports_none_reasoning_effort\n(was missing, now fixed ✅)"]
    D --> K["supports_xhigh_reasoning_effort\n(was missing, now fixed ✅)"]
    D --> L["supports_minimal_reasoning_effort\n(was missing, now fixed ✅)"]
    D --> M["... other fields ..."]
Loading

Reviews (2): Last reviewed commit: "test: address review comments - add glob..." | Re-trigger Greptile

Comment thread tests/test_litellm/test_utils.py Resolved
Comment thread tests/test_litellm/test_utils.py Resolved
…_function_calling assertion

- Wrap test body in try/finally to restore os.environ and litellm.model_cost
  after the test completes, preventing state leakage to subsequent tests
- Add assertion for supports_parallel_function_calling (the fourth field
  added to _get_model_info_helper, now fully covered by the test)
@codecov

codecov Bot commented Apr 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Sameerlite

Copy link
Copy Markdown
Contributor

The fix for #25096 was merged. Closing this

This branch was successfully deployed

1 active deployment
Preview — 27264323 Deployed Apr 3, 2026 by vercel[bot]
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.

[Bug]: litellm.get_model_info not giving supports_xhigh_reasoning_effort correctly

2 participants