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(streaming_handler.py): return model response on finished chunk
Krrish Dholakia08b297230e7c
diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.pyindex 69cd29c7300..efd004c81ae 100644--- a/litellm/litellm_core_utils/streaming_handler.py+++ b/litellm/litellm_core_utils/streaming_handler.py@@ -799,7 +799,6 @@ class CustomStreamWrapper:"provider_specific_fields" in response_objand response_obj["provider_specific_fields"] is not None)- or (getattr(model_response, "usage", None) is not None)):return Trueelse:@@ -899,7 +898,7 @@ class CustomStreamWrapper:return model_response# Default - return StopIteration- raise StopIteration+ return model_response# flush any remaining holding chunkif len(self.holding_chunk) > 0:if model_response.choices[0].delta.content is None: