Skip to content

Add endpoint aliases for reranking models#201

Merged
mostlygeek merged 4 commits intomostlygeek:mainfrom
gaelj:add-rereank-endpoint-aliases
Jul 24, 2025
Merged

Add endpoint aliases for reranking models#201
mostlygeek merged 4 commits intomostlygeek:mainfrom
gaelj:add-rereank-endpoint-aliases

Conversation

@gaelj
Copy link
Contributor

@gaelj gaelj commented Jul 23, 2025

The /rerank end point is needed by RAGFlow.

These aliases are allowed in llama-cpp documentation

I have tested successfully the change.

Summary by CodeRabbit

  • New Features

    • Added support for two new API endpoints: /v1/reranking and /rerank for reranking requests.
  • Documentation

    • Updated the README to include the new endpoints in the features list.

@coderabbitai
Copy link

coderabbitai bot commented Jul 23, 2025

Walkthrough

Two new reranking API endpoints, /v1/reranking and /rerank, were added to the backend routing logic and documented in the README. These endpoints are now handled similarly to existing rerank endpoints, with metrics tracking enabled. No changes were made to exported or public entities.

Changes

File(s) Change Summary
README.md Added /v1/reranking and /rerank endpoints to the documented features list.
proxy/proxymanager.go Registered POST routes for /v1/embeddings, /v1/rerank, /v1/reranking, and /rerank with metrics middleware and handler.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • mostlygeek

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21b6fba and e3672c9.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 01d4838 and 699f139.

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • proxy/proxymanager.go (1 hunks)
🔇 Additional comments (2)
proxy/proxymanager.go (1)

165-166: LGTM! New reranking endpoints added correctly.

The implementation properly adds the /v1/reranking and /rerank endpoints with metrics tracking enabled, which aligns with the PR objectives to support RAGFlow requirements.

README.md (1)

22-23: LGTM! Documentation properly updated.

The new reranking endpoints are correctly documented in the OpenAI API supported endpoints list, maintaining consistency with the implementation changes.

@gaelj
Copy link
Contributor Author

gaelj commented Jul 23, 2025

@coderabbitai full review
@coderabbitai summary

@coderabbitai
Copy link

coderabbitai bot commented Jul 23, 2025

Tip

For best results, initiate chat on the files or code changes.

@gaelj I've received your requests for a full review and summary regeneration.

The @coderabbitai full review command will trigger a complete re-review of all files in this PR from scratch, analyzing the changes in both README.md and proxy/proxymanager.go files again.

The @coderabbitai summary command will regenerate the high-level summary of the PR changes.

Both automated processes will be initiated and you should see the results shortly. The full review will provide fresh analysis of your endpoint aliases implementation for the /rerank and /v1/reranking endpoints, while the summary will give you an updated overview of the changes made in this PR.

@mostlygeek
Copy link
Owner

can RAGFlow work with v1/rerank or v1/reranking? I’d like to keep all proxied api calls under the v1/ path.

@gaelj
Copy link
Contributor Author

gaelj commented Jul 24, 2025

Not without modifying their rerank method and submit the change in their repo.

But, as the endpoint in question is specifically allowed in the llama-cpp docs as an alias, in my opinion adapting llama-swap is the better solution and will probably fix other people's similar issues with some other client software.

I agree 100% that the choice of this endpoint alias seems to be a poor one, both from open AI and/or llama-cpp for allowing it and ragflow for using it exclusively, but unfortunately, like all cursed features, some people are going to rely on it.

@mostlygeek
Copy link
Owner

mostlygeek commented Jul 24, 2025

So OpenAI doesn’t even have a rerank api.

Could you put all the rerank endpoints in one line for README changes?

After that, I’ll merge.

Thanks

@gaelj
Copy link
Contributor Author

gaelj commented Jul 24, 2025

Great, thanks !

@mostlygeek mostlygeek merged commit 8c693e7 into mostlygeek:main Jul 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants