mxbai-rerank
Open-source reranking models from Mixedbread that improve search relevance for retrieval, RAG, code search and multi-tool agents.
At a Glance
About mxbai-rerank
mxbai-rerank is a set of open-source reranking models from Mixedbread, released under the Apache 2.0 license, with a Python package for scoring and ordering documents against a query. The v2 models (0.5B base and 1.5B large) were trained with reinforcement learning and are also available through Mixedbread's managed API.
What It Is
mxbai-rerank is a reranker library and model family used as a second stage in search and retrieval-augmented generation pipelines. You pass a query and a list of candidate documents, and the model returns them ranked by relevance. Mixedbread is described as an applied research lab focused on retrieval.
How It Works
Install the package with pip, load a model such as mxbai-rerank-base-v2 or mxbai-rerank-large-v2, and call the rank method with a query and documents. Optional settings include an instruction to steer ranking (for example, picking the best code snippet), a longer max context length (default 8k tokens, with 32k noted as compatible), and Flash Attention 2 when it is installed. The README says the models handle 100+ languages, code and SQL, and can rerank function calls for multi-tool agents.
Models and Training
The v2 line includes base (0.5B) and large (1.5B) variants, and legacy v1 models (xsmall, base, large) remain listed. The README reports benchmark results for BEIR, multilingual, Chinese and code search, and describes a three-step training process: GRPO, contrastive learning and preference learning. A technical blog post and a preprint paper describe the method.
Managed API Option
For production use, the same models can be called via the Mixedbread Python client with additional features such as object reranking and instructions. Mixedbread's broader platform adds stores, multimodal search, an MCP server and a CLI.
Community Discussions
Be the first to start a conversation about mxbai-rerank
Share your experience with mxbai-rerank, ask questions, or help others learn from your insights.
Pricing
Open Source (Apache 2.0)
Self-hosted mxbai-rerank models and Python package under the Apache License 2.0; managed API is a separate offering.
- Apache 2.0-licensed reranking models (mxbai-rerank-base-v2, large-v2)
- Install via pip install -U mxbai-rerank
- Self-hosted; managed API is separate and billed by Mixedbread
Capabilities
Key Features
- Reranking models in base (0.5B) and large (1.5B) v2 variants
- 100+ language support
- Long context up to 8k tokens (32k-compatible)
- Code and SQL ranking
- Function call ranking for multi-tool agents
- Instruction support for steering ranking
- Flash Attention 2 support
- Apache 2.0 open source
- Managed API with object reranking
