Can't connect Dify with OLLAMA on MacBook Pro #2359

Closed
opened 2026-02-21 17:44:49 -05:00 by yindo · 0 comments
Owner

Originally created by @onepisYa on GitHub (Apr 19, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a quesion, 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).
  • Pleas do not modify this template :) and fill in all the required fields.

Dify version

0.3.21

Cloud or Self Hosted

Cloud

Steps to reproduce

I read #2854 and #2624 、#2540
I am using https://cloud.dify.ai/apps

My computer is Mac.

  1. I confirmed that Ollama is successfully running;
  2. I disabled all firewall and now all incoming calls are allowed;
  3. I set OLLAMA_HOST to 0.0.0.0
  4. I am not using docker.
  5. I restarted Ollama and rerun Ollama run llama2. I use ollama serve run serve.
  6. I input llama2 in dify backend as model name and http://172.19.0.1:11434/ as base_url
    I still got the same error.
# ✅  I got a result.
curl http://localhost:11434/api/chat -d '{
  "model": "llama3",
  "messages": [
    { "role": "user", "content": "why is the sky blue?" }
  ]
}'

✔️ Expected Behavior

add Ollama is successfully.

Actual Behavior

I got a error.

{
    "code": "invalid_param",
    "message": "An error occurred during credentials validation: HTTPConnectionPool(host='127.0.0.1', port=11434): Max retries exceeded with url: /api/chat (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8d2fc1ca60>: Failed to establish a new connection: [Errno 111] Connection refused'))",
    "status": 400
}
Originally created by @onepisYa on GitHub (Apr 19, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a quesion, 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] Pleas do not modify this template :) and fill in all the required fields. ### Dify version 0.3.21 ### Cloud or Self Hosted Cloud ### Steps to reproduce I read #2854 and #2624 、#2540 I am using https://cloud.dify.ai/apps My computer is Mac. 1. I confirmed that Ollama is successfully running; 2. I disabled all firewall and now all incoming calls are allowed; 3. I set OLLAMA_HOST to 0.0.0.0 4. I am not using docker. 5. I restarted Ollama and rerun Ollama run llama2. I use `ollama serve` run serve. 6. I input llama2 in dify backend as model name and http://172.19.0.1:11434/ as base_url I still got the same error. ```zsh # ✅ I got a result. curl http://localhost:11434/api/chat -d '{ "model": "llama3", "messages": [ { "role": "user", "content": "why is the sky blue?" } ] }' ``` ### ✔️ Expected Behavior add Ollama is successfully. ### ❌ Actual Behavior I got a error. ```json { "code": "invalid_param", "message": "An error occurred during credentials validation: HTTPConnectionPool(host='127.0.0.1', port=11434): Max retries exceeded with url: /api/chat (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8d2fc1ca60>: Failed to establish a new connection: [Errno 111] Connection refused'))", "status": 400 } ```
yindo added the 🐞 bug label 2026-02-21 17:44:49 -05:00
yindo closed this issue 2026-02-21 17:44:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#2359