Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Need support for /v2/rerank #8194

Open
jeromeroussin opened this issue Feb 2, 2025 · 2 comments
Open

[Feature]: Need support for /v2/rerank #8194

jeromeroussin opened this issue Feb 2, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jeromeroussin
Copy link

The Feature

Cohere introduced its v2 API in September 2024. The langchain cohere rerank class enforces the use of v2 only: https://github.com/langchain-ai/langchain-cohere/blob/main/libs/cohere/langchain_cohere/rerank.py#L47

Litellm does not have a /v2/rerank route however. This RFE is about adding /v2/rerank to the current list of rerank endpoints (/v1/rerank, /rerank)

Motivation, pitch

Continued use of litellm as a proxy to cohere and cohere like models.

Are you a ML Ops Team?

No

Twitter / LinkedIn details

https://www.linkedin.com/in/jeromeroussin/

@jeromeroussin jeromeroussin added the enhancement New feature or request label Feb 2, 2025
@ishaan-jaff
Copy link
Contributor

Would you expect the provider route to be cohere/v2 or cohere/

@jeromeroussin
Copy link
Author

Ideally this would work

from cohere import ClientV2
client = ClientV2(api_key=<key>
                base_url= <litellm gateway url>)
response = client.rerank(...)

just like this works today:

from cohere import Client
client = Client(api_key=<key>
                base_url= <litellm gateway url>)
response = client.rerank(...)

That means support for /v2/rerank just like /v1/rerank works.

Are you standardizing that endpoint after something other than Cohere?

@krrishdholakia krrishdholakia self-assigned this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants