Back to model library

Reranking / MODEL API

BGE-Reranker-V2-M3

Input $0.03 / 1M tokens

OVERVIEW

Model overview

bge-reranker-v2-m3,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.

Specifications

Category
Reranking
Input modalities
text
Output modalities
text

MODEL PRICING

Model API pricing

Reranking

USD per 1M tokens
Reranking — USD per 1M tokens
ModelInputOutput
BGE-Reranker-V2-M3$0.03—

Public platform rates refresh every five minutes. A dash means a rate is not provided; it does not mean free. Check the console for final charges.

BUILT FOR YOUR STACK

API quickstart

Read the docs

Expand connection setup and run the preparation commands first. Then save and run the Python or cURL example.

Connection setup & preparationActual API address, model ID, and environment variables
API address
https://api.ecohash.com/v1
API model ID
bge-reranker-v2-m3

Replace YOUR_API_KEY with the full inference API key issued in the console. Run setup in macOS/Linux or a compatible shell. JSON cURL examples use the Python standard library to build the request body.

Terminal
python -m pip install requests
export GIGACOMMA_API_BASE_URL='https://api.ecohash.com/v1'
export GIGACOMMA_MODEL_ID='bge-reranker-v2-m3'
export GIGACOMMA_API_KEY="YOUR_API_KEY"

GIGACOMMA_API_KEY is the environment variable name. Its value is an inference API key from the console, not an OpenAI API key. Get an API key

quickstart.py
import osimport requestsMODEL_ID = os.environ["GIGACOMMA_MODEL_ID"]BASE_URL = os.environ["GIGACOMMA_API_BASE_URL"].rstrip("/")headers = {"Authorization": f"Bearer {os.environ['GIGACOMMA_API_KEY']}"}response = requests.post(    f"{BASE_URL}/rerank", headers=headers,    json={"model": os.environ["GIGACOMMA_MODEL_ID"],    "query": "What is GPU computing?",    "documents": ["GPUs accelerate parallel computing.", "A guide to baking bread."],    "top_n": 2},    timeout=120,)response.raise_for_status()print(response.json())