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
STREAM_SSE_DONE_STRING
Ishaan Jaff58acf23c3ee2
diff --git a/litellm/constants.py b/litellm/constants.pyindex 0288c45e40b..b4551a78f5f 100644--- a/litellm/constants.py+++ b/litellm/constants.py@@ -18,6 +18,7 @@ SINGLE_DEPLOYMENT_TRAFFIC_FAILURE_THRESHOLD = 1000 # Minimum number of requestsREPEATED_STREAMING_CHUNK_LIMIT = 100 # catch if model starts looping the same chunk while streaming. Uses high default to prevent false positives.#### Networking settings ####request_timeout: float = 6000 # time in seconds+STREAM_SSE_DONE_STRING: str = "[DONE]"LITELLM_CHAT_PROVIDERS = ["openai",diff --git a/litellm/responses/streaming_iterator.py b/litellm/responses/streaming_iterator.pyindex 13112e3647f..7325e4e6454 100644--- a/litellm/responses/streaming_iterator.py+++ b/litellm/responses/streaming_iterator.py@@ -5,17 +5,15 @@ from typing import Any, AsyncIterator, Dict, Optional, Unionimport httpx+from litellm.constants import STREAM_SSE_DONE_STRINGfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.llms.base_llm.responses.transformation import BaseResponsesAPIConfigfrom litellm.types.llms.openai import (- ResponsesAPIResponse,ResponsesAPIStreamEvents,ResponsesAPIStreamingResponse,)from litellm.utils import CustomStreamWrapper-COMPLETED_OPENAI_CHUNK_TYPE = "response.completed"-class BaseResponsesAPIStreamingIterator:"""@@ -50,7 +48,7 @@ class BaseResponsesAPIStreamingIterator:return None# Handle "[DONE]" marker- if chunk == "[DONE]":+ if chunk == STREAM_SSE_DONE_STRING:self.finished = Truereturn None