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:exception_mapping_utils.py) fix sglang rate limit error issue (#11575)

dhs-shine01dd5182016c
diff --git a/litellm/litellm_core_utils/exception_mapping_utils.py b/litellm/litellm_core_utils/exception_mapping_utils.py
index e898ebbcb06..f38883bb179 100644
--- a/litellm/litellm_core_utils/exception_mapping_utils.py
+++ b/litellm/litellm_core_utils/exception_mapping_utils.py
@@ -309,6 +309,7 @@ def exception_type( # type: ignore # noqa: PLR0915
or "string too long. Expected a string with maximum length"
in error_str
or "model's maximum context limit" in error_str
+ or "is longer than the model's context length" in error_str
):
exception_mapping_worked = True
raise ContextWindowExceededError(