添加模型的接口报错 #8910

Closed
opened 2026-02-21 18:28:33 -05:00 by yindo · 1 comment
Owner

Originally created by @longge666666 on GitHub (Mar 3, 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.0.0

Cloud or Self Hosted

Self Hosted (Source), Cloud, Self Hosted (Docker)

Steps to reproduce

在模型供应商里添加我自己的ollama模型,报错,接口请求不通。

✔️ Expected Behavior

添加模型成功

Actual Behavior

添加模型失败

Originally created by @longge666666 on GitHub (Mar 3, 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)). - [ ] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.0 ### Cloud or Self Hosted Self Hosted (Source), Cloud, Self Hosted (Docker) ### Steps to reproduce 在模型供应商里添加我自己的ollama模型,报错,接口请求不通。 ### ✔️ Expected Behavior 添加模型成功 ### ❌ Actual Behavior 添加模型失败
yindo added the 🐞 bug label 2026-02-21 18:28:33 -05:00
yindo closed this issue 2026-02-21 18:28:33 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 3, 2025):

@longge666666 Hello there! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve the issue you're experiencing.

I found some similar threads that might help you resolve the issue with adding your own Ollama model:

  1. Open Issue: Error when adding ollama model - This discussion is still open and might have relevant insights.
  2. Closed Issue: Adding a local ollama model error - The solution was to upgrade Ollama to the latest version and use the new endpoint api/embed as the old one api/embedings has been deprecated [1].

To resolve the error when adding your own Ollama model, ensure you are using the full model name as provided by Ollama. Set the OLLAMA_HOST environment variable to 0.0.0.0 to enable access from other machines, and use the correct IP address for Docker. Make sure port 11434 is accessible in your firewall settings and restart the Ollama application after making these changes. Instead of using your local IP address, configure the base URL as http://host.docker.internal:11434 in the Ollama configuration. If the issue persists, consider downgrading the dify-api and dify-web services to version 0.15.3, as this addresses a known bug in Dify v1.0.0-beta [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 (Mar 3, 2025): <!-- Greeting --> @longge666666 Hello there! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve the issue you're experiencing. <!-- Answer --> I found some similar threads that might help you resolve the issue with adding your own Ollama model: 1. **Open Issue**: [Error when adding ollama model](https://github.com/langgenius/dify/discussions/14104) - This discussion is still open and might have relevant insights. 2. **Closed Issue**: [Adding a local ollama model error](https://github.com/langgenius/dify/discussions/7362#discussioncomment-11063987) - The solution was to upgrade Ollama to the latest version and use the new endpoint `api/embed` as the old one `api/embedings` has been deprecated <sup>[[1]](https://github.com/langgenius/dify/discussions/7362)</sup>. To resolve the error when adding your own Ollama model, ensure you are using the full model name as provided by Ollama. Set the `OLLAMA_HOST` environment variable to `0.0.0.0` to enable access from other machines, and use the correct IP address for Docker. Make sure port 11434 is accessible in your firewall settings and restart the Ollama application after making these changes. Instead of using your local IP address, configure the base URL as `http://host.docker.internal:11434` in the Ollama configuration. If the issue persists, consider downgrading the `dify-api` and `dify-web` services to version 0.15.3, as this addresses a known bug in Dify v1.0.0-beta <sup>[[2]](https://github.com/langgenius/dify/issues/13777)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/14330)</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/7c460d5e-2fe6-47b1-b79e-b4003a5fc043?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/7c460d5e-2fe6-47b1-b79e-b4003a5fc043?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/7c460d5e-2fe6-47b1-b79e-b4003a5fc043?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/7c460d5e-2fe6-47b1-b79e-b4003a5fc043?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7c460d5e-2fe6-47b1-b79e-b4003a5fc043?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/7c460d5e-2fe6-47b1-b79e-b4003a5fc043?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7c460d5e-2fe6-47b1-b79e-b4003a5fc043?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#8910