Skip to content

fix: expose reasoning effort fields in get_model_info + add together_ai/gpt-oss-120b#25263

Merged
krrish-berri-2 merged 3 commits intoBerriAI:litellm_oss_staging_04_08_2026from
avarga1:fix/model-info-reasoning-fields-and-gpt-oss-120b
Apr 9, 2026
Merged

fix: expose reasoning effort fields in get_model_info + add together_ai/gpt-oss-120b#25263
krrish-berri-2 merged 3 commits intoBerriAI:litellm_oss_staging_04_08_2026from
avarga1:fix/model-info-reasoning-fields-and-gpt-oss-120b

Conversation

@avarga1
Copy link
Copy Markdown
Contributor

@avarga1 avarga1 commented Apr 7, 2026

Changes

Fix 1 — get_model_info drops supports_xhigh_reasoning_effort / supports_none_reasoning_effort (closes #25096)

_get_model_info_helper in litellm/utils.py constructs a ModelInfoBase by explicitly mapping fields from _model_info. supports_none_reasoning_effort and supports_xhigh_reasoning_effort were present in ProviderSpecificModelInfo and in the JSON data (e.g. gpt-5.4 has both set to true) but were never passed through in the constructor call — so get_model_info() always returned None for them.

Fix: add the two missing .get() calls alongside supports_reasoning.

# before
supports_reasoning=_model_info.get("supports_reasoning", None),
supports_computer_use=_model_info.get("supports_computer_use", None),

# after
supports_reasoning=_model_info.get("supports_reasoning", 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_computer_use=_model_info.get("supports_computer_use", None),

Fix 2 — together_ai/openai/gpt-oss-120b missing from model registry (closes #25132)

together_ai/openai/gpt-oss-120b had no entry in model_prices_and_context_window.json, so LiteLLM treated it as not supporting reasoning_effort and raised UnsupportedParamsError. Added the entry with "supports_reasoning": true, modelled after the existing together_ai/openai/gpt-oss-20b and azure_ai/gpt-oss-120b entries. Pricing sourced from https://www.together.ai/models/gpt-oss-120b.

Test plan

  • litellm.get_model_info("gpt-5.4")["supports_xhigh_reasoning_effort"] returns True
  • litellm.get_model_info("gpt-5.4")["supports_none_reasoning_effort"] returns True
  • litellm.completion(model="together_ai/openai/gpt-oss-120b", messages=[...], reasoning_effort="low") no longer raises UnsupportedParamsError

🤖 Generated with Claude Code

…r_ai/gpt-oss-120b

- litellm/utils.py: pass supports_none_reasoning_effort and
  supports_xhigh_reasoning_effort through _get_model_info_helper so
  get_model_info() returns them (previously silently dropped). Fixes BerriAI#25096.

- model_prices_and_context_window.json: add together_ai/openai/gpt-oss-120b
  with supports_reasoning: true so reasoning_effort is accepted for this
  model without requiring drop_params. Fixes BerriAI#25132.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

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

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 8, 2026 2:13pm

Request Review

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 7, 2026

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.
1 out of 2 committers have signed the CLA.

✅ avarga1
❌ Austin Varga


Austin Varga 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.

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq bot commented Apr 7, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing avarga1:fix/model-info-reasoning-fields-and-gpt-oss-120b (374eabb) with main (62757ff)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avarga1
Copy link
Copy Markdown
Contributor Author

avarga1 commented Apr 7, 2026

Note on the format check failure: this is a pre-existing repo-wide issue tracked in #25181 — 328 files fail the formatter on main before any of our changes. Our diff is only 2 lines in utils.py and 13 lines in the JSON file. Happy to reformat our specific changes if that's helpful, but the CI failure isn't caused by this PR.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 7, 2026

Greptile Summary

This PR fixes two related issues: (1) get_model_info() was silently dropping supports_none_reasoning_effort and supports_xhigh_reasoning_effort because _get_model_info_helper never included them in the ModelInfoBase constructor call; and (2) together_ai/openai/gpt-oss-120b was missing supports_reasoning: true in the model registry, causing UnsupportedParamsError when reasoning_effort was passed.

  • litellm/utils.py: Two .get() calls added to _get_model_info_helper to pass the missing reasoning-effort fields through to ModelInfoBase, alongside the existing supports_reasoning field.
  • model_prices_and_context_window.json: Consolidated the together_ai/openai/gpt-oss-120b entry (previously a duplicate) into a single, correct record with supports_reasoning: true, max_output_tokens: 131072, and a source URL.
  • litellm/model_prices_and_context_window_backup.json: Synced with the same corrected entry so the fallback code path is also fixed.

Previous review concerns (duplicate JSON key and out-of-sync backup file) have been fully addressed by the subsequent commits in this PR. The fix is minimal and correct.

Confidence Score: 5/5

Safe to merge — all three files are correct, previous duplicate-key and backup-sync issues are resolved, and the utils.py passthrough fix is minimal and accurate.

All findings are P2 (missing regression tests). No logic errors, no security issues, and the previously flagged duplicate key and unsynced backup file have both been addressed in subsequent commits.

No files require special attention; the only suggestion is adding a unit test to tests/test_litellm/test_utils.py.

Vulnerabilities

No security concerns identified. Changes are limited to JSON model registry data and a read-only model info lookup helper; no auth, input validation, or data-handling paths are affected.

Important Files Changed

Filename Overview
litellm/utils.py Adds two missing .get() calls in _get_model_info_helper to expose supports_none_reasoning_effort and supports_xhigh_reasoning_effort from the JSON registry — correct and minimal fix.
model_prices_and_context_window.json Consolidated previously-duplicate together_ai/openai/gpt-oss-120b entry into a single correct record; now has supports_reasoning: true, max_output_tokens: 131072, and source URL.
litellm/model_prices_and_context_window_backup.json Backup file synced with the corrected together_ai/openai/gpt-oss-120b entry; fallback code path will now also correctly expose supports_reasoning: true.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["litellm.get_model_info(model)"] --> B["_get_model_info_helper()"]
    B --> C["Lookup in model_prices_and_context_window.json\n(fallback: backup.json)"]
    C --> D["_model_info dict\n(includes supports_reasoning,\nsupports_none_reasoning_effort,\nsupports_xhigh_reasoning_effort)"]
    D --> E["ModelInfoBase constructor"]
    E -->|"Before fix: missing fields"| F["supports_none_reasoning_effort = None\nsupports_xhigh_reasoning_effort = None"]
    E -->|"After fix: fields passed through"| G["supports_none_reasoning_effort = True/False\nsupports_xhigh_reasoning_effort = True/False"]
    G --> H["Returned to caller"]
    F --> I["Bug: caller always sees None"]
Loading

Reviews (3): Last reviewed commit: "fix: link commit to GitHub account for C..." | Re-trigger Greptile

Comment thread model_prices_and_context_window.json Outdated
Comment on lines +28520 to +28534
"together_ai/openai/gpt-oss-120b": {
"input_cost_per_token": 1.5e-07,
"litellm_provider": "together_ai",
"max_input_tokens": 131072,
"max_output_tokens": 131072,
"max_tokens": 131072,
"mode": "chat",
"output_cost_per_token": 6e-07,
"source": "https://www.together.ai/models/gpt-oss-120b",
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true
},
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 Duplicate key — existing entry not removed

The key "together_ai/openai/gpt-oss-120b" already exists earlier in this file (~line 28496, present before this PR), with max_input_tokens: 128000 and no supports_reasoning field. This PR appends a second entry instead of updating the existing one.

JSON does not permit duplicate keys (RFC 8259 §4 leaves the behavior undefined). Python's json.loads silently picks the last occurrence — so the fix works at runtime — but:

  1. The orphaned first entry has a conflicting max_input_tokens value (128000 vs 131072).
  2. Strict JSON parsers, linters, and jq will flag or reject the file.
  3. It will confuse future maintainers who see two entries for the same model.

Fix: Remove (or update in place) the pre-existing entry at ~line 28496 so the key appears exactly once with the correct values.

Comment thread model_prices_and_context_window.json Outdated
Comment on lines +28520 to +28534
"together_ai/openai/gpt-oss-120b": {
"input_cost_per_token": 1.5e-07,
"litellm_provider": "together_ai",
"max_input_tokens": 131072,
"max_output_tokens": 131072,
"max_tokens": 131072,
"mode": "chat",
"output_cost_per_token": 6e-07,
"source": "https://www.together.ai/models/gpt-oss-120b",
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true
},
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 Backup file not updated

litellm/model_prices_and_context_window_backup.json is the fallback used when the primary file cannot be loaded. It still has only the old entry for "together_ai/openai/gpt-oss-120b"max_input_tokens: 128000, no supports_reasoning: true, no max_output_tokens/max_tokens. Any code path that falls back to the backup will still trigger the UnsupportedParamsError this PR is fixing.

Please add the corrected entry to litellm/model_prices_and_context_window_backup.json as well.

@krrish-berri-2 krrish-berri-2 changed the base branch from main to litellm_oss_staging_04_08_2026 April 9, 2026 04:33
@krrish-berri-2 krrish-berri-2 merged commit 541e81d into BerriAI:litellm_oss_staging_04_08_2026 Apr 9, 2026
49 of 51 checks passed
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]: Register gpt-oss as supporting reasoning [Bug]: litellm.get_model_info not giving supports_xhigh_reasoning_effort correctly

3 participants