Views
No views yet
pip install -r requirements.txt1from rerank import MLXReranker
2
3reranker = MLXReranker()
4
5query = "What are the health benefits of green tea?"
6documents = [
7 "Green tea contains antioxidants called catechins that may help reduce inflammation.",
8 "Studies show that drinking green tea regularly can improve brain function.",
9 "Basketball is one of the most popular sports in the United States.",
10]
11
12results = reranker.rerank(query, documents)
13for result in results:
14 print(f"Score: {result['relevance_score']:.4f} {result['document'][:80]}...")document, relevance_score, index, and optionally embedding (shape (512,)).1reranker.rerank(
2 query: str,
3 documents: List[str],
4 top_n: Optional[int] = None,
5 return_embeddings: bool = False,
6)1reranker = MLXReranker(
2 model_path="/path/to/jina-reranker-v3.5-mlx",
3 projector_path="/path/to/jina-reranker-v3.5-mlx/projector.safetensors",
4)jina-reranker-v3.5 useful in your research, please cite the original paper:1@misc{nasika2026jinarerankerv35efficientlistwisereranker,
2 title={jina-reranker-v3.5: An Efficient Listwise Reranker with Hybrid Attention and Self-Distillation},
3 author={Christina Nasika and Feng Wang and Antonis Krasakis and Han Xiao},
4 year={2026},
5 eprint={2607.18152},
6 archivePrefix={arXiv},
7 primaryClass={cs.IR},
8 url={https://arxiv.org/abs/2607.18152},
9}