[PR #9510] Add rerank in OpenAI Compatiable Provider , to resolve #9508 #26451

Closed
opened 2026-02-21 20:39:36 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/9510

State: closed
Merged: No


Checklist:

Important

Please review the checklist below before submitting your pull request.

  • [*] Please open an issue before creating a PR or link to an existing issue
  • [*] I have performed a self-review of my own code
  • [*] I have commented my code, particularly in hard-to-understand areas
  • [*] I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

Reslove #9508

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • [*] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

Testing Instructions

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [*] Test A

Run llama.cpp

gguf_file=/mnt/data/proj/gguf/bge-reranker-v2-m3-Q4_K_M.gguf
${llama_path}/bin/llama-server --host 0.0.0.0 --port 9901 -ub 1024 -ngl 99 -m $gguf_file --reranking

llama.cpp output

slot update_slots: id  0 | task 69 | prompt tokenized, n_ctx_slot = 8192, n_keep = 0, n_prompt_tokens = 484
slot update_slots: id  0 | task 69 | kv cache rm [0, end)
slot update_slots: id  0 | task 69 | prompt processing progress, n_past = 484, n_tokens = 484, progress = 1.000000
slot update_slots: id  0 | task 69 | prompt done, n_past = 484, n_tokens = 484
slot      release: id  0 | task 69 | stop processing: n_past = 484, truncated = 0
srv  update_slots: all slots are idle
request: POST /rerank 172.21.0.7 200

Test works on Dify.
Screenshot from 2024-10-20 13-19-18

**Original Pull Request:** https://github.com/langgenius/dify/pull/9510 **State:** closed **Merged:** No --- # Checklist: > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [*] Please open an issue before creating a PR or link to an existing issue - [*] I have performed a self-review of my own code - [*] I have commented my code, particularly in hard-to-understand areas - [*] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods # Description Reslove #9508 ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [*] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [ ] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement - [ ] Dependency upgrade # Testing Instructions Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - [*] Test A Run llama.cpp ``` gguf_file=/mnt/data/proj/gguf/bge-reranker-v2-m3-Q4_K_M.gguf ${llama_path}/bin/llama-server --host 0.0.0.0 --port 9901 -ub 1024 -ngl 99 -m $gguf_file --reranking ``` llama.cpp output ``` slot update_slots: id 0 | task 69 | prompt tokenized, n_ctx_slot = 8192, n_keep = 0, n_prompt_tokens = 484 slot update_slots: id 0 | task 69 | kv cache rm [0, end) slot update_slots: id 0 | task 69 | prompt processing progress, n_past = 484, n_tokens = 484, progress = 1.000000 slot update_slots: id 0 | task 69 | prompt done, n_past = 484, n_tokens = 484 slot release: id 0 | task 69 | stop processing: n_past = 484, truncated = 0 srv update_slots: all slots are idle request: POST /rerank 172.21.0.7 200 ``` Test works on Dify. ![Screenshot from 2024-10-20 13-19-18](https://github.com/user-attachments/assets/dddbbe0c-725f-4294-8f5f-d599df12a113)
yindo added the pull-request label 2026-02-21 20:39:36 -05:00
yindo closed this issue 2026-02-21 20:39:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#26451