From f76ae0de9a3b28b78e4bbd77070d49b376e3207a Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 16:55:05 +0000 Subject: [PATCH] docs(proxy): say why the streaming loop yields on every chunk --- litellm/proxy/proxy_server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 8b80ffe852b..e1005b9a758 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -10288,6 +10288,8 @@ async def async_data_generator( ) async for item in stream_source: + # Unblock the event loop: a stream whose chunks are already buffered never awaits + # between chunks, so without this yield one long stream holds the loop for its whole body await asyncio.sleep(0) if item is _STREAM_KEEPALIVE: yield ": ping\n\n"