From 3d648b7fe1adb0c36bf2615e9a06fe153e8f9122 Mon Sep 17 00:00:00 2001 From: Joshua Garnett Date: Sun, 9 Aug 2026 13:58:23 -0400 Subject: [PATCH] fix(responses): pass api_base to the responses bridge check The bridge probe called responses_api_bridge_check without api_base, so it resolved the OpenAI base from globals and environment rather than from the request, while litellm.completion runs the same check with the caller's value. Today the two cannot disagree: this path always supplies a reasoning_effort, which short-circuits the endpoint term in the only arm that reads it. Passing it anyway keeps the probe a faithful mirror of the definitive check rather than one that happens to agree. --- .../litellm_completion_transformation/transformation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/responses/litellm_completion_transformation/transformation.py b/litellm/responses/litellm_completion_transformation/transformation.py index bd4108a0d27..8d790024cfe 100644 --- a/litellm/responses/litellm_completion_transformation/transformation.py +++ b/litellm/responses/litellm_completion_transformation/transformation.py @@ -316,6 +316,7 @@ class LiteLLMCompletionResponsesConfig: tools: Sequence[ChatCompletionToolParam | OpenAIMcpServerTool] | None, web_search_options: OpenAIWebSearchOptions | None, reasoning_param: Reasoning, + api_base: str | None, ) -> bool: """ Whether ``litellm.completion`` will route this model back onto the Responses API. @@ -333,6 +334,7 @@ class LiteLLMCompletionResponsesConfig: tools=tools, reasoning_effort=reasoning_param, reasoning_summary=reasoning_param.get("summary"), + api_base=api_base, ) except Exception as e: # noqa: BLE001 # a capability probe must never fail the request it probes for verbose_logger.debug(f"responses bridge: reasoning effort mode check failed: {e}") @@ -346,6 +348,7 @@ class LiteLLMCompletionResponsesConfig: custom_llm_provider: str | None, tools: Sequence[ChatCompletionToolParam | OpenAIMcpServerTool] | None = None, web_search_options: OpenAIWebSearchOptions | None = None, + api_base: str | None = None, ) -> Reasoning | str | None: """ Map the Responses ``reasoning`` param onto Chat Completions ``reasoning_effort``. @@ -366,6 +369,7 @@ class LiteLLMCompletionResponsesConfig: tools=tools, web_search_options=web_search_options, reasoning_param=reasoning_param, + api_base=api_base, ): return reasoning_param return reasoning_param.get("effort") @@ -407,6 +411,7 @@ class LiteLLMCompletionResponsesConfig: custom_llm_provider=custom_llm_provider, tools=tools, web_search_options=web_search_options, + api_base=kwargs.get("api_base"), ) )