litellm/tests/test_litellm/llms/openai
Tin Chi Lo e5c3df2da2 fix(gpt-5): resolve temperature support from the model's default reasoning effort
A gpt-5 model accepts a non-default temperature only while its effective reasoning
effort resolves to "none". litellm had no representation of the effort a model applies
when the request omits reasoning_effort, so it substituted supports_none_reasoning_effort,
which is a different fact. Every model that supports "none" without defaulting to it
therefore had temperature forwarded and rejected upstream, and because the carve-out
returned before the drop_params branch, drop_params: true could not save it.

Declare the fact instead. A new cost-map key, default_reasoning_effort, states the effort
the provider applies when the request omits one, and one shared predicate resolves the
effective effort from it: an explicit reasoning_effort wins, otherwise the declared
default, otherwise the catalogue decides.

That last step matters because the cost map is fetched from the published branch at import
time, so it can be OLDER than the code reading it. On such a map every model looks
undeclared, and reading that as "reasoning is active" would strip temperature from the 39
gpt-5.1/5.2/5.4 entries that accept it, a regression caused by data lag rather than by
anything about the model. So an absent declaration is only meaningful once the catalogue
carries the key at all; a map that predates the feature keeps the answer litellm gave
before it existed, and the conservative answer applies from the moment the data lands.

The top_p/logprobs/top_logprobs gate carried the same assumption spelled differently and
now shares the predicate, as does the Responses API, which reimplemented the rule and is
what the default /v1/messages bridge routes openai models through. Azure normalises its
routing names in one resolver that every capability lookup goes through, which replaces
its bespoke per-lookup rewrite.

Declared on the 37 gpt-5.1/5.2/5.4 entries measured to accept temperature=0 today, so
their behaviour is unchanged. The 23 gpt-5.5/5.6 entries that reject it stay undeclared
and are fixed once the catalogue carries the key.

Resolves LIT-3797
Resolves LIT-5028
2026-08-27 18:46:18 -07:00
..
chat fix(openai): drop tool_reference parts from tool messages at the chat boundary 2026-08-26 23:43:41 -07:00
completion test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
embeddings/guardrail_translation style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
evals test: cover volcengine responses and openai evals transformations 2026-07-27 12:57:21 -07:00
image_generation fix(otel): emit LLM Call spans for speech, image, moderation, ocr and transcription (#37752) 2026-08-22 11:11:21 -07:00
realtime test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
responses fix(gpt-5): resolve temperature support from the model's default reasoning effort 2026-08-27 18:46:18 -07:00
speech test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
transcriptions test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
vector_store_files fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
vector_stores fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
videos fix(videos): forward uploaded source file on /v1/videos/edits to the provider 2026-08-24 15:34:21 -07:00
test_cost_calculation.py fix(transcription): stop a zero output rate from zeroing transcription cost (#36914) 2026-08-14 15:12:37 -07:00
test_data_residency.py feat(openai): apply regional-processing cost uplift for EU/US data residency (#28626) 2026-05-25 20:36:14 -07:00
test_gpt5_transformation.py fix(gpt-5): resolve temperature support from the model's default reasoning effort 2026-08-27 18:46:18 -07:00
test_is_model_gpt_5_model.py feat(models): add GPT-5.6 (sol/terra/luna) pricing and metadata (#32659) 2026-07-09 11:51:12 -07:00
test_o_series_transformation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai_common_utils.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_openai_empty_response.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_openai_file_content_streaming.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai_image_edit_transformation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_use_chat_completions_api_no_leak.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00