From 814e36353b9983773a693ef514a2f04d411532f0 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Sat, 7 Mar 2026 00:36:22 +0530 Subject: [PATCH] Fix output config error --- .../experimental_pass_through/adapters/handler.py | 5 ++++- .../adapters/transformation.py | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py b/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py index 73e74c228ba..cf047127bac 100644 --- a/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py +++ b/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py @@ -163,7 +163,10 @@ class LiteLLMMessagesToCompletionTransformationHandler: "include_usage": True, } - excluded_keys = {"anthropic_messages"} + excluded_keys = { + "anthropic_messages", + "output_config", # Anthropic-only; OpenAI does not support it + } extra_kwargs = extra_kwargs or {} for key, value in extra_kwargs.items(): if ( diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py b/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py index 8b21569546e..3fd4af0e6cc 100644 --- a/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py +++ b/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py @@ -296,8 +296,20 @@ class LiteLLMAnthropicMessagesAdapter: def translatable_anthropic_params(self) -> List: """ Which anthropic params, we need to translate to the openai format. + Params in this list are either translated or dropped when targeting OpenAI. + Anthropic-only params like output_config are included here to be dropped + (OpenAI does not support them). """ - return ["messages", "metadata", "system", "tool_choice", "tools", "thinking", "output_format"] + return [ + "messages", + "metadata", + "system", + "tool_choice", + "tools", + "thinking", + "output_format", + "output_config", # Anthropic-only; drop when targeting OpenAI + ] def _is_web_search_tool(self, tool: Dict[str, Any]) -> bool: """