-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Description
What features would you like to see added?
Add a configurable cohereApiUrl option for the Cohere reranker, similar to how the Jina reranker already supports a custom jinaApiUrl. This would allow users to use Azure AI-hosted Cohere reranker models (or any other Cohere-compatible endpoint) instead of being locked to the native https://api.cohere.com/v2/rerank URL.
More details
Currently, the CohereReranker class in @librechat/agents has the API URL hardcoded to https://api.cohere.com/v2/rerank:
const response = await axios.post<t.CohereRerankerResponse | undefined>(
'https://api.cohere.com/v2/rerank',
requestData,
{ headers: { ... } }
);The JinaReranker already supports a configurable URL via apiUrl constructor parameter, JINA_API_URL env var, and jinaApiUrl in the web search config — but the Cohere reranker has no equivalent.
Azure AI hosts Cohere reranker models (e.g., Cohere-rerank-v3.5) as serverless API deployments with a different base URL format (e.g., https://<resource>.services.ai.azure.com/models/chat/completions), and they also use a different auth header format.
Proposed changes:
@librechat/agents— Add an optionalapiUrlparameter to theCohereRerankerconstructor (defaulting tohttps://api.cohere.com/v2/rerank), mirroring theJinaRerankerpattern.packages/data-schemas— AddcohereApiUrlas an optional field (0) inwebSearchAuth.rerankers.cohere.packages/data-provider— AddcohereApiUrlto thewebSearchSchemaandloadWebSearchConfig.- Frontend (
ApiKeyDialog) — Add a URL input field for the Cohere reranker option, similar to how Jina already has one. .env.example— DocumentCOHERE_API_URL.
This would bring Cohere reranker configuration to parity with Jina and enable Azure AI (and other compatible) deployments.
Which components are impacted by your request?
Plugins, Endpoints, UI
Code of Conduct
- I agree to follow this project's Code of Conduct