Contextual AI Rerank v2
Contextual AI Rerank v2 is built to take an instruction next to the query, such as “prioritise recent internal documents”, and rank by relevance first and the instruction second. It comes as open weights in three sizes (1B, 2B and 6B, 100+ languages, up to 32K tokens) under a non-commercial licence, and as a paid hosted API for commercial use.
Weights or API
| Route | Models | Licence or price | Limits |
|---|---|---|---|
| Open weights | v2 in 1B, 2B and 6B sizes (for example ctxl-rerank-v2-instruct-multilingual-2b), plus quantised versions | CC BY-NC-SA 4.0: non-commercial only | Up to 32K tokens |
| Hosted API, v2 | ctxl-rerank-v2-instruct-multilingual | $0.05 per 1M tokens | 8,000 tokens for query, instruction and each document; 400,000 per request |
| Hosted API, v2-mini | ctxl-rerank-v2-instruct-multilingual-mini | $0.02 per 1M tokens |
The API also still serves the older ctxl-rerank-v1-instruct. Contextual doesn’t say which open-weight size the API’s v2 and v2-mini correspond to, so don’t assume a benchmark of one carries over to the other.
Writing instructions
Contextual evaluated instructions about four things: recency, document type, source and metadata. Some practical points from their documentation:
- Relevance still comes first. The model ranks by relevance to the query and uses the instruction second, so an instruction won’t lift an off-topic document.
- Give a timeframe, not “this year”. The model doesn’t know today’s date, so name the dates or range you mean.
- Pass metadata with the document if the instruction depends on it (source, type, date); the API takes a
metadatalist alongside the documents.
For the general pattern and how to evaluate instruction rerankers, see instruction-following rerank.
Quick start
Open weights, with sentence-transformers
pip install sentence-transformers
import torch
from sentence_transformers import CrossEncoder
model = CrossEncoder(
"ContextualAI/ctxl-rerank-v2-instruct-multilingual-2b",
model_kwargs={"dtype": torch.bfloat16},
)
query = "What are the health benefits of exercise?"
documents = [
"Regular exercise reduces risk of heart disease and improves mental health.",
"A 2024 study shows exercise enhances cognitive function in older adults.",
]
rankings = model.rank(query, documents, prompt="Prioritize recent medical research")
The instruction goes in prompt and is optional. Scores are raw logits, higher meaning more relevant. For production serving the model card recommends vLLM.
Hosted API
curl https://api.contextual.ai/v1/rerank \
-H "Authorization: Bearer $CONTEXTUAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ctxl-rerank-v2-instruct-multilingual",
"query": "What are the health benefits of exercise?",
"instruction": "Prioritize recent medical research",
"documents": ["...", "..."], "top_n": 5}'
Scores
Contextual publish their benchmark results only as charts, in their launch post: instruction-following, question answering, BEIR, multilingual and product search, each plotted against price. There is no table to cite, so this site shows no number for it. They also released the three instruction-following datasets they used, so you can rerun that part yourself.
When to pick Contextual AI
- Yes: ranking rules that a query alone can’t express, such as freshness, source priority or document type, especially when the rule changes per product surface.
- Yes: research or internal non-commercial use of open weights, with the instruction support included.
- Check the licence: a commercial product has to use the hosted API, not the weights.
- Maybe not: you need published numbers to compare against. Look at Qwen3-Reranker, which also takes instructions and publishes FollowIR scores.
Pros and cons
Pros
- Instruction-following, with metadata passed alongside documents
- 100+ languages and up to 32K tokens
- Three open sizes, plus quantised versions
- Hosted API priced per token
Cons
- Weights are non-commercial (CC BY-NC-SA 4.0)
- Benchmarks only as charts, no table
- The API’s models aren’t mapped to the open sizes
- GPU required; too large for our in-browser demo
Test an instruction on your own data
Rerank the same candidates with and without an instruction, on labelled queries, and check the instruction moves the documents you meant it to.
Instruction rerank guide → All models →