litellm - ✅(Solved) Fix [Bug]: gpt-5.1-mini / gpt-5.1-nano reject temperature when reasoning_effort is omitted (registry gap — supports_none_reasoning_effort missing) [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#27351Fetched 2026-05-07 03:33:02
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1labeled ×1

Error Message

$ curl -sw "\n%{http_code}\n" -X POST $LITELLM_URL/v1/chat/completions
-H "Authorization: Bearer $VKEY" -H "Content-Type: application/json"
-d '{"model":"openai/gpt-5.1-mini","messages":[{"role":"user","content":"reply ok"}],"temperature":0.7,"max_tokens":50}'

{"error":{"message":"litellm.UnsupportedParamsError: gpt-5 models (including gpt-5-codex) don't support temperature=0.7. Only temperature=1 is supported. For gpt-5.1, temperature is supported when reasoning_effort='none' (or not specified, as it defaults to 'none')...","type":"None","param":null,"code":"400"}} 400

Root Cause

Root cause appears to be a registry gap in model_prices_and_context_window.json:

Fix Action

Fix / Workaround

Pricing entries for these aliases are already proposed in the open PR #22621 (which doesn't touch the reasoning-effort flags). If a maintainer prefers, this could fold into that PR, or ship as a separate JSON-only patch.

Workaround in the meantime

1.83.10-stable (also expected to repro on 1.83.14-stable.patch.2 — fix landing in the JSON registry would propagate to all versions on next auto-fetch).

PR fix notes

PR #27355: fix: add gpt-5.1-mini and gpt-5.1-nano registry entries with supports_none_reasoning_effort

Description (problem / solution / changelog)

Relevant issues

Fixes #27351

What this fixes

Per OpenAI's parameter compatibility guide, the gpt-5.1 family — including gpt-5.1-mini and gpt-5.1-nano — supports temperature when reasoning_effort is set to 'none' (or omitted, since the API default is 'none' for the 5.1 family). LiteLLM's pre-flight check in OpenAIGPT5Config.map_openai_params correctly applies this for the bare gpt-5.1 slug because gpt-5.1 has supports_none_reasoning_effort: true in model_prices_and_context_window.json.

But gpt-5.1-mini and gpt-5.1-nano are absent from the registry entirely, so the gate falls back to strict rejection — litellm.UnsupportedParamsError even when reasoning_effort is null/omitted.

Reproduction (from #27351)

LiteLLM v1.83.10-stable, standard /v1/chat/completions (no Responses-API routing, no Azure):

Case A — openai/gpt-5.1 (control, in registry):

$ curl -sw "\n%{http_code}\n" -X POST $LITELLM_URL/v1/chat/completions \
    -H "Authorization: Bearer $VKEY" -H "Content-Type: application/json" \
    -d '{"model":"openai/gpt-5.1","messages":[{"role":"user","content":"reply ok"}],"temperature":0.7,"max_tokens":50}'
{"id":"chatcmpl-...","model":"openai/gpt-5.1","object":"chat.completion","choices":[...],...}
200

Case B — openai/gpt-5.1-mini (not in registry):

{"error":{"message":"litellm.UnsupportedParamsError: gpt-5 models (including gpt-5-codex) don't support temperature=0.7. Only temperature=1 is supported. For gpt-5.1, temperature is supported when reasoning_effort='none' (or not specified, as it defaults to 'none')...","type":"None","param":null,"code":"400"}}
400

Case C — openai/gpt-5.1-nano (not in registry): identical 400.

After this PR: B and C return 200, matching A.

Changes

Adds two new entries to model_prices_and_context_window.jsongpt-5.1-mini and gpt-5.1-nano — placed alphabetically right after gpt-5.1-codex-mini. The flag matrix mirrors the existing gpt-5.1 entry, in particular:

  • supports_none_reasoning_effort: true — the load-bearing flag that gates the temperature pass-through
  • supports_minimal_reasoning_effort: true
  • supports_xhigh_reasoning_effort: false
  • All supports_* capability flags (function_calling, parallel_function_calling, prompt_caching, reasoning, response_schema, system_messages, tool_choice, vision, web_search, pdf_input, native_streaming) align with the bare gpt-5.1 row.
  • mode: "chat", supported_endpoints: ["/v1/chat/completions", "/v1/batch", "/v1/responses"].

Pricing rationale

OpenAI has not (to my knowledge) yet published distinct pricing for gpt-5.1-mini / gpt-5.1-nano. Rather than invent numbers, this PR anchors pricing to the gpt-5-mini / gpt-5-nano registry entries (the 5.0-generation siblings on the same scale tier from the same provider). When OpenAI publishes explicit 5.1-mini/-nano pricing, those rows can be tightened in a follow-up — and meanwhile cost tracking won't fall through to $0.

Specifically:

  • gpt-5.1-mini pricing matches gpt-5-mini (input 2.5e-07, output 2e-06, with flex / priority tiers populated per the sibling).
  • gpt-5.1-nano pricing matches gpt-5-nano (input 5e-08, output 4e-07, with flex tiers populated).
  • Context window: max_input_tokens: 272000, max_output_tokens: 128000 — same as the rest of the gpt-5.1 family and the gpt-5-mini/-nano siblings.

Overlap with #22621

There is an open PR #22621 that adds pricing for gpt-5.1-mini (using the OpenAI mini pricing tier with 400K context / 128K max output) but does not address the missing reasoning-effort flags and so does not actually fix the UnsupportedParamsError users see today. This PR is filed independently with a tighter, JSON-only scope so maintainers can decide merge order; if #22621 lands first, the conflict will be a single key and easy to resolve (and our mini context window can adopt the 400K value if maintainers prefer it). If this PR lands first, #22621 reduces to a clean pricing tightening on top.

Sibling note (NOT changed in this PR)

gpt-5.1-codex is in the registry with supports_none_reasoning_effort: false. If Codex variants follow the same OpenAI contract as the rest of the 5.1 family, that's likely also wrong — but it's a behavior change to an existing row rather than an unambiguous gap, so it's deliberately out of scope here. Same for gpt-5.1-codex-mini and gpt-5.1-codex-max. Filing this PR for the absent rows only.

Tests

Extends tests/test_litellm/llms/openai/test_gpt5_transformation.py:

  • test_gpt5_1_model_detection: adds two assertions that _supports_reasoning_effort_level("gpt-5.1-mini", "none") and _supports_reasoning_effort_level("gpt-5.1-nano", "none") both resolve to True via the registry.
  • test_gpt5_1_mini_nano_temperature_with_reasoning_effort_none: new test mirroring the existing test_gpt5_1_temperature_with_reasoning_effort_none, asserting temperature pass-through for the two new slugs across [0.0, 0.7, 1.0, 1.5] with reasoning_effort='none'.

Pre-Submission checklist

  • I have added testing in tests/test_litellm/ directory
  • My PR's scope is as isolated as possible — JSON registry + a targeted test extension only
  • No code logic changed; pure data/registry update plus matching test
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review (will request right after this PR opens)

Type

Bug Fix

Changed files

  • .circleci/config.yml (modified, +308/-47)
  • .github/workflows/check-lazy-openapi-snapshot.yml (removed, +0/-75)
  • .github/workflows/create-release.yml (modified, +4/-2)
  • .github/workflows/test-unit-proxy-db.yml (modified, +1/-0)
  • .gitignore (modified, +3/-2)
  • Dockerfile (modified, +3/-3)
  • Makefile (modified, +3/-0)
  • README.md (modified, +1/-1)
  • codecov.yaml (modified, +6/-1)
  • cookbook/litellm-ollama-docker-image/requirements.txt (modified, +1/-1)
  • deploy/charts/litellm-helm/templates/deployment.yaml (modified, +17/-0)
  • deploy/charts/litellm-helm/tests/deployment_tests.yaml (modified, +5/-5)
  • deploy/charts/litellm-helm/values.yaml (modified, +17/-6)
  • docker/Dockerfile.alpine (modified, +1/-1)
  • docker/Dockerfile.database (modified, +3/-3)
  • docker/Dockerfile.dev (modified, +1/-1)
  • docker/Dockerfile.health_check (modified, +1/-1)
  • docker/Dockerfile.non_root (modified, +3/-5)
  • docs/images/local-testing/hosted-vllm-custom-tool-local-test.png (added, +0/-0)
  • docs/my-website/docs/providers/crusoe.md (added, +196/-0)
  • enterprise/enterprise_hooks/banned_keywords.py (modified, +17/-9)
  • enterprise/enterprise_hooks/google_text_moderation.py (modified, +4/-5)
  • enterprise/enterprise_hooks/openai_moderation.py (modified, +3/-5)
  • enterprise/litellm_enterprise/enterprise_callbacks/secret_detection.py (modified, +20/-44)
  • enterprise/litellm_enterprise/proxy/auth/custom_sso_handler.py (modified, +32/-22)
  • enterprise/litellm_enterprise/proxy/hooks/managed_files.py (modified, +193/-125)
  • enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py (modified, +54/-29)
  • enterprise/pyproject.toml (modified, +3/-3)
  • litellm-js/proxy/package-lock.json (added, +2054/-0)
  • litellm-js/proxy/package.json (modified, +3/-3)
  • litellm-js/spend-logs/package-lock.json (modified, +4/-4)
  • litellm-js/spend-logs/package.json (modified, +1/-1)
  • litellm-proxy-extras/litellm_proxy_extras/migrations/20260501195714_managed_resource_team_owner/migration.sql (added, +20/-0)
  • litellm-proxy-extras/litellm_proxy_extras/schema.prisma (modified, +11/-5)
  • litellm-proxy-extras/pyproject.toml (modified, +3/-3)
  • litellm/__init__.py (modified, +17/-1)
  • litellm/_logging.py (modified, +3/-66)
  • litellm/anthropic_beta_headers_config.json (modified, +2/-2)
  • litellm/batches/batch_utils.py (modified, +75/-3)
  • litellm/caching/caching.py (modified, +2/-1)
  • litellm/caching/caching_handler.py (modified, +77/-22)
  • litellm/caching/dual_cache.py (modified, +19/-0)
  • litellm/caching/qdrant_semantic_cache.py (modified, +123/-71)
  • litellm/caching/redis_cache.py (modified, +9/-1)
  • litellm/caching/redis_semantic_cache.py (modified, +139/-33)
  • litellm/constants.py (modified, +14/-3)
  • litellm/cost_calculator.py (modified, +5/-1)
  • litellm/files/main.py (modified, +24/-0)
  • litellm/integrations/arize/_utils.py (modified, +38/-4)
  • litellm/integrations/arize/arize_phoenix_client.py (modified, +14/-1)
  • litellm/integrations/arize/arize_phoenix_prompt_manager.py (modified, +9/-2)
  • litellm/integrations/azure_sentinel/azure_sentinel.py (modified, +111/-28)
  • litellm/integrations/bitbucket/bitbucket_client.py (modified, +22/-3)
  • litellm/integrations/bitbucket/bitbucket_prompt_manager.py (modified, +9/-2)
  • litellm/integrations/custom_sso_handler.py (modified, +11/-0)
  • litellm/integrations/gcs_bucket/gcs_bucket.py (modified, +9/-4)
  • litellm/integrations/gcs_bucket/gcs_bucket_base.py (modified, +10/-3)
  • litellm/integrations/gitlab/gitlab_prompt_manager.py (modified, +9/-2)
  • litellm/integrations/langfuse/langfuse.py (modified, +35/-8)
  • litellm/integrations/langfuse/langfuse_handler.py (modified, +3/-1)
  • litellm/integrations/langfuse/langfuse_prompt_management.py (modified, +10/-9)
  • litellm/integrations/langsmith.py (modified, +35/-10)
  • litellm/integrations/opentelemetry.py (modified, +35/-18)
  • litellm/integrations/prometheus.py (modified, +179/-55)
  • litellm/integrations/prometheus_helpers/bounded_prometheus_series_tracker.py (added, +107/-0)
  • litellm/integrations/prometheus_helpers/prometheus_api.py (modified, +23/-1)
  • litellm/litellm_core_utils/cli_token_utils.py (modified, +17/-5)
  • litellm/litellm_core_utils/cloud_storage_security.py (added, +175/-0)
  • litellm/litellm_core_utils/custom_logger_registry.py (modified, +2/-0)
  • litellm/litellm_core_utils/exception_mapping_utils.py (modified, +16/-5)
  • litellm/litellm_core_utils/get_llm_provider_logic.py (modified, +12/-0)
  • litellm/litellm_core_utils/initialize_dynamic_callback_params.py (modified, +10/-3)
  • litellm/litellm_core_utils/litellm_logging.py (modified, +7/-2)
  • litellm/litellm_core_utils/llm_request_utils.py (modified, +3/-3)
  • litellm/litellm_core_utils/prompt_templates/factory.py (modified, +106/-11)
  • litellm/litellm_core_utils/realtime_streaming.py (modified, +278/-30)
  • litellm/litellm_core_utils/secret_redaction.py (added, +81/-0)
  • litellm/litellm_core_utils/streaming_handler.py (modified, +1/-1)
  • litellm/litellm_core_utils/url_utils.py (modified, +164/-4)
  • litellm/llms/anthropic/batches/transformation.py (modified, +3/-1)
  • litellm/llms/anthropic/chat/handler.py (modified, +48/-4)
  • litellm/llms/anthropic/chat/transformation.py (modified, +539/-56)
  • litellm/llms/anthropic/common_utils.py (modified, +12/-1)
  • litellm/llms/anthropic/experimental_pass_through/adapters/handler.py (modified, +33/-4)
  • litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py (modified, +18/-5)
  • litellm/llms/anthropic/experimental_pass_through/messages/transformation.py (modified, +62/-0)
  • litellm/llms/anthropic/files/handler.py (modified, +5/-1)
  • litellm/llms/anthropic/files/transformation.py (modified, +7/-3)
  • litellm/llms/anthropic/skills/transformation.py (modified, +3/-1)
  • litellm/llms/azure/azure.py (modified, +35/-6)
  • litellm/llms/azure/cost_calculation.py (modified, +5/-1)
  • litellm/llms/azure/image_edit/transformation.py (modified, +18/-0)
  • litellm/llms/azure/image_generation/__init__.py (modified, +2/-0)
  • litellm/llms/azure/image_generation/http_utils.py (added, +17/-0)
  • litellm/llms/azure/realtime/handler.py (modified, +4/-2)
  • litellm/llms/azure/responses/transformation.py (modified, +9/-2)
  • litellm/llms/azure_ai/agents/handler.py (modified, +14/-4)
  • litellm/llms/azure_ai/anthropic/transformation.py (modified, +21/-1)
  • litellm/llms/azure_ai/cost_calculator.py (modified, +2/-0)
  • litellm/llms/azure_ai/ocr/document_intelligence/transformation.py (modified, +22/-1)

Code Example

$ curl -sw "\n%{http_code}\n" -X POST $LITELLM_URL/v1/chat/completions \
    -H "Authorization: Bearer $VKEY" -H "Content-Type: application/json" \
    -d '{"model":"openai/gpt-5.1","messages":[{"role":"user","content":"reply ok"}],"temperature":0.7,"max_tokens":50}'

{"id":"chatcmpl-...","model":"openai/gpt-5.1","object":"chat.completion","choices":[...],...}
200

---

$ curl -sw "\n%{http_code}\n" -X POST $LITELLM_URL/v1/chat/completions \
    -H "Authorization: Bearer $VKEY" -H "Content-Type: application/json" \
    -d '{"model":"openai/gpt-5.1-mini","messages":[{"role":"user","content":"reply ok"}],"temperature":0.7,"max_tokens":50}'

{"error":{"message":"litellm.UnsupportedParamsError: gpt-5 models (including gpt-5-codex) don't support temperature=0.7. Only temperature=1 is supported. For gpt-5.1, temperature is supported when reasoning_effort='none' (or not specified, as it defaults to 'none')...","type":"None","param":null,"code":"400"}}
400

---

"gpt-5.1-mini": {
  "supports_none_reasoning_effort": true,
  "supports_minimal_reasoning_effort": true,
  // ... other gpt-5.1-shaped flags
},
"gpt-5.1-nano": {
  "supports_none_reasoning_effort": true,
  "supports_minimal_reasoning_effort": true,
  // ...
}
RAW_BUFFERClick to expand / collapse

What happened?

Per OpenAI's parameter compatibility guide, the gpt-5.1 family (including gpt-5.1-mini and gpt-5.1-nano) supports temperature when reasoning_effort is set to 'none' or omitted (the API default). LiteLLM's own pre-flight check correctly applies this for plain gpt-5.1 (verified working below) — but gpt-5.1-mini and gpt-5.1-nano 400 with the same UnsupportedParamsError even when reasoning_effort is omitted.

Root cause appears to be a registry gap in model_prices_and_context_window.json:

  • gpt-5.1: supports_none_reasoning_effort: true ✓ (works correctly)
  • gpt-5.1-mini: not in registry → falls back to "not supported" default
  • gpt-5.1-nano: not in registry → same

Because OpenAIGPT5Config.map_openai_params gates the temperature pass-through on self._supports_reasoning_effort_level(model, "none"), missing-from-registry → False → strict rejection. Plain gpt-5.1 is in the registry with supports_none_reasoning_effort=true, which is why it works.

Reproduction

LiteLLM v1.83.10-stable, called through standard /v1/chat/completions (no Responses-API routing, no Azure):

Case A — openai/gpt-5.1 (control, in registry):

$ curl -sw "\n%{http_code}\n" -X POST $LITELLM_URL/v1/chat/completions \
    -H "Authorization: Bearer $VKEY" -H "Content-Type: application/json" \
    -d '{"model":"openai/gpt-5.1","messages":[{"role":"user","content":"reply ok"}],"temperature":0.7,"max_tokens":50}'

{"id":"chatcmpl-...","model":"openai/gpt-5.1","object":"chat.completion","choices":[...],...}
200

Case B — openai/gpt-5.1-mini (not in registry):

$ curl -sw "\n%{http_code}\n" -X POST $LITELLM_URL/v1/chat/completions \
    -H "Authorization: Bearer $VKEY" -H "Content-Type: application/json" \
    -d '{"model":"openai/gpt-5.1-mini","messages":[{"role":"user","content":"reply ok"}],"temperature":0.7,"max_tokens":50}'

{"error":{"message":"litellm.UnsupportedParamsError: gpt-5 models (including gpt-5-codex) don't support temperature=0.7. Only temperature=1 is supported. For gpt-5.1, temperature is supported when reasoning_effort='none' (or not specified, as it defaults to 'none')...","type":"None","param":null,"code":"400"}}
400

Case C — openai/gpt-5.1-nano (not in registry): identical 400 to Case B.

Expected behavior

Cases B and C should return 200 (matching Case A). Per OpenAI's documented contract, the entire gpt-5.1.* family supports temperature when reasoning_effort resolves to 'none'. The _mini / _nano variants are scaled-down models — same API contract, smaller / faster.

Suggested fix

Add the missing entries to model_prices_and_context_window.json. Pattern matches the existing gpt-5.1 row:

"gpt-5.1-mini": {
  "supports_none_reasoning_effort": true,
  "supports_minimal_reasoning_effort": true,
  // ... other gpt-5.1-shaped flags
},
"gpt-5.1-nano": {
  "supports_none_reasoning_effort": true,
  "supports_minimal_reasoning_effort": true,
  // ...
}

Pricing entries for these aliases are already proposed in the open PR #22621 (which doesn't touch the reasoning-effort flags). If a maintainer prefers, this could fold into that PR, or ship as a separate JSON-only patch.

Sibling note: gpt-5.1-codex IS in the registry but with supports_none_reasoning_effort: false. Worth a separate look — if Codex variants follow the same OpenAI contract as the rest of the 5.1 family, that should also be true. Filing this issue for _mini/_nano only because their absence from the registry is the unambiguous gap.

Workaround in the meantime

Users routing through LiteLLM can either (a) set litellm.drop_params=True and accept silent stripping of temperature for gpt-5.1-mini/-nano (which costs the value-conditional behavior the registry would otherwise give them), or (b) sanitise client-side. We chose (b) and code to OpenAI's actual contract — when this registry gap is fixed, our client-side rule will already be doing the right thing (preserve temperature when reasoning_effort is null, strip it when set).

LiteLLM Version

1.83.10-stable (also expected to repro on 1.83.14-stable.patch.2 — fix landing in the JSON registry would propagate to all versions on next auto-fetch).

Twitter / LinkedIn details

No response

Are you a ML Ops Team?

No response

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…

FAQ

Expected behavior

Cases B and C should return 200 (matching Case A). Per OpenAI's documented contract, the entire gpt-5.1.* family supports temperature when reasoning_effort resolves to 'none'. The _mini / _nano variants are scaled-down models — same API contract, smaller / faster.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING