Skip to content

feat: add custom reranker provider support in web search config - #12121

Open
JumpLink wants to merge 1 commit into
LibreChat-AI:mainfrom
faktenforum:feat/custom-reranker-provider
Open

JumpLink wants to merge 1 commit into
LibreChat-AI:mainfrom
faktenforum:feat/custom-reranker-provider

Conversation

@JumpLink

@JumpLink JumpLink commented Mar 7, 2026 •

Copy link
Copy Markdown
Contributor

feat: add custom reranker provider support in web search config

Closes #12119

Companion to LibreChat-AI/agents#66, which adds the custom reranker itself.
This is the config side so it can be selected from librechat.yaml:

webSearch:
  rerankerType: 'custom'
  customRerankerApiUrl: 'https://api.scaleway.ai/v1/rerank'
  customRerankerApiKey: '${SCALEWAY_API_KEY}'
  customRerankerModel: 'qwen3-embedding-8b'
  • RerankerTypes.CUSTOM plus the three fields on the web-search schema,
    defaulting to ${CUSTOM_RERANKER_*} placeholders like the existing providers
  • webSearchAuth.rerankers.custom requires URL and model, treats the API key as
    optional - some self-hosted rerank endpoints (vLLM, TEI) need no auth
  • loadWebSearchConfig passes them through

Motivation: any service speaking Jina's /v1/rerank shape (Scaleway Generative
APIs, vLLM, LiteLLM, TEI) is usable as a reranker, but the provider list and
model names are hardcoded today, and infinity is still a placeholder returning
the default ranking. Verified end to end against Scaleway with
qwen3-embedding-8b.

Drive-by: RerankerTypes was imported in app/web.ts but never used, which
fails the repo's --max-warnings=0 lint on changed files; removed. (Keying the
map off the enum instead would break isolatedDeclarations.)

@JumpLink

This comment was marked as outdated.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

Closes LibreChat-AI#12119

Companion to LibreChat-AI/agents#66, which adds the `custom` reranker itself.
This is the config side so it can be selected from `librechat.yaml`:

```yaml
webSearch:
  rerankerType: 'custom'
  customRerankerApiUrl: 'https://api.scaleway.ai/v1/rerank'
  customRerankerApiKey: '${SCALEWAY_API_KEY}'
  customRerankerModel: 'qwen3-embedding-8b'
```

- `RerankerTypes.CUSTOM` plus the three fields on the web-search schema,
  defaulting to `${CUSTOM_RERANKER_*}` placeholders like the existing providers
- `webSearchAuth.rerankers.custom` requires URL and model, treats the API key as
  optional - some self-hosted rerank endpoints (vLLM, TEI) need no auth
- `loadWebSearchConfig` passes them through
- `customRerankerApiKey` is registered in the admin secret registry with its
  `customRerankerApiKeyPreview` companion, so it is encrypted at rest and
  redacted on read like every other web-search key

Motivation: any service speaking Jina's `/v1/rerank` shape (Scaleway Generative
APIs, vLLM, LiteLLM, TEI) is usable as a reranker, but the provider list and
model names are hardcoded today, and `infinity` is still a placeholder returning
the default ranking. Verified end to end against Scaleway with
`qwen3-embedding-8b`.

Drive-by: `RerankerTypes` was imported in `app/web.ts` but never used, which
fails the repo's `--max-warnings=0` lint on changed files; removed. (Keying the
map off the enum instead would break `isolatedDeclarations`.)

Signed-off-by: JumpLink <pascal@artandcode.studio>
@JumpLink
JumpLink force-pushed the feat/custom-reranker-provider branch from db2ebf5 to 80374dd Compare August 14, 2026 09:33
@danny-avila danny-avila added 🗺️ Shared Types codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) 🛡️ security review labels Sep 24, 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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Support custom reranker provider with configurable URL and model name

2 participants