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]

fix(llm_request_utils): handle None proxy_server_request without AttributeError

mateo-berriefdeff89d81b
diff --git a/litellm/litellm_core_utils/llm_request_utils.py b/litellm/litellm_core_utils/llm_request_utils.py
index f5f28822ca1..c4533964d49 100644
--- a/litellm/litellm_core_utils/llm_request_utils.py
+++ b/litellm/litellm_core_utils/llm_request_utils.py
@@ -78,7 +78,7 @@ def get_proxy_server_request_headers(litellm_params: Optional[dict]) -> dict:
return {}
proxy_request_headers = (
- litellm_params.get("proxy_server_request", {}).get("headers", {}) or {}
+ (litellm_params.get("proxy_server_request") or {}).get("headers") or {}
)
return proxy_request_headers