Different from embedding model, reranker uses question and document as input and directly output similarity instead of embedding. You can get a relevance score by inputting query and passage to the reranker. And the score can be mapped to a float value in [0,1] by sigmoid function.
Bge-Reranker-Base (baai/bge-reranker-base) is a rerank model from BAAI, released 2025-02-14. Context window: — tokens; max output —. Pricing via AIgateway: input $0.0010/M tokens, output $0/M tokens. Call it via https://api.aigateway.sh/v1/rerank — set model="baai/bge-reranker-base".
curl https://api.aigateway.sh/v1/rerank \
-H "Authorization: Bearer $AIGATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"baai/bge-reranker-base","query":"weather","documents":["sun is bright","mars is red"]}'{
"model": "baai/bge-reranker-base",
"input": "Text to embed, or an array of strings for batch."
}{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0123, -0.0456, 0.0789, /* ... */]
}
],
"model": "baai/bge-reranker-base",
"usage": { "prompt_tokens": 5, "total_tokens": 5 }
}from openai import OpenAI client = OpenAI(base_url="https://api.aigateway.sh/v1", api_key="sk-aig-...") r = client.embeddings.create(model="baai/bge-reranker-base", input="hello world") print(r.data[0].embedding[:5])