Views
No views yet
llama-embedding and llama-tokenize)pip install numpy safetensorsjina-reranker-v3-BF16.gguf - Quantized model weights (BF16, 1.1GB)projector.safetensors - MLP projector weights (3MB)rerank.py - Reranker implementation1from rerank import GGUFReranker
2
3# Initialize reranker
4reranker = GGUFReranker(
5 model_path="jina-reranker-v3-BF16.gguf",
6 projector_path="projector.safetensors",
7 llama_embedding_path="/path/to/llama-embedding"
8)
9
10# Rerank documents
11query = "What is the capital of France?"
12documents = [
13 "Paris is the capital and largest city of France.",
14 "Berlin is the capital of Germany.",
15 "The Eiffel Tower is located in Paris."
16]
17
18results = reranker.rerank(query, documents)
19
20for result in results:
21 print(f"Score: {result['relevance_score']:.4f}, Doc: {result['document'][:50]}...")GGUFReranker.rerank(query, documents, top_n=None, return_embeddings=False, instruction=None)query (str): Search querydocuments (List[str]): Documents to reranktop_n (int, optional): Return only top N resultsreturn_embeddings (bool): Include embeddings in outputinstruction (str, optional): Custom ranking instructionindex, relevance_score, document, and optionally embeddingjina-reranker-v3 useful in your research, please cite the original paper:1@misc{wang2025jinarerankerv3lateinteractiondocument,
2 title={jina-reranker-v3: Last but Not Late Interaction for Document Reranking},
3 author={Feng Wang and Yuqing Li and Han Xiao},
4 year={2025},
5 eprint={2509.25085},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2509.25085},
9}