diff --git a/litellm/llms/azure/chat/gpt_5_transformation.py b/litellm/llms/azure/chat/gpt_5_transformation.py index e94f50380c0..33bab2eb0d6 100644 --- a/litellm/llms/azure/chat/gpt_5_transformation.py +++ b/litellm/llms/azure/chat/gpt_5_transformation.py @@ -84,8 +84,7 @@ class AzureOpenAIGPT5Config(AzureOpenAIConfig, OpenAIGPT5Config): ) and not self.is_model_gpt_5_2_model(model): params = [p for p in params if p not in ["logprobs", "top_logprobs"]] elif self.is_model_gpt_5_2_model(model): - azure_supported_params = ["logprobs", "top_logprobs"] - params.extend(azure_supported_params) + params.extend(p for p in ("logprobs", "top_logprobs") if p not in params) return params diff --git a/tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py b/tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py index 83562331b9a..b267f5b5cbb 100644 --- a/tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py +++ b/tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py @@ -299,3 +299,21 @@ def test_azure_gpt5_1_does_not_support_logprobs(config: AzureOpenAIGPT5Config): supported_params = config.get_supported_openai_params(model="gpt-5.1") assert "logprobs" not in supported_params assert "top_logprobs" not in supported_params + + +@pytest.mark.parametrize( + "model", + ["gpt-5.2", "azure/gpt-5.2", "gpt5_series/gpt-5.2", "azure/gpt-5.4"], +) +def test_azure_gpt5_2_logprobs_not_duplicated( + config: AzureOpenAIGPT5Config, model: str +): + """Regression: gpt-5.2/5.4 must list logprobs and top_logprobs exactly once. + + These models support reasoning_effort="none", so the base config already + includes the logprobs params; the Azure override must not append a second + copy. + """ + supported_params = config.get_supported_openai_params(model=model) + assert supported_params.count("logprobs") == 1 + assert supported_params.count("top_logprobs") == 1