offline install plugs(ollama)
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
1.0.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
when i install the ollama plug, it encounters the following error. because my host is totally offline(without internet).
✔️ Expected Behavior
install success.
❌ Actual Behavior
init environment for plugin langgenius/ollama:0.0.3 failed too many times, you should consider the package is corrupted or your network is unstable
the containers of docker-plugin_daemon-1 log: `
[INFO]init environment for plugin langgenius/ollama:0.0.3
2025-03-13 21:40:00 2025/03/13 13:40:00 runtime_lifetime.go:76: [ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: Failed to fetch: https://pypi.org/simple/numpy/
2025-03-13 21:40:00 Caused by: Could not connect, are you offline?
2025-03-13 21:40:00 Caused by: Request failed after 3 retries
2025-03-13 21:40:00 Caused by: error sending request for url (https://pypi.org/simple/numpy/)
2025-03-13 21:40:00 Caused by: client error (Connect)
2025-03-13 21:40:00 Caused by: dns error: failed to lookup address information: Name or service not known
2025-03-13 21:40:00 Caused by: failed to lookup address information: Name or service not known`
my host is offline. so what should I do under this situation?
I found a similar open issue discussing offline installation of plugins in Dify [1]. To address the problem of installing the ollama plugin in an offline environment, you can follow these steps:
-
Simulate Installation with Network Access: On a machine with internet access, simulate the plugin installation to gather all necessary dependencies.
-
Package the Plugin: Ensure your plugin is packaged into a
.difypkgfile. This allows for manual upload and installation in offline environments. -
Create a Docker Image: Use a multi-stage Docker build process to create an image that includes the installed plugin and all its dependencies.
-
Transfer the Docker Image: Export and transfer this Docker image to your offline environment.
-
Load the Image: Load the image in the offline environment.
-
Configure Docker-Compose: Use this image in your docker-compose configuration to ensure all dependencies are available.
This approach should help you install the plugin without requiring internet access. Additionally, ensure that any necessary API keys or credentials are manually inputted for the plugin to function properly in the offline environment [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
when Ollama is local, I don't know what it means by "installing ollama plugin", though though it works nice in 1.0.0 without an "install".
OK,install takes time and work now . After dozen minutes it without any information , ollama is back like 1.0.0. But , all models are doubled. Not know why.