Skip to content

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

@JumpLink

Description

@JumpLink

Currently, the reranker implementation only supports Jina and Cohere as hardcoded providers. The model names are also hardcoded (jina-reranker-v2-base-multilingual for Jina, rerank-v3.5 for Cohere).

Many Jina-compatible reranking APIs exist (e.g. Scaleway Generative APIs, vLLM, LiteLLM) that use the same /v1/rerank request/response format but require different model names. Currently there is no way to use these without forking the code.

Proposal

Add a new rerankerType: 'custom' option that allows users to configure:

  • customRerankerApiUrl – The full reranking endpoint URL (e.g. https://api.scaleway.ai/v1/rerank)
  • customRerankerApiKey – API key for authentication
  • customRerankerModel – Model name to send in the request (e.g. qwen3-embedding-8b)

The custom reranker would use the Jina-compatible /v1/rerank format, which is becoming a de facto standard:

// Request
{ "model": "<model>", "query": "...", "documents": [...], "top_n": 3 }

// Response
{ "results": [{ "index": 0, "document": { "text": "..." }, "relevance_score": 0.95 }] }

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions