Ollama cannot output in streaming mode in agent mode (Whether in plain text mode or calling tools) #767

Closed
opened 2026-02-16 10:20:27 -05:00 by yindo · 3 comments
Owner

Originally created by @Cursx on GitHub (Oct 30, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

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

Originally created by @Cursx on GitHub (Oct 30, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### 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_
yindo added the bug label 2026-02-16 10:20:27 -05:00
yindo closed this issue 2026-02-16 10:20:27 -05:00
Author
Owner

@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  Join Discord Share on X

@dosubot[bot] commented on GitHub (Oct 30, 2025): <!-- Answer --> 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](https://github.com/langgenius/dify-official-plugins/issues/1610). 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](https://github.com/langgenius/dify-official-plugins/pull/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](https://github.com/langgenius/dify-official-plugins/issues/1703). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1980)
Author
Owner

@Cursx commented on GitHub (Oct 30, 2025):

这是一个已知限制:即使模型本身支持流式传输,Ollama 在 Dify 的代理模式下(无论是纯文本还是工具调用)也无法传输输出。多个报告证实了这个问题,其原因是代理节点处理工具调用的方式以及代理工作流中 Ollama 缺少“stream-tool-call”功能。目前,使用工具调用的插件在代理模式下不支持流式传输,我们计划在未来的 Dify 版本中通过“stream-tool-call”功能解决此问题( 详情请见此处)

用户提交了一个 pull request,建议通过修改 Ollama 插件llm.py并借鉴 tongyi 插件的方法来修复此问题,但尚未合并( 参见 PR #1973)。目前,流媒体功能在某些第三方提供商和其他应用程序类型(例如 Chatflow)中可以正常工作,但在 Ollama 的代理工作流程中则无法正常工作。

如果您需要在代理模式下进行流式输出,建议使用受支持的模型,例如 Tongyi(Qwen-max),并在代理策略 参考中选择函数调用模式。

回复时只需提及@dosu即可。

我做得怎么样?|无关|错误|冗长|幻觉|举报 🐛 |其他  加入 Discord 分享至 X

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

@Cursx commented on GitHub (Oct 30, 2025): > 这是一个已知限制:即使模型本身支持流式传输,Ollama 在 Dify 的代理模式下(无论是纯文本还是工具调用)也无法传输输出。多个报告证实了这个问题,其原因是代理节点处理工具调用的方式以及代理工作流中 Ollama 缺少“stream-tool-call”功能。目前,使用工具调用的插件在代理模式下不支持流式传输,我们计划在未来的 Dify 版本中通过“stream-tool-call”功能解决此问题( [详情请见此处)](https://github.com/langgenius/dify-official-plugins/issues/1610)。 > > 用户提交了一个 pull request,建议通过修改 Ollama 插件`llm.py`并借鉴 tongyi 插件的方法来修复此问题,但尚未合并( [参见 PR #1973)](https://github.com/langgenius/dify-official-plugins/pull/1973)。目前,流媒体功能在某些第三方提供商和其他应用程序类型(例如 Chatflow)中可以正常工作,但在 Ollama 的代理工作流程中则无法正常工作。 > > 如果您需要在代理模式下进行流式输出,建议使用受支持的模型,例如 Tongyi(Qwen-max),并在代理策略 [参考](https://github.com/langgenius/dify-official-plugins/issues/1703)中选择函数调用模式。 > > _回复时只需提及[@dosu](https://go.dosu.dev/dosubot)即可。_ > > 我做得怎么样?[好](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=great_response)|[无关](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=irrelevant_answer)|[错误](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=incorrect_sources)|[冗长](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=too_verbose)|[幻觉](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=hallucination)|[举报 🐛](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=bug_report) |[其他](https://app.dosu.dev/response-feedback/7cfc631b-b7ed-48a2-b0b0-ddb699cdd299?feedback_type=other)  [![加入 Discord](https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot) [![分享至 X](https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1980) 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
Author
Owner

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

  • You reported that in Dify v1.91 with plugin 0.07, Ollama model outputs do not stream in agent mode despite Ollama supporting streaming.
  • This affects both plain text and tool calls in self-hosted setups.
  • The limitation is due to how agent nodes handle tool calls and the absence of a "stream-tool-call" feature for Ollama.
  • A user-submitted PR (#1973) proposes a fix by modifying the Ollama plugin’s llm.py, but it remains unmerged.
  • Streaming in agent mode currently works with other providers like Tongyi (Qwen-max) using Function Calling mode.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here to keep the discussion open.
  • Otherwise, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Nov 16, 2025): Hi, @Cursx. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that in Dify v1.91 with plugin 0.07, Ollama model outputs do not stream in agent mode despite Ollama supporting streaming. - This affects both plain text and tool calls in self-hosted setups. - The limitation is due to how agent nodes handle tool calls and the absence of a "stream-tool-call" feature for Ollama. - A user-submitted PR (#1973) proposes a fix by modifying the Ollama plugin’s llm.py, but it remains unmerged. - Streaming in agent mode currently works with other providers like Tongyi (Qwen-max) using Function Calling mode. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here to keep the discussion open. - Otherwise, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#767