mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Ollama cannot output in streaming mode in agent mode (Whether in plain text mode or calling tools) #767
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Cursx on GitHub (Oct 30, 2025).
Self Checks
Dify version
1.91
Plugin version
0.07
Cloud or Self Hosted
Self Hosted (Source), Self Hosted (Docker)
Steps to reproduce
In the agent module, select ollama for the model. Whether it's a pure text conversation or calling a tool, the output is not streaming. Even if the model has the ability to stream call functions, it cannot stream output in the agent module
This bug has also been mentioned in multiple issues under Dify(#27028)
I tried to solve this problem by modifying llm.py in the ollama plugin in dify-official-plugins (#1973)
✔️ Error log
No response
@dosubot[bot] commented on GitHub (Oct 30, 2025):
This is a known limitation: Ollama does not stream output in agent mode (for both plain text and tool calls) in Dify, even though the model itself supports streaming. The issue is confirmed in multiple reports and is due to how agent nodes handle tool calls and the absence of the 'stream-tool-call' feature for Ollama in agent workflows. Streaming in agent mode is currently not supported for plugins using tool calls, and this is planned to be addressed in a future Dify release via the 'stream-tool-call' feature see details.
There is a user-submitted pull request that proposes a fix by modifying the Ollama plugin's
llm.py, borrowing methods from the tongyi plugin, but it has not been merged yet see PR #1973. For now, streaming works with some third-party providers and in other application types like Chatflow, but not with Ollama in agent workflows.If you need streaming output in agent mode, it's recommended to use supported models like Tongyi (Qwen-max) and select Function Calling mode in Agent strategies reference.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@Cursx commented on GitHub (Oct 30, 2025):
The current situation is that using the same private deployment model as Tongyi is not possible, and it cannot stream output in the agent module. (Even if it supports stream-function-calling).
I provided some reference code modifications in # 1973 to address these issues
@dosubot[bot] commented on GitHub (Nov 16, 2025):
Hi, @Cursx. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thank you for your understanding and contribution!