litellm - ✅(Solved) Fix [Bug]: `litellm.get_model_info` not giving `supports_xhigh_reasoning_effort` correctly [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#25096Fetched 2026-04-08 02:45:06
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Participants
Timeline (top)
labeled ×3cross-referenced ×2referenced ×2

Error Message

get_model_info: None model_cost: True Traceback (most recent call last): File "/path/to/a.py", line 9, in <module> info.get("supports_xhigh_reasoning_effort") AssertionError: Expected xhigh in both model info and costs

Fix Action

Fixed

PR fix notes

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

Description (problem / solution / changelog)

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.

Changed files

  • litellm/types/utils.py (modified, +1/-0)
  • litellm/utils.py (modified, +12/-0)
  • tests/test_litellm/test_utils.py (modified, +51/-0)

Code Example

import litellm

model = "gpt-5.4"
info = litellm.get_model_info(model)
model_cost = litellm.model_cost[model]
print(f"get_model_info:    {info.get('supports_xhigh_reasoning_effort')}")  # None
print(f"model_cost:        {model_cost['supports_xhigh_reasoning_effort']}")  # True
assert (
    info.get("supports_xhigh_reasoning_effort")
    == model_cost["supports_xhigh_reasoning_effort"]
), "Expected xhigh in both model info and costs"

---

get_model_info:    None
model_cost:        True
Traceback (most recent call last):
  File "/path/to/a.py", line 9, in <module>
    info.get("supports_xhigh_reasoning_effort")
AssertionError: Expected xhigh in both model info and costs
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

litellm.get_model_info is not giving supports_xhigh_reasoning_effort when it should be for OpenAI GPT 5.4.

Steps to Reproduce

import litellm

model = "gpt-5.4"
info = litellm.get_model_info(model)
model_cost = litellm.model_cost[model]
print(f"get_model_info:    {info.get('supports_xhigh_reasoning_effort')}")  # None
print(f"model_cost:        {model_cost['supports_xhigh_reasoning_effort']}")  # True
assert (
    info.get("supports_xhigh_reasoning_effort")
    == model_cost["supports_xhigh_reasoning_effort"]
), "Expected xhigh in both model info and costs"

Relevant log output

get_model_info:    None
model_cost:        True
Traceback (most recent call last):
  File "/path/to/a.py", line 9, in <module>
    info.get("supports_xhigh_reasoning_effort")
AssertionError: Expected xhigh in both model info and costs

What part of LiteLLM is this about?

SDK (litellm Python package)

What LiteLLM version are you on ?

1.82.6

extent analysis

TL;DR

The litellm.get_model_info function may not be returning the expected supports_xhigh_reasoning_effort value for OpenAI GPT 5.4, suggesting a potential discrepancy in the model information retrieval.

Guidance

  • Verify that the litellm package version 1.82.6 is up-to-date and check for any known issues or updates related to the get_model_info function.
  • Compare the implementation of litellm.get_model_info and litellm.model_cost to identify any differences in how they retrieve or handle the supports_xhigh_reasoning_effort attribute.
  • Test the get_model_info function with other models to see if the issue is specific to OpenAI GPT 5.4 or a more general problem.
  • Check the documentation for litellm.get_model_info to ensure that it is correctly implemented and that the expected behavior matches the actual behavior.

Example

# Example code to test get_model_info with other models
models = ["gpt-3.5", "gpt-4.0", "gpt-5.4"]
for model in models:
    info = litellm.get_model_info(model)
    print(f"Model: {model}, supports_xhigh_reasoning_effort: {info.get('supports_xhigh_reasoning_effort')}")

Notes

The issue may be related to a specific implementation detail in the litellm package or a version-specific bug. Without more information about the package's internal workings, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: Modify the code to use litellm.model_cost as a fallback when litellm.get_model_info does not return the expected value, as it seems to have the correct information. This can help mitigate the issue until a more permanent fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix [Bug]: `litellm.get_model_info` not giving `supports_xhigh_reasoning_effort` correctly [1 pull requests, 1 participants]