mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
add: comment above optimization
For anybody that would change this value for whatever reason, the comment makes the tradeoff clear.
This commit is contained in:
parent
f1895265e6
commit
7241b4e9b5
1 changed files with 4 additions and 0 deletions
|
|
@ -5236,6 +5236,10 @@ async def moderations(
|
|||
async def _audio_speech_chunk_generator(
|
||||
_response: HttpxBinaryResponseContent,
|
||||
) -> AsyncGenerator[bytes, None]:
|
||||
# chunk_size has a big impact on latency, it can't be too small or too large
|
||||
# too small: latency is high
|
||||
# too large: latency is low, but memory usage is high
|
||||
# 8192 is a good compromise
|
||||
_generator = await _response.aiter_bytes(chunk_size=8192)
|
||||
async for chunk in _generator:
|
||||
yield chunk
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue