Add Ollama #13285

Closed
opened 2026-02-21 19:11:26 -05:00 by yindo · 1 comment
Owner

Originally created by @mbpz on GitHub (Apr 24, 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

Add Ollama

console/api/workspaces/current/model-providers/langgenius/ollama/ollama/models
请求方法:
POST
状态代码:
400 Bad Request

An error occurred during credentials validation: API request failed with status code 404: {"error":"model \"ollama\" not found, try pulling it first"}

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @mbpz on GitHub (Apr 24, 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 Add Ollama console/api/workspaces/current/model-providers/langgenius/ollama/ollama/models 请求方法: POST 状态代码: 400 Bad Request An error occurred during credentials validation: API request failed with status code 404: {\"error\":\"model \\\"ollama\\\" not found, try pulling it first\"} ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🤔 cant-reproduce label 2026-02-21 19:11:26 -05:00
yindo closed this issue 2026-02-21 19:11:26 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 24, 2025):

I found similar threads discussing issues with adding Ollama models in Dify:

  1. Error when adding ollama model - This discussion is open and suggests upgrading Ollama to the latest version and using the new endpoint api/embed instead of the deprecated api/embedings. It also recommends ensuring the Ollama service is correctly exposed to the network [1].

  2. ollama embeddings add models error - This is another open discussion with similar issues [2].

  3. Can't add the Ollama Models - This discussion is open and addresses similar problems [3].

To resolve the error "model 'ollama' not found, try pulling it first," ensure you are using a valid model name from Ollama's repository. Verify the model name and pull it using the Ollama client with the command:

ollama pull <valid_model_name>

Replace <valid_model_name> with the correct model name. Additionally, ensure your Base URL is set correctly. If using Docker, use http://host.docker.internal:11434 instead of localhost. Set the OLLAMA_HOST environment variable to 0.0.0.0 to expose the service to the network [4].

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 (Apr 24, 2025): <!-- Answer --> I found similar threads discussing issues with adding Ollama models in Dify: 1. **[Error when adding ollama model](https://github.com/langgenius/dify/discussions/14104)** - This discussion is open and suggests upgrading Ollama to the latest version and using the new endpoint `api/embed` instead of the deprecated `api/embedings`. It also recommends ensuring the Ollama service is correctly exposed to the network <sup>[[1]](https://github.com/langgenius/dify/discussions/14104)</sup>. 2. **[ollama embeddings add models error](https://github.com/langgenius/dify/discussions/8972)** - This is another open discussion with similar issues <sup>[[2]](https://github.com/langgenius/dify/discussions/8972)</sup>. 3. **[Can't add the Ollama Models](https://github.com/langgenius/dify/discussions/12336)** - This discussion is open and addresses similar problems <sup>[[3]](https://github.com/langgenius/dify/discussions/12336)</sup>. To resolve the error "model 'ollama' not found, try pulling it first," ensure you are using a valid model name from Ollama's repository. Verify the model name and pull it using the Ollama client with the command: ```bash ollama pull <valid_model_name> ``` Replace `<valid_model_name>` with the correct model name. Additionally, ensure your Base URL is set correctly. If using Docker, use `http://host.docker.internal:11434` instead of `localhost`. Set the `OLLAMA_HOST` environment variable to `0.0.0.0` to expose the service to the network <sup>[[4]](https://github.com/langgenius/dify/issues/15154)</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/818aab37-278b-4cd3-bf71-940d0a4ed872?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/818aab37-278b-4cd3-bf71-940d0a4ed872?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/818aab37-278b-4cd3-bf71-940d0a4ed872?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/818aab37-278b-4cd3-bf71-940d0a4ed872?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/818aab37-278b-4cd3-bf71-940d0a4ed872?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/818aab37-278b-4cd3-bf71-940d0a4ed872?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/818aab37-278b-4cd3-bf71-940d0a4ed872?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#13285