Skip to content

fix(model-map): set supports_minimal_reasoning_effort false for gpt-5.1 and gpt-5.4 - #40547

Closed
CodeAlex52 wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
CodeAlex52:fix-gpt-minimal-reasoning-flag
Closed

CodeAlex52 wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
CodeAlex52:fix-gpt-minimal-reasoning-flag

Conversation

@CodeAlex52

@CodeAlex52 CodeAlex52 commented Sep 10, 2026 •

Copy link
Copy Markdown

TLDR

Problem this solves:

  • gpt-5.1 and gpt-5.4 reject reasoning_effort minimal with a provider 400
  • The model map flagged both as supporting minimal, so LiteLLM forwarded it

How it solves it:

  • Sets supports_minimal_reasoning_effort to false for gpt-5.1 and gpt-5.4
  • Syncs the bundled backup map and updates the affected test expectations

User Flow

Before: a developer sending reasoning_effort minimal to gpt-5.1 gets a hard failure

  1. They call the chat completions route with model gpt-5.1 and reasoning_effort minimal
  2. LiteLLM forwards minimal because the map says it is supported
  3. OpenAI answers 400 Unsupported value, supported values exclude minimal

After: the same call has minimal dropped, so no provider error

  1. They send the same request with drop_params enabled
  2. LiteLLM drops reasoning_effort before calling OpenAI
  3. The request succeeds without the unsupported value

Relevant issues

Fixes #40473

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Screenshots / Proof of Fix

Local param-mapping check with LITELLM_LOCAL_MODEL_COST_MAP=True, no live call

After (PR tip):

  1. Run get_optional_params for gpt-5.1, gpt-5.4, gpt-5.4-mini with reasoning_effort minimal and drop_params True
  2. All three return without reasoning_effort: {'stream': False, 'extra_body': {}}
  3. Full test file passes: 124 passed (tests/test_litellm/llms/openai/test_gpt5_transformation.py)

The live provider 400 for both models is documented in the linked issue

Type

🐛 Bug Fix

Caveats (if any)

Low

  • Dated snapshots and codex variants still carry true, left as is since only the two base models were verified live

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@CodeAlex52
CodeAlex52 requested a review from a team September 10, 2026 05:38
@CLAassistant

CLAassistant commented Sep 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR marks the base gpt-5.1 and gpt-5.4 models as not supporting minimal reasoning effort, synchronizes the bundled backup map, and updates focused parameter-mapping regression tests

  • Requests using drop_params=True now omit unsupported minimal reasoning effort for both models
  • Requests using drop_params=False reject the unsupported value
  • gpt-5.4-pro remains covered as a model that supports minimal reasoning effort

Confidence Score: 5/5

The PR appears safe to merge because the synchronized metadata and focused tests consistently enforce the corrected capability behavior

No actionable failure remains; both model maps agree, the production mapping path consumes the explicit capability flags, and supported variants retain separate positive coverage

Important Files Changed

Filename Overview
model_prices_and_context_window.json Corrects minimal reasoning-effort capability metadata for the two affected base models
litellm/model_prices_and_context_window_backup.json Keeps the bundled fallback model map synchronized with the primary map
tests/test_litellm/llms/openai/test_gpt5_transformation.py Adds drop-path regression coverage and updates rejection, supported-model, and capability-helper expectations

Reviews (1): Last reviewed commit: "fix(model-map): set supports_minimal_rea..." | Re-trigger Greptile

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing CodeAlex52:fix-gpt-minimal-reasoning-flag (06a6bf0) with litellm_internal_staging (13837d3)

Open in CodSpeed

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Closing in favor of the rolling registry PR #40581, which carries these changes after re-verifying them against the provider source.

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]: model map marks supports_minimal_reasoning_effort true for gpt-5.1 and gpt-5.4, but OpenAI rejects minimal on both

2 participants