[bug ] xinference 的配置方案已经失效 ,无法被加载 #4

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

Originally created by @NicoTime on GitHub (May 14, 2024).

接入 xinference 失败。 看起来是 url 发生了变化,导致无发匹配。

image

可以看到, xinference 实际部署的时候的 url 是
image

也就是 http://localhost:9997/${modelId}
image

但是 dify 中使用的还是
http://localhost:9997/v1/models/${model_uid} 已经和最新不符合。

改进建议
考虑到两个项目不同的进展,可以考虑开放接入的 http 地址,由配置方自己设置地址。

Originally created by @NicoTime on GitHub (May 14, 2024). 接入 xinference 失败。 看起来是 url 发生了变化,导致无发匹配。 ![image](https://github.com/langgenius/dify-docs/assets/12646341/86032e59-4c14-498d-82d0-0cc98d4112a6) 可以看到, xinference 实际部署的时候的 url 是 ![image](https://github.com/langgenius/dify-docs/assets/12646341/fed093db-e9d9-4dd2-94fe-bf4aad6c6c77) 也就是 http://localhost:9997/${modelId} ![image](https://github.com/langgenius/dify-docs/assets/12646341/a7c6486c-a8d5-4ad6-a4ff-0a69b5f6700f) 但是 dify 中使用的还是 http://localhost:9997/v1/models/${model_uid} 已经和最新不符合。 改进建议 考虑到两个项目不同的进展,可以考虑开放接入的 http 地址,由配置方自己设置地址。
yindo added the bug label 2026-02-16 11:19:29 -05:00
yindo closed this issue 2026-02-16 11:19:29 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 14, 2024):

To address the issue with the outdated URL format for xinference integration in the dify project, making the HTTP address configurable is a practical solution. Here's a concise plan to implement this:

  1. Add Configuration Option: Introduce a new setting in the Dify interface under Settings > Model Providers > Xinference for users to input the xinference server URL. This allows for flexibility in addressing changes in the deployment environment.

  2. Backend Update: Adjust the backend to dynamically use the user-provided address for API calls to xinference, ensuring it reads from a configuration file or database.

  3. Input Validation: Implement validation for the server URL input to ensure it meets the required format, enhancing integration reliability.

  4. Documentation and Guidance: Update the documentation to guide users on configuring the server URL based on their deployment scenario, whether it's local or distributed. Include instructions for determining the machine IP address if xinference is deployed on a different machine.

  5. Fallback Mechanism: Set a default server URL, like http://127.0.0.1:9997, to ensure the system remains operational even without immediate user configuration.

By following these steps, you can make the xinference integration more adaptable to various deployment scenarios, ensuring a smoother integration process.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot[bot] commented on GitHub (May 14, 2024): <!-- Answer --> To address the issue with the outdated URL format for xinference integration in the dify project, making the HTTP address configurable is a practical solution. Here's a concise plan to implement this: 1. **Add Configuration Option**: Introduce a new setting in the Dify interface under `Settings > Model Providers > Xinference` for users to input the xinference server URL. This allows for flexibility in addressing changes in the deployment environment. 2. **Backend Update**: Adjust the backend to dynamically use the user-provided address for API calls to xinference, ensuring it reads from a configuration file or database. 3. **Input Validation**: Implement validation for the server URL input to ensure it meets the required format, enhancing integration reliability. 4. **Documentation and Guidance**: Update the documentation to guide users on configuring the server URL based on their deployment scenario, whether it's local or distributed. Include instructions for determining the machine IP address if xinference is deployed on a different machine. 5. **Fallback Mechanism**: Set a default server URL, like `http://127.0.0.1:9997`, to ensure the system remains operational even without immediate user configuration. By following these steps, you can make the xinference integration more adaptable to various deployment scenarios, ensuring a smoother integration process. <!-- Dosu Comment Footer --> <details> <summary> #### Details </summary> **Sources** - [en/tutorials/model-configuration/xinference.md](https://github.com/langgenius/dify-docs/blob/main/en/tutorials/model-configuration/xinference.md) - [zh_CN/guides/model-configuration/xinference.md](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/model-configuration/xinference.md) - [en/getting-started/install-self-hosted/environments.md](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/environments.md) - [en/features/extension/api_based_extension/README.md](https://github.com/langgenius/dify-docs/blob/main/en/features/extension/api_based_extension/README.md) <br/> **About Dosu** This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. </details> *To continue the conversation, mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-docs-archived#4