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: increase chunk_size to 8 KB for optimal latency

AlexsanderHamirf1895265e6b5
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py
index cb43ef0cecf..16988205530 100644
--- a/litellm/proxy/proxy_server.py
+++ b/litellm/proxy/proxy_server.py
@@ -5236,7 +5236,7 @@ async def moderations(
async def _audio_speech_chunk_generator(
_response: HttpxBinaryResponseContent,
) -> AsyncGenerator[bytes, None]:
- _generator = await _response.aiter_bytes(chunk_size=4096)
+ _generator = await _response.aiter_bytes(chunk_size=8192)
async for chunk in _generator:
yield chunk