Xinference credentials validate failed #4739

Closed
opened 2026-02-21 18:07:48 -05:00 by yindo · 10 comments
Owner

Originally created by @Modas-Li on GitHub (Jul 23, 2024).

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).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.11

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Xinference credentials validate failed: get xinference model extra parameter failed, url: http:/ /v1/models/qwen1.5-chat, error: HTTPConnection Pool(host= port= Max retries exceeded with url: /v1/models/qwen1.5-chat (Causedby ConnectTimeoutError(<urllib3.connection.HTTP Connection obietat at Ox7fc4f8376c80>, 'Connection to timed out. (connect timeout=10)'))

image
image

✔️ Expected Behavior

add xinference model qwen1.5-chat

Actual Behavior

come up with error in image

Originally created by @Modas-Li on GitHub (Jul 23, 2024). ### 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] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.11 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ``` Xinference credentials validate failed: get xinference model extra parameter failed, url: http:/ /v1/models/qwen1.5-chat, error: HTTPConnection Pool(host= port= Max retries exceeded with url: /v1/models/qwen1.5-chat (Causedby ConnectTimeoutError(<urllib3.connection.HTTP Connection obietat at Ox7fc4f8376c80>, 'Connection to timed out. (connect timeout=10)')) ``` ![image](https://github.com/user-attachments/assets/fc8518c4-6478-44c1-9dad-a4d7181e4595) ![image](https://github.com/user-attachments/assets/721ea8be-1d7c-4c34-83d0-6418e2b43560) ### ✔️ Expected Behavior add xinference model qwen1.5-chat ### ❌ Actual Behavior come up with error in image
yindo added the 🐞 bug🌚 invalid🤔 cant-reproduce labels 2026-02-21 18:07:48 -05:00
yindo closed this issue 2026-02-21 18:07:48 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 23, 2024):

To resolve the ConnectTimeoutError when trying to add the Xinference model qwen1.5-chat to your self-hosted Dify instance running on Docker, follow these steps:

  1. Ensure Xinference is Running and Accessible:

    • Start Xinference locally and ensure it is running on the correct endpoint:
      $ xinference-local
      
      By default, it will start on http://127.0.0.1:9997. If you need to allow access from any non-local client, start it with:
      $ xinference-local -H 0.0.0.0
      
  2. Network Configuration:

    • Since the Dify container cannot access localhost inside the container, you need to use the host IP address. Ensure that the network configuration allows the Dify container to access the Xinference endpoint.
  3. Update Dify Settings:

    • In Dify, go to Settings > Model Providers > Xinference and enter the following details:
      • Model name: qwen1.5-chat
      • Server URL: http://<Machine_IP>:9997 (Replace <Machine_IP> with your actual machine IP address)
      • Model UID: (Copy the model UID from the Running Models page in Xinference)
  4. Port Mapping:

    • Ensure that the Docker container running Dify has the necessary port mappings to access the Xinference service. For example, if you used the -p 9997:9997 parameter when running the Xinference container, you should be able to access it via http://<Machine_IP>:9997.

By following these steps, you should be able to resolve the ConnectTimeoutError and successfully add the Xinference model qwen1.5-chat to your Dify instance [1][2][3][4].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 23, 2024): <!-- Answer --> To resolve the `ConnectTimeoutError` when trying to add the Xinference model `qwen1.5-chat` to your self-hosted Dify instance running on Docker, follow these steps: 1. **Ensure Xinference is Running and Accessible:** - Start Xinference locally and ensure it is running on the correct endpoint: ```bash $ xinference-local ``` By default, it will start on `http://127.0.0.1:9997`. If you need to allow access from any non-local client, start it with: ```bash $ xinference-local -H 0.0.0.0 ``` 2. **Network Configuration:** - Since the Dify container cannot access `localhost` inside the container, you need to use the host IP address. Ensure that the network configuration allows the Dify container to access the Xinference endpoint. 3. **Update Dify Settings:** - In Dify, go to `Settings > Model Providers > Xinference` and enter the following details: - **Model name:** `qwen1.5-chat` - **Server URL:** `http://<Machine_IP>:9997` (Replace `<Machine_IP>` with your actual machine IP address) - **Model UID:** (Copy the model UID from the `Running Models` page in Xinference) 4. **Port Mapping:** - Ensure that the Docker container running Dify has the necessary port mappings to access the Xinference service. For example, if you used the `-p 9997:9997` parameter when running the Xinference container, you should be able to access it via `http://<Machine_IP>:9997`. By following these steps, you should be able to resolve the `ConnectTimeoutError` and successfully add the Xinference model `qwen1.5-chat` to your Dify instance <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/guides/model-configuration/xinference.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/model-configuration/xinference.md)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/model-configuration/xinference.md)</sup><sup>[[4]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/learn-more/use-cases/practical-implementation-of-building-llm-applications-using-a-full-set-of-open-source-tools.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jul 23, 2024):

Please use proper markdown syntax to format error code instead of putting this in the title.

@crazywoola commented on GitHub (Jul 23, 2024): Please use proper markdown syntax to format error code instead of putting this in the title.
Author
Owner

@crazywoola commented on GitHub (Jul 23, 2024):

Have you add other llms in xinference? If not, please follow the instructions here. https://docs.dify.ai/guides/model-configuration/xinference

@crazywoola commented on GitHub (Jul 23, 2024): Have you add other llms in xinference? If not, please follow the instructions here. https://docs.dify.ai/guides/model-configuration/xinference
Author
Owner

@Modas-Li commented on GitHub (Jul 23, 2024):

Have you add other llms in xinference? If not, please follow the instructions here. https://docs.dify.ai/guides/model-configuration/xinference

already add several llms in xinference, and use well in other repository, is there anything i forgot to set?

@Modas-Li commented on GitHub (Jul 23, 2024): > Have you add other llms in xinference? If not, please follow the instructions here. https://docs.dify.ai/guides/model-configuration/xinference already add several llms in xinference, and use well in other repository, is there anything i forgot to set?
Author
Owner

@crazywoola commented on GitHub (Jul 23, 2024):

Have you add other llms in xinference? If not, please follow the instructions here. https://docs.dify.ai/guides/model-configuration/xinference

already add several llms in xinference, and use well in other repository, is there anything i forgot to set?

I mean have you added other llms provided by xinference to dify successfully?

@crazywoola commented on GitHub (Jul 23, 2024): > > Have you add other llms in xinference? If not, please follow the instructions here. https://docs.dify.ai/guides/model-configuration/xinference > > already add several llms in xinference, and use well in other repository, is there anything i forgot to set? I mean have you added other llms provided by xinference to dify successfully?
Author
Owner

@Modas-Li commented on GitHub (Jul 23, 2024):

Have you add other llms in xinference? If not, please follow the instructions here. https://docs.dify.ai/guides/model-configuration/xinference

already add several llms in xinference, and use well in other repository, is there anything i forgot to set?

I mean have you added other llms provided by xinference to dify successfully?

No.
image
image
Thx for help

@Modas-Li commented on GitHub (Jul 23, 2024): > > > Have you add other llms in xinference? If not, please follow the instructions here. https://docs.dify.ai/guides/model-configuration/xinference > > > > > > already add several llms in xinference, and use well in other repository, is there anything i forgot to set? > > I mean have you added other llms provided by xinference to dify successfully? No. ![image](https://github.com/user-attachments/assets/ae5d6f56-40aa-4e38-b1c3-749abb2bd3b6) ![image](https://github.com/user-attachments/assets/ac587991-4a3c-44fc-9f08-d8480eadfdee) Thx for help
Author
Owner

@Modas-Li commented on GitHub (Jul 24, 2024):

need internal ip

@Modas-Li commented on GitHub (Jul 24, 2024): need internal ip
Author
Owner

@michaelChe956 commented on GitHub (Jul 30, 2024):

Dify version

main

Cloud or Self Hosted

Self Hosted (Docker)

i have the same problem.
i find that there is not set the authorization in the func (_get_xinference_extra_parameter)
图片

when do you plan to add this func.

@michaelChe956 commented on GitHub (Jul 30, 2024): ## Dify version main ## Cloud or Self Hosted Self Hosted (Docker) i have the same problem. i find that there is not set the authorization in the func (_get_xinference_extra_parameter) ![图片](https://github.com/user-attachments/assets/6183bf1f-8f87-46af-b383-f8a41a3ca725) when do you plan to add this func.
Author
Owner

@wangxyuc commented on GitHub (Jan 6, 2025):

I solved this problem by using http://host.docker.internal:9997
(my xinference in conda)

@wangxyuc commented on GitHub (Jan 6, 2025): I solved this problem by using http://host.docker.internal:9997 (my xinference in conda)
Author
Owner

@Liguoz commented on GitHub (Mar 15, 2025):

我的原因是在Dify配置用了openai_compatible的类型,其实dify有对应的Xinference的接口

Image

@Liguoz commented on GitHub (Mar 15, 2025): 我的原因是在Dify配置用了openai_compatible的类型,其实dify有对应的**Xinference的接口** ![Image](https://github.com/user-attachments/assets/110466fc-144c-45d2-90e2-f533fbae770b)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4739