Xinference add embedding error #1001

Closed
opened 2026-02-21 17:29:26 -05:00 by yindo · 5 comments
Owner

Originally created by @yoke233 on GitHub (Jan 30, 2024).

Self Checks

Dify version

0.5.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @yoke233 on GitHub (Jan 30, 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 file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### Dify version 0.5.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce <img width="874" alt="image" src="https://github.com/langgenius/dify/assets/2161917/cc4797eb-3555-4b2d-b802-ac768724d004"> ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 17:29:26 -05:00
yindo closed this issue 2026-02-21 17:29:26 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 30, 2024):

🤖

Hello @yoke233! I'm Dosu, a bot here to assist you with solving bugs, answering your questions, and guiding you on how to become a contributor to dify. I'm here to support you while we wait for a human maintainer to take a look at your issue. I noticed you're experiencing a problem with adding embeddings in dify, and I'm currently reviewing the details you've provided. I'll get back to you shortly with more information or questions to help resolve this issue.

@dosubot[bot] commented on GitHub (Jan 30, 2024): _🤖_ <!-- Greeting --> Hello @yoke233! I'm [Dosu](https://dosu.dev), a bot here to assist you with solving bugs, answering your questions, and guiding you on how to become a contributor to dify. I'm here to support you while we wait for a human maintainer to take a look at your issue. I noticed you're experiencing a problem with adding embeddings in dify, and I'm currently reviewing the details you've provided. I'll get back to you shortly with more information or questions to help resolve this issue.
Author
Owner

@takatost commented on GitHub (Jan 30, 2024):

https://docs.dify.ai/tutorials/model-configuration/xinference
Did you start the xinference server following these steps? And check the URL field you filled in with the right xinference server API URL.

@takatost commented on GitHub (Jan 30, 2024): https://docs.dify.ai/tutorials/model-configuration/xinference Did you start the xinference server following these steps? And check the URL field you filled in with the right xinference server API URL.
Author
Owner

@Yeuoly commented on GitHub (Jan 30, 2024):

You can check if there is a / suffix in your server_url or just try the latest 5.3.0

@Yeuoly commented on GitHub (Jan 30, 2024): You can check if there is a / suffix in your server_url or just try the latest 5.3.0
Author
Owner

@dosubot[bot] commented on GitHub (Jan 30, 2024):

🤖

I'm sorry, but I'm unable to view the image you've attached. However, I can provide some general advice based on the information you've given.

The xinference server in the dify codebase serves as a client for interacting with different types of models. It provides methods to get different types of model handles, such as RESTfulGenerateModelHandle, RESTfulChatModelHandle, RESTfulEmbeddingModelHandle, and RESTfulRerankModelHandle, based on the model UID provided. These handles are used to interact with the respective models. You can find more details in the api/tests/integration_tests/model_runtime/__mock/xinference.py file.

When you attempt to add an embedding, the _invoke method of the LocalAITextEmbeddingModel class is called. This method takes in the model name, model credentials, texts to embed, and an optional unique user id. You can find more details in the api/core/model_runtime/model_providers/localai/text_embedding/text_embedding.py file.

If you're experiencing issues, it could be due to a variety of reasons. Some common issues that users have reported when using the xinference server in the dify codebase are InvokeConnectionError, InvokeServerUnavailableError, InvokeRateLimitError, InvokeAuthorizationError, InvokeBadRequestError, and CredentialsValidateFailedError. These errors are handled in the _invoke_error_mapping method and the validate_credentials method in the XinferenceRerankModel class. You can find more details in the api/core/model_runtime/model_providers/xinference/rerank/rerank.py file.

If you could provide more details about the error you're experiencing, such as any error messages, I might be able to provide more specific advice. Also, please make sure that you've started the xinference server following the steps in the dify documentation and that you've filled in the URL field with the correct xinference server API URL.

Sources


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.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot[bot] commented on GitHub (Jan 30, 2024): _🤖_ <!-- Answer --> I'm sorry, but I'm unable to view the image you've attached. However, I can provide some general advice based on the information you've given. The xinference server in the dify codebase serves as a client for interacting with different types of models. It provides methods to get different types of model handles, such as `RESTfulGenerateModelHandle`, `RESTfulChatModelHandle`, `RESTfulEmbeddingModelHandle`, and `RESTfulRerankModelHandle`, based on the model UID provided. These handles are used to interact with the respective models. You can find more details in the [api/tests/integration_tests/model_runtime/__mock/xinference.py](https://github.com/langgenius/dify/blob/main/api/tests/integration_tests/model_runtime/__mock/xinference.py) file. When you attempt to add an embedding, the `_invoke` method of the `LocalAITextEmbeddingModel` class is called. This method takes in the model name, model credentials, texts to embed, and an optional unique user id. You can find more details in the [api/core/model_runtime/model_providers/localai/text_embedding/text_embedding.py](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/localai/text_embedding/text_embedding.py) file. If you're experiencing issues, it could be due to a variety of reasons. Some common issues that users have reported when using the xinference server in the dify codebase are `InvokeConnectionError`, `InvokeServerUnavailableError`, `InvokeRateLimitError`, `InvokeAuthorizationError`, `InvokeBadRequestError`, and `CredentialsValidateFailedError`. These errors are handled in the `_invoke_error_mapping` method and the `validate_credentials` method in the `XinferenceRerankModel` class. You can find more details in the [api/core/model_runtime/model_providers/xinference/rerank/rerank.py](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/xinference/rerank/rerank.py) file. If you could provide more details about the error you're experiencing, such as any error messages, I might be able to provide more specific advice. Also, please make sure that you've started the xinference server following the steps in the [dify documentation](https://docs.dify.ai/tutorials/model-configuration/xinference) and that you've filled in the URL field with the correct xinference server API URL. ## Sources - [api/tests/integration_tests/model_runtime/__mock/xinference.py](https://github.com/langgenius/dify/blob/main/api/tests/integration_tests/model_runtime/__mock/xinference.py) - [api/core/model_runtime/model_providers/localai/text_embedding/text_embedding.py](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/localai/text_embedding/text_embedding.py) - [api/core/model_runtime/model_providers/xinference/rerank/rerank.py](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/xinference/rerank/rerank.py) --- 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. If you want to continue the conversation, start your reply with @dosu-bot.
Author
Owner

@yoke233 commented on GitHub (Jan 30, 2024):

server url my input is http://xxx:39093/ change to http://xxx:39093 work ok

@yoke233 commented on GitHub (Jan 30, 2024): server url my input is http://xxx:39093/ change to http://xxx:39093 work ok
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1001