mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
Add rerank mode at localAi Plugin failed #263
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @crazychengmm on GitHub (May 8, 2025).
Self Checks
Dify version
1.1.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
localAi : 0.0.3
Dify api pod has error
2025-05-09 02:16:56,720.720 ERROR [Dummy-263] [models.py:162] - Failed to save model credentials, tenant_id: 4c382abd-8332-4f6d-91f9-61dad9ffd99a, model: /models/bge-reranker-v2-m3, model_type: rerank
Fri, May 9 2025 10:16:56 am | Traceback (most recent call last):
Fri, May 9 2025 10:16:56 am | File "/app/api/controllers/console/workspace/models.py", line 154, in post
Fri, May 9 2025 10:16:56 am | model_provider_service.save_model_credentials(
Fri, May 9 2025 10:16:56 am | File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials
Fri, May 9 2025 10:16:56 am | provider_configuration.add_or_update_custom_model_credentials(
Fri, May 9 2025 10:16:56 am | File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials
Fri, May 9 2025 10:16:56 am | provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials)
Fri, May 9 2025 10:16:56 am | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fri, May 9 2025 10:16:56 am | File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate
Fri, May 9 2025 10:16:56 am | credentials = model_provider_factory.model_credentials_validate(
Fri, May 9 2025 10:16:56 am | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fri, May 9 2025 10:16:56 am | File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate
Fri, May 9 2025 10:16:56 am | self.plugin_model_manager.validate_model_credentials(
Fri, May 9 2025 10:16:56 am | File "/app/api/core/plugin/manager/model.py", line 137, in validate_model_credentials
Fri, May 9 2025 10:16:56 am | for resp in response:
Fri, May 9 2025 10:16:56 am | ^^^^^^^^
Fri, May 9 2025 10:16:56 am | File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream
Fri, May 9 2025 10:16:56 am | self._handle_plugin_daemon_error(error.error_type, error.message)
Fri, May 9 2025 10:16:56 am | File "/app/api/core/plugin/manager/base.py", line 219, in _handle_plugin_daemon_error
Fri, May 9 2025 10:16:56 am | raise CredentialsValidateFailedError(error_object.get("message"))
Fri, May 9 2025 10:16:56 am | core.model_runtime.errors.validate.CredentialsValidateFailedError: 400 Client Error: Bad Request for url: http://bge-reranker-clusterip-service.default.svc.cluster.local/v2/rerank
Has any modification been made to the parameters? What should the correct ones be? Could it be a version compatibility issue? After testing, the rerank model appears to be functioning normally.
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
@dosubot[bot] commented on GitHub (May 8, 2025):
I found a similar discussion thread titled "How to add local huggingface text-embeddings-inference rerank model to dify" which is currently unsolved [1].
Regarding the error you're encountering, the
CredentialsValidateFailedErrortypically occurs due to issues with service connectivity or incorrect configuration parameters. In your case, the error message indicates a "400 Client Error: Bad Request" for the URL related to the rerank model. Here are some steps you can take to troubleshoot and resolve the issue:Verify Endpoint URL: Ensure that the URL
http://bge-reranker-clusterip-service.default.svc.cluster.local/v2/rerankis correct and accessible from your Dify setup. Check if the service is running and reachable.Check Model Credentials: Make sure that the credentials provided match the
provider_credential_schemaormodel_credential_schemadefined in the provider's YAML configuration file. This includes parameters likeapi_key,server_url, andmodel_uidif applicable [2].Configuration Parameters: Double-check the configuration parameters used for the rerank model. Ensure that they are correctly defined and used according to the model's requirements.
Service Stability: If the issue persists, consider checking the stability of the service or using alternative providers if available [2].
These steps should help you identify and resolve the issue with adding the rerank model to the localAi plugin.
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
@crazychengmm commented on GitHub (May 8, 2025):
localAI rerank model
@gakugaku commented on GitHub (Jun 22, 2025):
@crazychengmm
Potentially related: #1142
@nhha1602 commented on GitHub (Jul 21, 2025):
I have same issue here:
Dify-api: 1.6.0
Dify-Plugin-deamon: 0.1.3
2025-07-21 13:42:43,647.647 DEBUG [Thread-411 (process_request_thread)] [connectionpool.py:241] - Starting new HTTP connection (1): dify-plugin.chatbot-llm-dev:80
2025-07-21 13:42:43,863.863 DEBUG [Thread-411 (process_request_thread)] [connectionpool.py:544] - http://dify-plugin.chatbot-llm-dev:80 "POST /plugin/290190fe-b2ad-4f3f-a9c8-b61e5d2076f2/dispatch/model/validate_model_credentials HTTP/1.1" 200 None
2025-07-21 13:42:43,865.865 ERROR [Thread-411 (process_request_thread)] [models.py:162] - Failed to save model credentials, tenant_id: 290190fe-b2ad-4f3f-a9c8-b61e5d2076f2, model: Qwen3-Reranker-4B, model_type: rerank
Traceback (most recent call last):
File "/app/api/controllers/console/workspace/models.py", line 154, in post
model_provider_service.save_model_credentials(
File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials
provider_configuration.add_or_update_custom_model_credentials(
File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials
provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate
credentials = model_provider_factory.model_credentials_validate(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate
self.plugin_model_manager.validate_model_credentials(
File "/app/api/core/plugin/impl/model.py", line 137, in validate_model_credentials
for resp in response:
^^^^^^^^
File "/app/api/core/plugin/impl/base.py", line 214, in _request_with_plugin_daemon_response_stream
self._handle_plugin_daemon_error(error.error_type, error.message)
File "/app/api/core/plugin/impl/base.py", line 244, in _handle_plugin_daemon_error
raise CredentialsValidateFailedError(error_object.get("message"))
core.model_runtime.errors.validate.CredentialsValidateFailedError: 'results'
2025-07-21 13:42:43,906.906 INFO [Thread-411 (process_request_thread)] [_internal.py:97] - 127.0.0.6 - - [21/Jul/2025 06:42:43] "POST /console/api/workspaces/current/model-providers/langgenius/openai_api_compatible/openai_api_compatible/models HTTP/1.1" 400 -
@nhha1602 commented on GitHub (Jul 23, 2025):
I upgraded vllm to 0.9.2 with following instruction - https://github.com/vllm-project/vllm/pull/19260
And it worked.
@dosubot[bot] commented on GitHub (Aug 21, 2025):
Hi, @crazychengmm. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thank you for your understanding and contribution!