fix: increase chunk_size to 8 KB for optimal latency

This commit is contained in:
AlexsanderHamir 2025-11-17 12:55:58 -08:00
parent 697cb09060
commit f1895265e6

View file

@ -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