Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

add http client propagation for allm_passthrough_route

KnyazShdfa07b7c277f
diff --git a/litellm/llms/gigachat/passthrough/transformation.py b/litellm/llms/gigachat/passthrough/transformation.py
index ff2c4ad4986..474622a01a8 100644
--- a/litellm/llms/gigachat/passthrough/transformation.py
+++ b/litellm/llms/gigachat/passthrough/transformation.py
@@ -11,7 +11,6 @@ from litellm.secret_managers.main import get_secret_str
from litellm.types.llms.openai import AllMessageValues
from litellm.types.utils import EmbeddingResponse
-
if TYPE_CHECKING:
from httpx import URL, Response
diff --git a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py
index 7a0403194ab..04de332b295 100644
--- a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py
+++ b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py
@@ -2521,7 +2521,7 @@ async def gigachat_proxy_route(
"ssl_verify": False,
},
)
- data["http_client"] = client
+ data["client"] = client
base_llm_response_processor = ProxyBaseLLMRequestProcessing(data=data)
@@ -2652,7 +2652,7 @@ async def handle_gigachat_passthrough_router_model(
},
)
- data["http_client"] = client
+ data["client"] = client
base_llm_response_processor = ProxyBaseLLMRequestProcessing(data=data)
# Use the common passthrough processing to handle metadata and hooks
diff --git a/litellm/router.py b/litellm/router.py
index a92590d3dba..c9637d5e9f2 100644
--- a/litellm/router.py
+++ b/litellm/router.py
@@ -6014,6 +6014,8 @@ class Router:
**kwargs,
)
elif call_type == "allm_passthrough_route":
+ if client:
+ kwargs["client"] = client
return await self._ageneric_api_call_with_fallbacks(
original_function=original_function,
passthrough_on_no_deployment=True,