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 AttributeError: NoneType object has no attribute 'get' (#14609)

Oleksandr Tereshchenkof507bf8881d2
diff --git a/litellm/proxy/hooks/parallel_request_limiter_v3.py b/litellm/proxy/hooks/parallel_request_limiter_v3.py
index a95f44eeca8..87f4236b5aa 100644
--- a/litellm/proxy/hooks/parallel_request_limiter_v3.py
+++ b/litellm/proxy/hooks/parallel_request_limiter_v3.py
@@ -832,7 +832,8 @@ class _PROXY_MaxParallelRequestsHandler_v3(CustomLogger):
litellm_parent_otel_span: Union[Span, None] = (
_get_parent_otel_span_from_kwargs(kwargs)
)
- user_api_key = kwargs["litellm_params"]["metadata"].get("user_api_key")
+ litellm_metadata = kwargs["litellm_params"]["metadata"]
+ user_api_key = litellm_metadata.get("user_api_key") if litellm_metadata else None
pipeline_operations: List[RedisPipelineIncrementOperation] = []
if user_api_key: