mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
add rerank model with OpenAI-API-compatible provdier and there is no model in list #656
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 @skyfall2022 on GitHub (Sep 17, 2025).
Self Checks
Dify version
1.8.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
add rerank model with OpenAI-API-compatible provdier and then there is no model in list. However, 1.7.1 version hasn't this problem.
✔️ Expected Behavior
succeed to add rerank model with OpenAI-API-compatible provdier
❌ Actual Behavior
No response
@dosubot[bot] commented on GitHub (Sep 17, 2025):
Hi @skyfall2022! I'm Dosu and I’m helping the dify team.
This is a known issue in Dify v1.8.1 with OpenAI-API-compatible providers. Recent versions require stricter validation and explicit configuration for rerank models. Common causes for rerank models not appearing in the list include missing required fields (especially
context_size,top_n, andscore_threshold), credentials not being properly linked, or network issues between your Docker container and the model endpoint. The UI may not show thecontext_sizefield due to a backend/frontend bug, but you can manually add it using a PATCH API call—set it to a typical value like 4096 to match your model's context window source.Make sure your rerank model config includes all required fields, and that your plugin daemon returns error responses as JSON objects, not lists. If your rerank provider returns results with
relevance_scoreinstead ofscore, you’ll need to transform the response so each document uses thescorefield source.Also, double-check that your API key and endpoint are valid, credentials are initialized and linked to the model, and your Docker container can reach the endpoint. Restarting the
difyandplugin_daemoncontainers can help clear any cache or backend state issues source.If you need to manually set
context_size, here’s a sample curl command:Replace
<your-admin-token>,<provider-id>, and<your-dify-host>with your actual values.Upgrading to the latest OpenAI-API-compatible plugin (after v0.0.22) should restore the UI field and normal workflow for rerank models source.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@crazywoola commented on GitHub (Sep 17, 2025):
https://github.com/langgenius/dify-official-plugins/issues/1729
@dosubot[bot] commented on GitHub (Sep 17, 2025):
This issue is likely caused by stricter validation and schema requirements for rerank models in Dify 1.8.1. The backend now enforces that rerank model outputs use the field
score(float) for each document—if your OpenAI-API-compatible provider returnsrelevance_scoreinstead, Dify won't recognize it and will block the model from being listed due to a schema validation error [source].Other common causes include missing or misconfigured required fields (like provider name, model name, credentials, or the
top_nparameter), or plugin daemon errors that aren't returned as JSON objects [source]. If the model instance or its response isNone, you'll see errors like'NoneType' object is not iterable', and the model won't be added [source].To fix or work around this:
scorefield, notrelevance_score. If you can't change the provider, use a proxy to rewrite the response JSON.top_n, are set and valid.These stricter checks were introduced after 1.7.1, which is why the same setup may now fail in 1.8.1 [source].
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
