Skip to content

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

Open

Description

@JumpLink

What features would you like to see added?

Add support for a custom reranker type in the web search configuration, allowing users to specify their own Jina-compatible reranking endpoint with a custom URL, API key, and model name.

Currently only jina and cohere are supported as reranker providers, and model names are hardcoded. Many providers (Scaleway, vLLM, LiteLLM, etc.) offer Jina-compatible /v1/rerank endpoints with different model names. The documentation already mentions "Planned Rerankers: Additional third-party reranking services".

More details

The configuration would look like this in librechat.yaml:

webSearch:
  rerankerType: "custom"
  customRerankerApiUrl: "${CUSTOM_RERANKER_API_URL}"
  customRerankerApiKey: "${CUSTOM_RERANKER_API_KEY}"
  customRerankerModel: "qwen3-embedding-8b"

With corresponding environment variables:

CUSTOM_RERANKER_API_URL=https://api.scaleway.ai/v1/rerank
CUSTOM_RERANKER_API_KEY=your-api-key
CUSTOM_RERANKER_MODEL=qwen3-embedding-8b

Changes needed:

Which components are impacted by your request?

Endpoints

Pictures

No response

Related issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. danny-avila commented on Mar 7, 2026

    @danny-avila
    Collaborator

    Thanks for the request, on my list to finalize this PR: LibreChat-AI/rag-api#190

  2. mdbook commented on Jun 19, 2026

    @mdbook

    +1, ran into this exact thing self-hosting against a local Infinity reranker.

    two issues with the jina path right now:

    1. the model name is hardcoded to jina-reranker-v2-base-multilingual in @librechat/agents (tools/search/rerankers.ts), no way to override it
    2. there's no custom reranker type, just jina and cohere

    jinaApiUrl already lets you point somewhere else and that part works great (Infinity serves a jina-style /rerank). the problem is the hardcoded model name, so my reranker has to answer to jina-reranker-v2-base-multilingual. my current hack is aliasing the real model under that name with Infinity's --served-model-name. it works, but it's gross: the served name is now decoupled from the actual model, and anything else hitting that endpoint (a memory service, in my case) has to send the fake name too.

    rerankerType: custom + customRerankerModel would just fix it. would love to see it land. this is a UI built around local LLMs and reranking is basically the last thing still pinned to a cloud provider's model name.

  3. added a commit that references this issue on Aug 14, 2026
    80374dd
  4. Hermsi1337 commented on Oct 20, 2026

    @Hermsi1337

    +1 from a self-hosted setup on mittwald AI Hosting (German hoster, OpenAI-compatible API behind LiteLLM).

    Their /v1/rerank endpoint already speaks the Jina format. I tested it with Qwen3-VL-Reranker-2B:

    POST https://llm.aihosting.mittwald.de/v1/rerank
    {"model": "Qwen3-VL-Reranker-2B", "query": "...", "documents": ["...", "...", "..."], "top_n": 3}
    → {"results": [{"index": 1, "relevance_score": 0.42, "document": {"text": "..."}}, ...]}

    So jinaApiUrl would work fine. The only thing blocking it is the model name hardcoded to jina-reranker-v2-base-multilingual in @librechat/agents (tools/search/rerankers.ts). Since I can't rename the model on a hosted service, I run reranking with rerankerType: "none" for now.

    I saw the plan to route reranking through the RAG API (rag-api reranker type in agents, rag-api #318). Will that path also let me point at an external Jina-compatible endpoint with my own model name? If not, I'm happy to help get #12121 / agents #66 rebased and tested against a real non-Jina backend.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ enhancementNew feature or request🗺️ Backend Infracodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions