rerankers
An open-source Python reranking library provides one interface for local models and hosted APIs, with CPU inference through FlashRank.
rerankers is a Python library for developers building search and retrieval systems. It ranks candidate documents against a query and lets you compare reranking approaches through a shared interface.
- Local document ranking: Use SentenceTransformer or Transformers cross-encoders, InRanker and MonoT5, BGE models based on Gemma and MiniCPM, or ColBERT.
- CPU inference: FlashRank supports local reranking with ONNX models that run on CPUs.
- API backends: Connect to Cohere, Jina, Voyage, MixedBread, Pinecone or Isaacus, which receive queries and candidate documents for ranking, or use a Hugging Face Text Embeddings Inference server.
- LLM and image ranking: RankGPT and RankLLM support document reranking with language models, including GPT models; MonoVLMRanker reranks images with a vision-language model.
- Result metadata: Keep metadata with reranking results so applications can carry source context through retrieval.
Local model backends run inference on your hardware; hosted API backends use the selected external service. The library is open source under Apache 2.0. Its core package has no dependencies, while model backends have their own requirements. It supports inference rather than model training. RankLLM integrations with RankZephyr and RankVicuna are untested.