add rerank model with OpenAI-API-compatible provdier and there is no model in list #656

Closed
opened 2026-02-16 10:20:05 -05:00 by yindo · 3 comments
Owner

Originally created by @skyfall2022 on GitHub (Sep 17, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

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

Originally created by @skyfall2022 on GitHub (Sep 17, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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 submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### 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_
yindo added the bug label 2026-02-16 10:20:05 -05:00
yindo closed this issue 2026-02-16 10:20:05 -05:00
Author
Owner

@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, and score_threshold), credentials not being properly linked, or network issues between your Docker container and the model endpoint. The UI may not show the context_size field 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_score instead of score, you’ll need to transform the response so each document uses the score field 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 dify and plugin_daemon containers can help clear any cache or backend state issues source.

If you need to manually set context_size, here’s a sample curl command:

curl -X PATCH \
  -H "Authorization: Bearer <your-admin-token>" \
  -H "Content-Type: application/json" \
  -d '{"context_size": "4096"}' \
  https://<your-dify-host>/api/v1/model-providers/<provider-id>

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  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Sep 17, 2025): <!-- Greeting --> Hi @skyfall2022! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> 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`, and `score_threshold`), credentials not being properly linked, or network issues between your Docker container and the model endpoint. The UI may not show the `context_size` field 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](https://github.com/langgenius/dify/issues/24858). 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_score` instead of `score`, you’ll need to transform the response so each document uses the `score` field [source](https://github.com/langgenius/dify-official-plugins/issues/1429). 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 `dify` and `plugin_daemon` containers can help clear any cache or backend state issues [source](https://github.com/langgenius/dify/issues/25806). If you need to manually set `context_size`, here’s a sample curl command: ```bash curl -X PATCH \ -H "Authorization: Bearer <your-admin-token>" \ -H "Content-Type: application/json" \ -d '{"context_size": "4096"}' \ https://<your-dify-host>/api/v1/model-providers/<provider-id> ``` 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](https://github.com/langgenius/dify/issues/24858). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/8c977e75-a077-4ba4-856a-5184c8088596?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8c977e75-a077-4ba4-856a-5184c8088596?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8c977e75-a077-4ba4-856a-5184c8088596?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8c977e75-a077-4ba4-856a-5184c8088596?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8c977e75-a077-4ba4-856a-5184c8088596?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8c977e75-a077-4ba4-856a-5184c8088596?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8c977e75-a077-4ba4-856a-5184c8088596?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/25844)
Author
Owner

@crazywoola commented on GitHub (Sep 17, 2025):

https://github.com/langgenius/dify-official-plugins/issues/1729

@crazywoola commented on GitHub (Sep 17, 2025): https://github.com/langgenius/dify-official-plugins/issues/1729
Author
Owner

@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 returns relevance_score instead, 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_n parameter), or plugin daemon errors that aren't returned as JSON objects [source]. If the model instance or its response is None, you'll see errors like 'NoneType' object is not iterable', and the model won't be added [source].

To fix or work around this:

  • Make sure your rerank provider/plugin returns results with a score field, not relevance_score. If you can't change the provider, use a proxy to rewrite the response JSON.
  • Double-check all required configuration fields, especially top_n, are set and valid.
  • If you don't see any error in the UI, check browser console and server logs for validation errors when saving the model.
  • If you need to set hidden parameters (like context size), you can temporarily switch the model type to LLM in the UI, set the value, then switch back to rerank and save [source].

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  Join Discord Share on X

@dosubot[bot] commented on GitHub (Sep 17, 2025): <!-- Answer --> 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 returns `relevance_score` instead, Dify won't recognize it and will block the model from being listed due to a schema validation error [[source](https://github.com/langgenius/dify-official-plugins/issues/1429)]. Other common causes include missing or misconfigured required fields (like provider name, model name, credentials, or the `top_n` parameter), or plugin daemon errors that aren't returned as JSON objects [[source](https://github.com/langgenius/dify-official-plugins/issues/1426)]. If the model instance or its response is `None`, you'll see errors like `'NoneType' object is not iterable'`, and the model won't be added [[source](https://github.com/langgenius/dify-official-plugins/issues/1117)]. To fix or work around this: - Make sure your rerank provider/plugin returns results with a `score` field, not `relevance_score`. If you can't change the provider, use a proxy to rewrite the response JSON. - Double-check all required configuration fields, especially `top_n`, are set and valid. - If you don't see any error in the UI, check browser console and server logs for validation errors when saving the model. - If you need to set hidden parameters (like context size), you can temporarily switch the model type to LLM in the UI, set the value, then switch back to rerank and save [[source](https://github.com/langgenius/dify/discussions/24935)]. These stricter checks were introduced after 1.7.1, which is why the same setup may now fail in 1.8.1 [[source](https://github.com/langgenius/dify-official-plugins/issues/1517)]. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/3e79f943-7229-4e2a-994f-ea3b72b3bacb?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/3e79f943-7229-4e2a-994f-ea3b72b3bacb?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/3e79f943-7229-4e2a-994f-ea3b72b3bacb?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/3e79f943-7229-4e2a-994f-ea3b72b3bacb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3e79f943-7229-4e2a-994f-ea3b72b3bacb?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/3e79f943-7229-4e2a-994f-ea3b72b3bacb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3e79f943-7229-4e2a-994f-ea3b72b3bacb?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1730)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#656