From 44a68cf1c6bf9d6ea85c124a8e38b4b018a01fcd Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 19 Feb 2026 11:26:38 +0530 Subject: [PATCH] Fix: add stop param as supported for openai and azure --- litellm/constants.py | 1 - litellm/llms/azure/chat/gpt_transformation.py | 3 +- .../llms/openai/chat/gpt_transformation.py | 1 + tests/llm_translation/test_optional_params.py | 39 +++++++++++++++++++ 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/litellm/constants.py b/litellm/constants.py index 17ad742e41..abba8cc163 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -578,7 +578,6 @@ OPENAI_CHAT_COMPLETION_PARAMS = [ "thinking", "web_search_options", "service_tier", - "store", "prompt_cache_key", "prompt_cache_retention", "safety_identifier", diff --git a/litellm/llms/azure/chat/gpt_transformation.py b/litellm/llms/azure/chat/gpt_transformation.py index 18dad503a5..69eda95be1 100644 --- a/litellm/llms/azure/chat/gpt_transformation.py +++ b/litellm/llms/azure/chat/gpt_transformation.py @@ -106,6 +106,7 @@ class AzureOpenAIConfig(BaseConfig): "audio", "web_search_options", "prompt_cache_key", + "store", ] def _is_response_format_supported_model(self, model: str) -> bool: @@ -158,7 +159,6 @@ class AzureOpenAIConfig(BaseConfig): api_version: str = "", ) -> dict: supported_openai_params = self.get_supported_openai_params(model) - api_version_times = api_version.split("-") if len(api_version_times) >= 3: @@ -245,7 +245,6 @@ class AzureOpenAIConfig(BaseConfig): optional_params["tools"].extend(value) elif param in supported_openai_params: optional_params[param] = value - return optional_params def transform_request( diff --git a/litellm/llms/openai/chat/gpt_transformation.py b/litellm/llms/openai/chat/gpt_transformation.py index 59f52e2b81..aa8471a597 100644 --- a/litellm/llms/openai/chat/gpt_transformation.py +++ b/litellm/llms/openai/chat/gpt_transformation.py @@ -162,6 +162,7 @@ class OpenAIGPTConfig(BaseLLMModelInfo, BaseConfig): "service_tier", "safety_identifier", "prompt_cache_key", + "store", ] # works across all models model_specific_params = [] diff --git a/tests/llm_translation/test_optional_params.py b/tests/llm_translation/test_optional_params.py index 6ecac7b36a..a521e8e43f 100644 --- a/tests/llm_translation/test_optional_params.py +++ b/tests/llm_translation/test_optional_params.py @@ -2045,3 +2045,42 @@ def test_store_in_openai_chat_completion_params(): result = get_standard_openai_params({"store": True, "temperature": 0.7}) assert "store" in result assert result["store"] is True + + +def test_store_param_passed_through_openai_azure(): + """ + Test that the `store` parameter is correctly passed through to OpenAI + and Azure OpenAI providers when using get_optional_params(). + + This verifies the fix for the regression where `store` was being filtered + out by get_non_default_completion_params() due to architectural issues + in parameter processing pipeline. + + Ref: https://github.com/BerriAI/litellm/issues/19700 + """ + # Test OpenAI provider + optional_params_openai = get_optional_params( + model="gpt-4o", + custom_llm_provider="openai", + store=True, + ) + assert "store" in optional_params_openai + assert optional_params_openai["store"] is True + + # Test Azure OpenAI provider + optional_params_azure = get_optional_params( + model="gpt-4.1-2025-04-14", + custom_llm_provider="azure", + store=True, + ) + assert "store" in optional_params_azure + assert optional_params_azure["store"] is True + + # Test with store=False + optional_params_false = get_optional_params( + model="gpt-4o", + custom_llm_provider="openai", + store=False, + ) + assert "store" in optional_params_false + assert optional_params_false["store"] is False