mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Ollama read timeout=300 #568
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 @naisy on GitHub (Aug 19, 2025).
Self Checks
Dify version
1.7.2
Plugin version
langgenius-ollama 0.0.7
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Steps to Reproduce
https://marketplace.dify.ai/plugins/langgenius/ollama
langgenius-ollama_0.0.7.difypkglanggenius-ollama_0.0.7/models/llm/llm.pyDescription
In the Ollama plugin (langgenius-ollama v0.0.7), the default timeout is hardcoded as
timeout=(10, 300).This causes requests to fail if the model takes longer than 300 seconds to respond.
Problem
requests.post(..., timeout=(10, 300))), and Dify cannot get a response from Ollama.Cause
The timeout is hardcoded in the plugin’s source code (models/llm/llm.py), making it impossible for users to override.
✔️ Error log
@dosubot[bot] commented on GitHub (Aug 19, 2025):
The Ollama plugin's 300-second read timeout is hardcoded in the source code and is not user-configurable as of v0.0.7. This means that for long-running requests (like large models or outputs), you'll hit a timeout unless you manually change the code. To work around this, you need to edit the timeout value in the plugin's Python file (for example, change
timeout=(10, 300)totimeout=(10, 3600)) and then rebuild your Docker containers for the change to take effect. You may also want to update related environment variables in your Docker.envfile, but these do not override the hardcoded plugin timeout unless you also change the code itself [source].Other plugins (like gpustack and huggingface_tei) have recently added configurable timeout parameters via plugin settings or YAML config, but the Ollama plugin has not yet adopted this approach [source]. If you want a more flexible solution, you could suggest or implement a similar change for the Ollama plugin.
Let me know if you want step-by-step instructions for updating the code and rebuilding your Docker setup.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@naisy commented on GitHub (Aug 19, 2025):
Thanks for the clarification earlier!
I tried making a small modification to the plugin to address this issue.
What I changed
llm.pyto addconnect_timeoutandread_timeoutas configurable fields in the plugin UI.read_timeoutto-1(no limit) by default.Why
My workflow runs 10 parallel iteration nodes, each containing 4 chained LLMs.
That means 40 nodes in total. Changing the timeout setting for each node manually is not practical.
By setting the default
read_timeout=-1, I can avoid unnecessary configuration overhead.Diff
Suggestion
It would be great if this kind of improvement could be incorporated into the official Ollama plugin.
At the very least, making the timeout configurable via the plugin UI would make it much more user-friendly for complex workflows.
@dosubot[bot] commented on GitHub (Sep 5, 2025):
Hi, @naisy. 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!