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: add handling for user-disabled mid-stream fallbacks
rohan.w.charlese70b1bbfadaa
diff --git a/litellm/router.py b/litellm/router.pyindex 638df49ac05..9e12fbe9433 100644--- a/litellm/router.py+++ b/litellm/router.py@@ -1380,6 +1380,11 @@ class Router:Catches errors for fallbacks using the router's fallback system"""+ if initial_kwargs.get("disable_fallbacks", False):+ verbose_router_logger.info("Mid stream fallback disabled by user, re-raising original error")+ if e.original_exception is not None:+ raise e.original_exception+ raise efrom litellm.exceptions import MidStreamFallbackErrorclass FallbackStreamWrapper(CustomStreamWrapper):