Add Ollama got errors on Mac while saving the setting. #1541

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

Originally created by @nikkofu on GitHub (Mar 25, 2024).

Self Checks

  • 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.

Provide a description of the help you need

When I save the setting, the errors occur on the top right:
"An error occurred during credentials validation: API request failed with status code 502:"

INFO:werkzeug:127.0.0.1 - - [25/Mar/2024 11:42:17] "POST /console/api/workspaces/current/model-providers/ollama/models HTTP/1.1" 400 -

The Payload is:

{"model":"llava","model_type":"llm","credentials":{"mode":"chat","context_size":"4096","max_tokens":"4096","vision_support":"true","base_url":"http://192.168.0.102:11434"}}

And I can work with curl like:

curl http://192.168.0.102:11434/api/generate -d '{
  "model": "llava",
  "prompt":"hi",
  "stream": false
}'

Response:

{"model":"llava","created_at":"2024-03-25T11:49:51.693319Z","response":" Hello! How can I help you today? ","done":true,"context":[733,16289,28793,12014,733,28748,16289,28793,22557,28808,1602,541,315,1316,368,3154,28804,28705],"total_duration":11228899151,"load_duration":8846545651,"prompt_eval_count":9,"prompt_eval_duration":764922000,"eval_count":11,"eval_duration":1616929000}

Also I can work fine with curl to localhost & 127.0.0.1, but still get the error message while saving the address like "http://localhost:11434", "http://127.0.0.1:11434"

Dify: Version 0.5.10, build from git source, 03/24
Ollama: ollama version is 0.1.29

Thank you for the help.

Originally created by @nikkofu on GitHub (Mar 25, 2024). ### Self Checks - [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. ### Provide a description of the help you need When I save the setting, the errors occur on the top right: "An error occurred during credentials validation: API request failed with status code 502:" INFO:werkzeug:127.0.0.1 - - [25/Mar/2024 11:42:17] "POST /console/api/workspaces/current/model-providers/ollama/models HTTP/1.1" 400 - The Payload is: ``` {"model":"llava","model_type":"llm","credentials":{"mode":"chat","context_size":"4096","max_tokens":"4096","vision_support":"true","base_url":"http://192.168.0.102:11434"}} ``` And I can work with curl like: ``` curl http://192.168.0.102:11434/api/generate -d '{ "model": "llava", "prompt":"hi", "stream": false }' ``` Response: ``` {"model":"llava","created_at":"2024-03-25T11:49:51.693319Z","response":" Hello! How can I help you today? ","done":true,"context":[733,16289,28793,12014,733,28748,16289,28793,22557,28808,1602,541,315,1316,368,3154,28804,28705],"total_duration":11228899151,"load_duration":8846545651,"prompt_eval_count":9,"prompt_eval_duration":764922000,"eval_count":11,"eval_duration":1616929000} ``` Also I can work fine with curl to localhost & 127.0.0.1, but still get the error message while saving the address like "http://localhost:11434", "http://127.0.0.1:11434" Dify: Version 0.5.10, build from git source, 03/24 Ollama: ollama version is 0.1.29 Thank you for the help.
yindo closed this issue 2026-02-21 17:34:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1541