provider-OpenAI-API-compatible has a bug #147

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

Originally created by @kongoldwant on GitHub (Mar 28, 2025).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

OpenAI-API-compatible version 0.0.11
when i use this plugin to add a rerank model from Llm studio,it returns a error message 'results'

tips:
i can use this plugin to add llm and text-embdding model from llm studio successfully

for the same parameter,if i change the model type to "text-embedding",it can add successfully

Image Image

As shown in the figure below,if i change the model type to "text-embedding",it can add successfully
Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @kongoldwant on GitHub (Mar 28, 2025). ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce OpenAI-API-compatible version 0.0.11 when i use this plugin to add a rerank model from Llm studio,it returns a error message 'results' tips: i can use this plugin to add llm and text-embdding model from llm studio successfully for the same parameter,if i change the model type to "text-embedding",it can add successfully <img width="1405" alt="Image" src="https://github.com/user-attachments/assets/ef6e9ace-0fbd-4c99-892c-badc196e8a6f" /> <img width="1405" alt="Image" src="https://github.com/user-attachments/assets/fd4a0d43-5071-4cc0-bd99-5e61352f56ef" /> As shown in the figure below,if i change the model type to "text-embedding",it can add successfully <img width="724" alt="Image" src="https://github.com/user-attachments/assets/9aa85f08-903a-42dd-8d42-c4887f646485" /> ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:14 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 28, 2025):

Hello @kongoldwant! I'm here to assist you with any bugs, questions, or contributions you have for the OpenAI-API-compatible plugin. Let's work together to resolve your issue.

I found a similar open issue related to the 'Rerank' model type in the OpenAI-API-compatible plugin, which is experiencing a 400 error due to the top_n parameter being set to None in rerank.py. This issue can be resolved by upgrading to Dify version 1.0.0 or higher and ensuring the OpenAI-API-compatible plugin is version 0.0.6 or higher [1].

Additionally, the 'results' parameter in the OpenAI-API-compatible plugin is part of the JSON response from the /rerank endpoint. It contains the reranked documents along with their relevance scores. In the context of the 'Rerank' model type, it is used to create RerankDocument objects, which include the index, text, and relevance score of each document. These objects are then filtered based on a score_threshold and returned as part of the RerankResult [2].

If you are encountering an "invalid_param" error related to the "results" parameter, ensure that all required parameters are correctly configured and that the plugin version is up to date.

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

@dosubot[bot] commented on GitHub (Mar 28, 2025): <!-- Greeting --> Hello @kongoldwant! I'm here to assist you with any bugs, questions, or contributions you have for the OpenAI-API-compatible plugin. Let's work together to resolve your issue. <!-- Answer --> I found a similar open issue related to the 'Rerank' model type in the OpenAI-API-compatible plugin, which is experiencing a 400 error due to the `top_n` parameter being set to `None` in `rerank.py`. This issue can be resolved by upgrading to Dify version 1.0.0 or higher and ensuring the OpenAI-API-compatible plugin is version 0.0.6 or higher <sup>[[1]](https://github.com/langgenius/dify/issues/14140)</sup>. Additionally, the 'results' parameter in the OpenAI-API-compatible plugin is part of the JSON response from the `/rerank` endpoint. It contains the reranked documents along with their relevance scores. In the context of the 'Rerank' model type, it is used to create `RerankDocument` objects, which include the index, text, and relevance score of each document. These objects are then filtered based on a `score_threshold` and returned as part of the `RerankResult` <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/siliconflow/rerank/rerank.py)</sup>. If you are encountering an "invalid_param" error related to the "results" parameter, ensure that all required parameters are correctly configured and that the plugin version is up to date. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/1ec1cb36-38d4-49d3-9cd7-be25b5c27dca?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/1ec1cb36-38d4-49d3-9cd7-be25b5c27dca?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/1ec1cb36-38d4-49d3-9cd7-be25b5c27dca?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/1ec1cb36-38d4-49d3-9cd7-be25b5c27dca?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1ec1cb36-38d4-49d3-9cd7-be25b5c27dca?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/1ec1cb36-38d4-49d3-9cd7-be25b5c27dca?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1ec1cb36-38d4-49d3-9cd7-be25b5c27dca?feedback_type=other)</sup>
Author
Owner

@kongoldwant commented on GitHub (Mar 30, 2025):

lm studio donot have a router named /rerank

Image
@kongoldwant commented on GitHub (Mar 30, 2025): lm studio donot have a router named /rerank <img width="1176" alt="Image" src="https://github.com/user-attachments/assets/852907ac-8a8e-49d8-b930-24dfadc44b45" />
Author
Owner

@dosubot[bot] commented on GitHub (Aug 17, 2025):

Hi, @kongoldwant. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a bug with the rerank model type in the OpenAI-API-compatible provider on Dify v1.1.3 Docker.
  • Adding a rerank model from Llm studio returns an error related to "results," while other model types work fine.
  • A known issue with the top_n parameter in rerank.py causing a 400 error was suggested as a possible cause.
  • You noted that Llm studio lacks a /rerank router endpoint, indicating a potential mismatch or missing API route.
  • Further investigation into rerank endpoint availability and configuration is needed.

Next Steps:

  • Please confirm if this issue is still relevant with the latest versions of Dify and the plugin by commenting here.
  • If no response is received, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 17, 2025): Hi, @kongoldwant. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a bug with the rerank model type in the OpenAI-API-compatible provider on Dify v1.1.3 Docker. - Adding a rerank model from Llm studio returns an error related to "results," while other model types work fine. - A known issue with the `top_n` parameter in rerank.py causing a 400 error was suggested as a possible cause. - You noted that Llm studio lacks a /rerank router endpoint, indicating a potential mismatch or missing API route. - Further investigation into rerank endpoint availability and configuration is needed. **Next Steps:** - Please confirm if this issue is still relevant with the latest versions of Dify and the plugin by commenting here. - If no response is received, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#147