Skip to content

feat(api): NVIDIA NIM reranker and embeddings providers - #5697

Merged
nicoloboschi merged 2 commits into
mainfrom
feat/nvidia-reranker
Oct 16, 2026
Merged

nicoloboschi merged 2 commits into
mainfrom
feat/nvidia-reranker

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

Closes #5551.

What

  • nvidia reranker — NVIDIA's ranking API is not Cohere-compatible (per-model path /retrieval/<model>/reranking, {query:{text}} / passages:[{text}] body, rankings[].logit response). One request per distinct query, split into BATCH_SIZE slices (hosted API caps at 512 passages), run concurrently under MAX_CONCURRENT. Raw logits go through recall's existing sigmoid normalization.
    • HINDSIGHT_API_RERANKER_NVIDIA_{API_KEY,MODEL,BASE_URL,TIMEOUT,BATCH_SIZE,MAX_CONCURRENT}, also per failover-chain member.
  • nvidia embeddings — OpenAI-shaped /embeddings plus the input_type (query/passage) NVIDIA's retrieval models need, so it overrides encode_query/encode_documents like ZeroEntropy and ignores the generic prefixes. Uses the shared batching/concurrency cap (EMBEDDINGS_MAX_CONCURRENT_REQUESTS) and retry policy.
    • HINDSIGHT_API_EMBEDDINGS_NVIDIA_{API_KEY,MODEL,BASE_URL,DIMENSIONS,BATCH_SIZE}. Default nvidia/llama-nemotron-embed-vl-1b-v2 at 1024 dims so it fits pgvector's 2000-dim HNSW limit; nemotron-3-embed-1b (2048 only) needs vchord/pgvectorscale.
  • Docs, .env.example (+ embed copy), generated skill docs.

Testing

  • Stub-server tests for both wire formats, batching, index mapping, factory wiring; added to the reranker retry/timeout family tests.
  • Live tests (NVIDIA_LIVE_API_KEY) against the real NVIDIA API — passing.
  • Manual end-to-end: real hindsight-api on a vchord Postgres with nvidia/nemotron-3-embed-1b at 2048 dims + NVIDIA reranker + NVIDIA-hosted LLM: retain → recall → reflect all correct; vectors stored at 2048 dims with vchordrq indexes.
  • Also ran on pg0/pgvector with the reranker only.

Adds an `nvidia` reranker (native /retrieval/<model>/reranking wire format,
rankings[].logit scores, batched to the API's 512-passage cap with bounded
concurrency) and an `nvidia` embeddings provider (/embeddings with a native
input_type=query/passage, configurable dimensions and batch size, shared
concurrency cap and retries).

Closes #5551
Review fixes: a failing slice no longer leaves its siblings running
unobserved (same pattern as the embeddings batcher); test that a slice's
4xx surfaces as UpstreamHTTPError.
@nicoloboschi
nicoloboschi merged commit 2ecc73c into main Oct 16, 2026
117 checks passed
@nicoloboschi
nicoloboschi deleted the feat/nvidia-reranker branch October 16, 2026 16:39
@nicoloboschi nicoloboschi mentioned this pull request Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: NVIDIA NIM reranker provider (native v2/retrieval wire format)

1 participant