mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
LocalAI plugin: Missing /v1 prefix in Rerank endpoint causes 404 error #391
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 @gakugaku on GitHub (Jun 22, 2025).
Self Checks
Dify version
1.4.3
Plugin version
0.0.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
In a Dify 1.1.3 + LocalAI 0.0.3 setup, registering a LocalAI Rerank model fails because requests are sent to
.../rerankinstead of.../v1/rerank, resulting in a 404CredentialsValidateFailedError.bge-reranker-v2-m3.http://localhost:8080(sample host/port).Expected Behavior
The request is sent to
http://localhost:8080/v1/rerankand returns HTTP 200.Actual Behavior
The request is sent to
http://localhost:8080/rerankand LocalAI returns HTTP 404.Root Cause
models/localai/models/rerank/rerank.pybuilds the URL as:Unless the user manually appends
/v1to Server url, the request lacks the version prefix.Related Code Comparison
/v1added in code?/v1/completionsllm.py#L346/v1/audio/speechspeech2text.py#L34/v1/rerankrerank.py#L63/embeddingstext_embedding.py#L67Embeddings intentionally omits /v1, matching the LocalAI spec.
Proposed Fix
Update
rerank.pyto align with the other plugins:https://github.com/langgenius/dify-official-plugins/blob/c48f8be6aad263a314d7aedb42406402a78354b7/models/localai/models/rerank/rerank.py#L63
✔️ Error log
No response
@dosubot[bot] commented on GitHub (Aug 18, 2025):
Hi, @gakugaku. 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!
@gakugaku commented on GitHub (Aug 23, 2025):
https://github.com/langgenius/dify-official-plugins/issues/1142#issuecomment-3197530448
this issue is still relevant with the latest version of the dify-official-plugins repository.
@dosubot[bot] commented on GitHub (Aug 23, 2025):
@crazywoola The user gakugaku has confirmed that the issue #1142 is still relevant with the latest version of the dify-official-plugins repository and would appreciate your assistance.