Skip to main content

Rerank Specialist

Reorder retrieved documents by true relevance to a query.

Overview

  • Endpoint(s): rerank-public (curated base) · qwen3-reranker (Qwen3-Reranker-0.6B)
  • Model (rerank-public): BAAI/bge-reranker-base (cross-encoder)
  • Capability: text.rerank
  • Backend: specialist (GPU; runs FP16 on CUDA)
  • Price: per request, USD — see the catalog for the current rate

When to use

✅ The second stage of a search/RAG pipeline: after a fast vector search returns a candidate set, a cross-encoder reranker scores each (query, document) pair jointly for much better ordering than embedding cosine similarity alone.

❌ As a first-stage retriever over a large corpus — cross-encoders score pairs one by one, so run them on a shortlist (e.g. top-20 from the embeddings search), not the whole collection.

Request / response

Pass a query and a list of documents; get back one relevance score per document (same order as the input).

from colabhive import ColabHive

client = ColabHive(api_key="hive_...", account_id="YOUR_ACCOUNT_ID")

result = client.endpoints.infer(
endpoint_id="rerank-public", # SDK resolves the name to a UUID
input_data={
"query": "what is machine learning?",
"documents": ["ML is a field of AI...", "A recipe for pasta...", "Neural networks learn..."],
},
)
data = result["result"] if result.get("status") != "queued" \
else client.endpoints.get_task(result["task_id"])
# data → {"scores": [8.1, -3.2, 5.7], "model": "BAAI/bge-reranker-base", "inference_time_ms": 42.0}
FieldTypeDescription
querystringThe search query
documentslist[string]Candidate documents to score against the query

Sort your documents by the returned scores (higher = more relevant) and keep the top few for your LLM context. The authoritative schema is GET /api/builder/v1/endpoints/{id}.

Tips

  • Feed a shortlist (top-10/20 from vector search), not thousands of documents.
  • Scores are relative, not probabilities — use them to rank, not as calibrated confidences.

Next steps


Authors: José Luis Minich, Maximiliano Lucius.