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
style: format streaming handler
mateo-berri1819c97c271c
diff --git a/litellm/proxy/pass_through_endpoints/streaming_handler.py b/litellm/proxy/pass_through_endpoints/streaming_handler.pyindex 8428c7dcbe2..c7ccd2d0d0f 100644--- a/litellm/proxy/pass_through_endpoints/streaming_handler.py+++ b/litellm/proxy/pass_through_endpoints/streaming_handler.py@@ -143,7 +143,9 @@ class PassThroughStreamingHandler:def _split_complete_sse_frames(pending: bytes) -> tuple[bytes, bytes]:lf_boundary_end: Final = pending.rfind(b"\n\n") + 2crlf_boundary_end: Final = pending.rfind(b"\r\n\r\n") + 4- boundary_end: Final = max(lf_boundary_end if lf_boundary_end >= 2 else 0, crlf_boundary_end if crlf_boundary_end >= 4 else 0)+ boundary_end: Final = max(+ lf_boundary_end if lf_boundary_end >= 2 else 0, crlf_boundary_end if crlf_boundary_end >= 4 else 0+ )if boundary_end == 0:return b"", pendingreturn pending[:boundary_end], pending[boundary_end:]