OpenAI-API-compatible plugin does not return correct scores from rerank service #397

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

Originally created by @sergik86 on GitHub (Jun 25, 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 Dify issues & Dify Official Plugins, 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.4.3

Plugin version

0.0.16

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Make a rerank request via the OpenAI-API-compatible plugin.

  2. Inspect the response JSON and compare the score or relevance_score fields with those returned directly by the rerank service.

  3. Notice that the scores do not match or are missing.

Image Image

✔️ Error log

No response

Originally created by @sergik86 on GitHub (Jun 25, 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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.4.3 ### Plugin version 0.0.16 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Make a rerank request via the OpenAI-API-compatible plugin. 2. Inspect the response JSON and compare the score or relevance_score fields with those returned directly by the rerank service. 3. Notice that the scores do not match or are missing. <img width="917" alt="Image" src="https://github.com/user-attachments/assets/a94d260f-a7b5-4bf3-812c-e7f51446d402" /> <img width="1443" alt="Image" src="https://github.com/user-attachments/assets/8d12c4dd-e415-4418-9568-544fa8f7671b" /> ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:19:18 -05:00
yindo closed this issue 2026-02-16 10:19:18 -05:00
Author
Owner
@quicksandznzn commented on GitHub (Jul 3, 2025): The scores will be normalized https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/interfaces/model/openai_compatible/rerank.py#L99
Author
Owner

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

Hi, @sergik86. 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 that the OpenAI-API-compatible plugin (v0.0.16) in Dify 1.4.3 self-hosted via Docker showed missing or mismatched rerank scores.
  • A team member clarified that the plugin intentionally normalizes rerank scores.
  • The discrepancy is due to this normalization, not an error in the rerank service.
  • The issue has been resolved with this explanation.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here.
  • If no further updates are provided, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 20, 2025): Hi, @sergik86. 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 that the OpenAI-API-compatible plugin (v0.0.16) in Dify 1.4.3 self-hosted via Docker showed missing or mismatched rerank scores. - A team member clarified that the plugin intentionally normalizes rerank scores. - The discrepancy is due to this normalization, not an error in the rerank service. - The issue has been resolved with this explanation. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here. - If no further updates are provided, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Author
Owner

@JarviLau commented on GitHub (Jan 19, 2026):

The scores will be normalized https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/interfaces/model/openai_compatible/rerank.py#L99

but why do this ? what is the reason to normalize the scores? how can i get the real scores?

@JarviLau commented on GitHub (Jan 19, 2026): > The scores will be normalized https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/interfaces/model/openai_compatible/rerank.py#L99 but why do this ? what is the reason to normalize the scores? how can i get the real scores?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#397