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
latency fix proxy (#7563)
Ishaan Jaff2bf20ebfdf25
diff --git a/litellm/proxy/litellm_pre_call_utils.py b/litellm/proxy/litellm_pre_call_utils.pyindex 6cd7dca7434..ad7371e84dd 100644--- a/litellm/proxy/litellm_pre_call_utils.py+++ b/litellm/proxy/litellm_pre_call_utils.py@@ -1,3 +1,4 @@+import asyncioimport copyimport timefrom typing import TYPE_CHECKING, Any, Dict, Optional, Union@@ -616,13 +617,15 @@ async def add_litellm_data_to_request( # noqa: PLR0915)end_time = time.time()- await service_logger_obj.async_service_success_hook(- service=ServiceTypes.PROXY_PRE_CALL,- duration=end_time - start_time,- call_type="add_litellm_data_to_request",- start_time=start_time,- end_time=end_time,- parent_otel_span=user_api_key_dict.parent_otel_span,+ asyncio.create_task(+ service_logger_obj.async_service_success_hook(+ service=ServiceTypes.PROXY_PRE_CALL,+ duration=end_time - start_time,+ call_type="add_litellm_data_to_request",+ start_time=start_time,+ end_time=end_time,+ parent_otel_span=user_api_key_dict.parent_otel_span,+ ))return data