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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix: Httpx timeout test failures
Sameer Kankute7c874efeabd0
diff --git a/litellm/main.py b/litellm/main.pyindex ea41919e19e..08bb55046ce 100644--- a/litellm/main.py+++ b/litellm/main.py@@ -599,9 +599,8 @@ async def acompletion( # noqa: PLR0915ctx = contextvars.copy_context()func_with_context = partial(ctx.run, func)- # Wrap with timeout if specified- if timeout is not None:- timeout_value = float(timeout) if not isinstance(timeout, (int, float)) else timeout+ if timeout is not None and isinstance(timeout, (int, float)):+ timeout_value = float(timeout)init_response = await asyncio.wait_for(loop.run_in_executor(None, func_with_context),timeout=timeout_value@@ -616,8 +615,8 @@ async def acompletion( # noqa: PLR0915response = ModelResponse(**init_response)response = init_responseelif asyncio.iscoroutine(init_response):- if timeout is not None:- timeout_value = float(timeout) if not isinstance(timeout, (int, float)) else timeout+ if timeout is not None and isinstance(timeout, (int, float)):+ timeout_value = float(timeout)response = await asyncio.wait_for(init_response, timeout=timeout_value)else:response = await init_response