fix: expose reasoning effort fields in get_model_info + add together_ai/gpt-oss-120b#25263
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Note on the format check failure: this is a pre-existing repo-wide issue tracked in #25181 — 328 files fail the formatter on |
Greptile SummaryThis PR fixes two related issues: (1)
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/5Safe 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.
|
| 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"]
Reviews (3): Last reviewed commit: "fix: link commit to GitHub account for C..." | Re-trigger Greptile
| "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 | ||
| }, |
There was a problem hiding this comment.
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:
- The orphaned first entry has a conflicting
max_input_tokensvalue (128000vs131072). - Strict JSON parsers, linters, and
jqwill flag or reject the file. - 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.
| "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 | ||
| }, |
There was a problem hiding this comment.
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.
541e81d
into
BerriAI:litellm_oss_staging_04_08_2026
Changes
Fix 1 —
get_model_infodropssupports_xhigh_reasoning_effort/supports_none_reasoning_effort(closes #25096)_get_model_info_helperinlitellm/utils.pyconstructs aModelInfoBaseby explicitly mapping fields from_model_info.supports_none_reasoning_effortandsupports_xhigh_reasoning_effortwere present inProviderSpecificModelInfoand in the JSON data (e.g.gpt-5.4has both set totrue) but were never passed through in the constructor call — soget_model_info()always returnedNonefor them.Fix: add the two missing
.get()calls alongsidesupports_reasoning.Fix 2 —
together_ai/openai/gpt-oss-120bmissing from model registry (closes #25132)together_ai/openai/gpt-oss-120bhad no entry inmodel_prices_and_context_window.json, so LiteLLM treated it as not supportingreasoning_effortand raisedUnsupportedParamsError. Added the entry with"supports_reasoning": true, modelled after the existingtogether_ai/openai/gpt-oss-20bandazure_ai/gpt-oss-120bentries. Pricing sourced from https://www.together.ai/models/gpt-oss-120b.Test plan
litellm.get_model_info("gpt-5.4")["supports_xhigh_reasoning_effort"]returnsTruelitellm.get_model_info("gpt-5.4")["supports_none_reasoning_effort"]returnsTruelitellm.completion(model="together_ai/openai/gpt-oss-120b", messages=[...], reasoning_effort="low")no longer raisesUnsupportedParamsError🤖 Generated with Claude Code