TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jundot/omlx/llms.txt
Use this file to discover all available pages before exploring further.
/v1/rerank endpoint scores a list of candidate documents against a query and returns them sorted by relevance. It is compatible with Cohere’s and Jina’s rerank API format. oMLX automatically detects reranker model families — ModernBERT and XLM-RoBERTa rerankers are supported — and handles scoring with the appropriate engine. Reranking is particularly useful as a second-stage retrieval step after an initial vector similarity search.
Supported models
| Family | Examples |
|---|---|
| ModernBERT | modernbert-reranker, jina-reranker-v2-base-multilingual |
| XLM-RoBERTa | bge-reranker-v2-m3, bge-reranker-large |
Request
POST /v1/rerank
Parameters
The reranker model name or alias to use. Must match a reranker model discovered in your model directory.
The search query to compare each document against.
- Pass a string for text-only rerankers.
- Pass an object with
textand/orimage(URL, base64 data URI, or local path) for multimodal rerankers such as Qwen3-VL-Reranker.
The documents to rerank. Can be:
- A list of strings (plain text documents).
- A list of objects, each with a
textfield and an optionalimagefield for multimodal rerankers.
Number of top results to return. If not specified, all documents are returned sorted by score.
Whether to include the original document text in the response. Set to
false to return only scores and indices.Maximum number of chunks per document for long documents. Reserved for future use; not implemented in the current release.
Examples
Response
Unique identifier for the rerank request, prefixed with
rerank-.Reranked document list, sorted by
relevance_score descending. If top_n was specified, only the top N results are included.The reranker model used.