From 6e970be220e00465775e086215ec49760e01cfad Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Thu, 18 Jun 2026 23:39:55 +0530 Subject: [PATCH] feat: enable streaming in LLM bundle construction - Updated the LLM bundle construction to include a streaming option for both DB-backed and global models. - Modified the `litellm_kwargs` to set the streaming parameter to True, enhancing the functionality for chat streaming flows. --- .../app/tasks/chat/streaming/flows/shared/llm_bundle.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/surfsense_backend/app/tasks/chat/streaming/flows/shared/llm_bundle.py b/surfsense_backend/app/tasks/chat/streaming/flows/shared/llm_bundle.py index 9304f1698..6f905e8f4 100644 --- a/surfsense_backend/app/tasks/chat/streaming/flows/shared/llm_bundle.py +++ b/surfsense_backend/app/tasks/chat/streaming/flows/shared/llm_bundle.py @@ -130,7 +130,9 @@ async def load_llm_bundle( billing_tier="free", ) return ( - SanitizedChatLiteLLM(model=model_string, **litellm_kwargs), + SanitizedChatLiteLLM( + model=model_string, **{**litellm_kwargs, "streaming": True} + ), agent_config, None, ) @@ -174,7 +176,9 @@ async def load_llm_bundle( billing_tier=str(global_model.get("billing_tier", "free")).lower(), ) return ( - SanitizedChatLiteLLM(model=model_string, **litellm_kwargs), + SanitizedChatLiteLLM( + model=model_string, **{**litellm_kwargs, "streaming": True} + ), agent_config, None, )