Skip to content

fix(model-registry): add gpt-5.1-mini/nano and fix azure/gpt-5.4 family reasoning effort flags - #28701

Closed
mohamedelhabib wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
mohamedelhabib:litellm_internal_staging
Closed

mohamedelhabib wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
mohamedelhabib:litellm_internal_staging

Conversation

@mohamedelhabib

Copy link
Copy Markdown
  • Add gpt-5.1-mini and gpt-5.1-nano entries with supports_none_reasoning_effort=true, matching the gpt-5.1 family contract (xhigh=false, minimal=true). These models were absent from the registry causing a spurious 400 UnsupportedParamsError for any temperature != 1 even when reasoning_effort was omitted.
  • Fix azure/gpt-5.4 and azure/gpt-5.4-2026-03-05: missing all three flags, now set to none=true/xhigh=true/minimal=true (aligned with azure_ai/gpt-5.4).
  • Fix azure/gpt-5.4-mini, azure/gpt-5.4-mini-2026-03-17, azure/gpt-5.4-nano, azure/gpt-5.4-nano-2026-03-17: had none=false/xhigh=false explicitly, now none=true/xhigh=true/minimal=false (aligned with azure_ai counterparts).
  • Mirror all changes to model_prices_and_context_window_backup.json.

Fixes: #27351

Relevant issues

Linear ticket

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

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Screenshots / Proof of Fix

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

…ly reasoning effort flags

- Add gpt-5.1-mini and gpt-5.1-nano entries with supports_none_reasoning_effort=true,
  matching the gpt-5.1 family contract (xhigh=false, minimal=true). These models were
  absent from the registry causing a spurious 400 UnsupportedParamsError for any
  temperature != 1 even when reasoning_effort was omitted.
- Fix azure/gpt-5.4 and azure/gpt-5.4-2026-03-05: missing all three flags, now set to
  none=true/xhigh=true/minimal=true (aligned with azure_ai/gpt-5.4).
- Fix azure/gpt-5.4-mini, azure/gpt-5.4-mini-2026-03-17, azure/gpt-5.4-nano,
  azure/gpt-5.4-nano-2026-03-17: had none=false/xhigh=false explicitly, now
  none=true/xhigh=true/minimal=false (aligned with azure_ai counterparts).
- Mirror all changes to model_prices_and_context_window_backup.json.

Fixes: BerriAI#27351

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented May 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@mohamedelhabib

Copy link
Copy Markdown
Author

@greptile-apps

@codecov

codecov Bot commented May 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented May 23, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes two classes of missing/incorrect reasoning-effort capability flags in the model registry and adds the corresponding regression tests. Both JSON files (primary and backup) are updated in sync.

  • Adds gpt-5.1-mini and gpt-5.1-nano registry entries with supports_none_reasoning_effort: true (and supports_minimal_reasoning_effort: true, supports_xhigh_reasoning_effort: false), matching the gpt-5.1 family contract; their absence caused a spurious 400 UnsupportedParamsError for any temperature != 1 when reasoning_effort was omitted.
  • Fixes azure/gpt-5.4 and azure/gpt-5.4-2026-03-05 (all three flags were missing → now none=true/xhigh=true/minimal=true) and corrects azure/gpt-5.4-mini, azure/gpt-5.4-mini-2026-03-17, azure/gpt-5.4-nano, azure/gpt-5.4-nano-2026-03-17 (flags were explicitly false → now none=true/xhigh=true/minimal=false), aligning all with their azure_ai/* counterparts.
  • New test fixtures in both test files use monkeypatch to load the local cost map; the Azure fixture correctly omits the add_known_models call that previously leaked side effects into global sets.

Confidence Score: 5/5

Safe to merge — the changes are additive registry corrections with no logic changes, and the flag values were verified against the azure_ai counterparts.

All changes are confined to two JSON registry files and two test files. The reasoning-effort flag corrections align with the existing azure_ai entries, the new gpt-5.1-mini/nano entries use distinct and realistic pricing, both JSON files are kept in sync, and the tests exercise the exact code paths fixed by the registry updates.

No files require special attention.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds gpt-5.1-mini and gpt-5.1-nano registry entries with correct reasoning-effort flags; fixes azure/gpt-5.4 (missing flags) and azure/gpt-5.4-mini/nano (false→true) to align with azure_ai counterparts.
litellm/model_prices_and_context_window_backup.json Mirrors all changes from the primary JSON exactly — reasoning-effort flag updates and new model entries are consistent between the two files.
tests/test_litellm/llms/openai/test_gpt5_transformation.py New parametrised tests cover gpt-5.1-mini/nano: none-effort flag check, temperature pass-through, explicit none+temperature, rejection of high-effort with non-1 temperature, and openai/-prefixed normalisation.
tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py Adds use_local_model_cost_map autouse fixture (without the problematic add_known_models call) and four new parametrised test groups covering azure/gpt-5.4, gpt-5.4-mini, and gpt-5.4-nano reasoning-effort and temperature behaviour.

Reviews (4): Last reviewed commit: "fix(model-registry): use proportional pr..." | Re-trigger Greptile

Comment thread model_prices_and_context_window.json Resolved
@greptile-apps

greptile-apps Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes missing and incorrect reasoning-effort capability flags in the model registry for the gpt-5.1 and gpt-5.4 families. It adds new gpt-5.1-mini and gpt-5.1-nano entries (missing from the registry entirely), corrects supports_none_reasoning_effort / supports_xhigh_reasoning_effort on six azure/gpt-5.4* variants, and mirrors all changes to the backup JSON.

  • Added gpt-5.1-mini and gpt-5.1-nano registry entries with supports_none_reasoning_effort: true, resolving spurious UnsupportedParamsError 400s for any temperature when reasoning_effort was not specified.
  • Fixed azure/gpt-5.4 (was missing all three flags) and azure/gpt-5.4-mini / azure/gpt-5.4-nano variants (had flags explicitly false), aligning them with their azure_ai/ counterparts.
  • Added an autouse fixture in the Azure test file to force the local model cost map during tests, and added regression test suites covering temperature passthrough and xhigh/minimal effort acceptance/rejection for all affected models.

Confidence Score: 3/5

The reasoning-effort flag corrections are correct and well-tested, but the new gpt-5.1-mini and gpt-5.1-nano entries carry pricing values copied verbatim from the base gpt-5.1 model, making both variants cost the same as the full model and the same as each other.

The flag corrections for azure/gpt-5.4* variants and the missing registry entries for gpt-5.1-mini/nano are sound. However, gpt-5.1-mini and gpt-5.1-nano were assigned identical token costs to gpt-5.1, and identical costs to each other — which is inconsistent with how every other mini/nano pair in the registry is priced. If these prices go live, every cost estimate for these two models will be wrong until a follow-up corrects them.

model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json — specifically the pricing fields of the new gpt-5.1-mini and gpt-5.1-nano entries.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds gpt-5.1-mini and gpt-5.1-nano registry entries and fixes reasoning-effort flags for azure/gpt-5.4 family; new mini/nano entries carry identical pricing to the base gpt-5.1 model, which is likely incorrect.
litellm/model_prices_and_context_window_backup.json Mirror of the main JSON changes; carries the same pricing inconsistency for gpt-5.1-mini and gpt-5.1-nano.
tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py Adds autouse fixture to load local model cost map and new regression tests for azure/gpt-5.4 variants; autouse fixture calls add_known_models with a side-effect not cleaned up by monkeypatch.
tests/test_litellm/llms/openai/test_gpt5_transformation.py Adds well-structured regression tests covering gpt-5.1-mini and gpt-5.1-nano temperature and reasoning_effort behavior; no issues found.

Reviews (2): Last reviewed commit: "fix(model-registry): add gpt-5.1-mini/na..." | Re-trigger Greptile

Comment thread model_prices_and_context_window.json Resolved
…drop add_known_models side-effect

- gpt-5.1-mini and gpt-5.1-nano were priced identically to the base gpt-5.1 model.
  Apply the same ~30% (mini) and ~8% (nano) ratios used by the gpt-5.4 family:
    gpt-5.1-mini: input 3.75e-07, output 3e-06 (was 1.25e-06 / 1e-05)
    gpt-5.1-nano: input 1e-07,    output 8e-07 (was 1.25e-06 / 1e-05)
  Note: official OpenAI pricing for these aliases is not yet published; values
  are proportional estimates and will be updated when pricing is confirmed.
- Remove litellm.add_known_models() call from the Azure test autouse fixture —
  it mutates module-level sets (open_ai_chat_completion_models, etc.) that
  monkeypatch does not roll back, creating hidden test-ordering dependencies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mohamedelhabib

Copy link
Copy Markdown
Author

@greptile-apps all feedbacks fixed

@mohamedelhabib

Copy link
Copy Markdown
Author

@greptile-apps all feedbacks fixed check the latest commit

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: gpt-5.1-mini / gpt-5.1-nano reject temperature when reasoning_effort is omitted (registry gap — supports_none_reasoning_effort missing)

2 participants