Skip to content

feat: support custom Cohere reranker API URL for web search - #15518

Open
busla wants to merge 3 commits into
LibreChat-AI:devfrom
aproorg:feat/cohere-reranker-api-url
Open

busla wants to merge 3 commits into
LibreChat-AI:devfrom
aproorg:feat/cohere-reranker-api-url

Conversation

@busla

@busla busla commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds cohereApiUrl (env COHERE_API_URL) to the webSearch config, mirroring the existing jinaApiUrl override, so a Cohere-compatible reranking endpoint (e.g. a self-hosted LiteLLM proxy) can be used instead of api.cohere.com.
  • Threads the new field through webSearchSchema, loadWebSearchConfig/webSearchAuth, and the SSRF preflight (USER_PROVIDED_URL_KEYS) that already covers jinaApiUrl/firecrawlApiUrl.
  • Documents the new field in librechat.example.yaml.

This is a companion to danny-avila/agents#498 adding cohereApiUrl support to CohereReranker/createReranker — without that change, the field is accepted here but has no effect since @librechat/agents still hardcodes https://api.cohere.com/v2/rerank. Docs for both are in LibreChat-AI/librechat.ai#753.

Test plan

  • packages/api and packages/data-schemas unit tests pass (including new cases: default URL, custom URL, SSRF-blocked localhost URL for cohereApiUrl)
  • tsc --noEmit clean in packages/api, packages/data-schemas, packages/data-provider
  • eslint clean on all touched files

A note on why this is a re-submission

This is the third independent PR proposing this exact feature. A small, additive, test-covered config option going unreviewed for the better part of a year — proposed three times, by three different contributors, with real users confirming the need in production — is a real cost to a project that depends on outside contributions. I'm flagging the pattern here rather than quietly opening a fourth copy of the same request.

Related PRs:

Happy to coordinate with @npeham so we're not duplicating effort further.

🤖 Generated with Claude Code

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-07T12:34:16.632851Z b8f8c4f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8f8c4f270

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/data-provider/src/config.ts
Comment thread packages/api/src/web/web.ts Outdated
Comment thread packages/data-schemas/src/app/web.ts
Adds cohereApiUrl (env COHERE_API_URL) alongside the existing jinaApiUrl,
so a Cohere-compatible reranking endpoint (e.g. a LiteLLM proxy) can be
used instead of api.cohere.com. Mirrors the Jina URL override pattern
across the webSearch schema, auth loading, and SSRF preflight.

Requires @librechat/agents to accept a cohereApiUrl in createReranker
(companion PR: danny-avila/agents).
…tions

- Expose cohereApiUrl input and help link in web search credential dialog
- Include cohereApiUrl in WEB_SEARCH_URL_KEYS for outbound SSRF proxy exemption
- Update client auth types, form handling, translations, and unit tests
- Update AppService and agent unit tests
@busla
busla force-pushed the feat/cohere-reranker-api-url branch from 7b8f260 to 95e1c18 Compare September 30, 2026 13:16
@codegraph-librechat codegraph-librechat Bot added the 🗺️ Backend Infra codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗺️ Backend Infra codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) 🛡️ security review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants