Skip to content

Support OpenAI-compatible reranker endpoint (e.g. SiliconFlow) via base_url override #859

@AgnoyZ

Description

@AgnoyZ

Use Case

I am running Hindsight in China using SiliconFlow (https://api.siliconflow.cn/v1)
as my API provider for both embeddings and reranking. SiliconFlow works perfectly
as an embeddings provider via HINDSIGHT_API_EMBEDDINGS_OPENAI_BASE_URL, and I want
to use the same platform for reranking with BAAI/bge-reranker-v2-m3, which exposes
a Cohere-compatible /rerank endpoint.

Problem Statement

There is no working way to use SiliconFlow (or any OpenAI-compatible reranker API)
as a reranker provider. All available providers fail:

How This Feature Would Help

SiliconFlow is widely used in China as an alternative to OpenAI/Cohere.
Users who already use SiliconFlow for embeddings naturally want to use it
for reranking too — keeping all inference on one platform with one API key.

Enabling this would make Hindsight fully functional for Chinese users without
requiring a VPN or falling back to RRF, which provides lower recall quality.

Proposed Solution

Add an openai reranker provider that mirrors how the embeddings provider works:

HINDSIGHT_API_RERANKER_PROVIDER=openai
HINDSIGHT_API_RERANKER_OPENAI_BASE_URL=https://api.siliconflow.cn/v1
HINDSIGHT_API_RERANKER_OPENAI_API_KEY=sk-xxx
HINDSIGHT_API_RERANKER_OPENAI_MODEL=BAAI/bge-reranker-v2-m3

This is consistent with the existing embeddings design and would work for any
OpenAI-compatible /rerank endpoint, not just SiliconFlow.

Alternatives Considered

  • cohere provider: fails with 404 due to incorrect URL path construction
  • litellm provider: fails with 400 due to request body format mismatch
  • rrf provider: works but no neural reranking, lower recall quality
  • Hosting a local TEI reranker container: works but adds infrastructure complexity
    and is overkill for users who just want a simple API-based solution

Priority

Important - affects my workflow

Additional Context

No response

Checklist

  • I would be willing to contribute this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions