ollama model reload #275

Closed
opened 2026-02-16 10:18:46 -05:00 by yindo · 1 comment
Owner

Originally created by @maiweni on GitHub (May 11, 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 search for existing issues, 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.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1、create a chatflow in dify
2、Using dify's API to call chatflow
3、Check the size changes of the video memory and determine if the ollama model is repeatedly loaded

✔️ Expected Behavior

No response

Actual Behavior

When using dify with the large model deployed locally via ollama, why does the model loaded by ollama get reloaded every time I call the dify API?

Originally created by @maiweni on GitHub (May 11, 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 [search for existing issues](https://github.com/langgenius/dify/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.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1、create a chatflow in dify 2、Using dify's API to call chatflow 3、Check the size changes of the video memory and determine if the ollama model is repeatedly loaded ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior When using dify with the large model deployed locally via ollama, why does the model loaded by ollama get reloaded every time I call the dify API?
yindo closed this issue 2026-02-16 10:18:46 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 11, 2025):

Hello @mafan12! I'm Dosu, your friendly bot here to help you solve bugs, answer questions, and navigate contributions. I'm ready to assist you while we wait for a human maintainer. Let's get started!

I found a similar unsolved discussion titled "How to set the ollama model to not reload every time it is called" which might be relevant to your issue [1]. Unfortunately, there isn't a documented solution available for this specific problem in the repository.

Regarding your issue with the Ollama model reloading every time you call the Dify API, there isn't specific information available in the documentation about configuration settings that control model reloading or caching to prevent this behavior. It might be beneficial to explore the configuration settings related to model management or check if there are any environment variables that could influence this behavior. If you haven't already, you might want to check the Docker configurations and environment variables to see if there are any settings that could help manage model loading more efficiently [2][3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 11, 2025): <!-- Greeting --> Hello @mafan12! I'm [Dosu](https://dosu.dev), your friendly bot here to help you solve bugs, answer questions, and navigate contributions. I'm ready to assist you while we wait for a human maintainer. Let's get started! <!-- Answer --> I found a similar unsolved discussion titled "[How to set the ollama model to not reload every time it is called](https://github.com/langgenius/dify/discussions/16345)" which might be relevant to your issue <sup>[[1]](https://github.com/langgenius/dify/discussions/16345)</sup>. Unfortunately, there isn't a documented solution available for this specific problem in the repository. Regarding your issue with the Ollama model reloading every time you call the Dify API, there isn't specific information available in the documentation about configuration settings that control model reloading or caching to prevent this behavior. It might be beneficial to explore the configuration settings related to model management or check if there are any environment variables that could influence this behavior. If you haven't already, you might want to check the Docker configurations and environment variables to see if there are any settings that could help manage model loading more efficiently <sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/docker/.env.example)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/4ad4f91b-c2c9-4a50-8774-9ce35c827e16?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/4ad4f91b-c2c9-4a50-8774-9ce35c827e16?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/4ad4f91b-c2c9-4a50-8774-9ce35c827e16?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/4ad4f91b-c2c9-4a50-8774-9ce35c827e16?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4ad4f91b-c2c9-4a50-8774-9ce35c827e16?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/4ad4f91b-c2c9-4a50-8774-9ce35c827e16?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4ad4f91b-c2c9-4a50-8774-9ce35c827e16?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#275