Implementation:24kchengYe MemoMind JinaMLXReranker
| Knowledge Sources | |
|---|---|
| Domains | Reranking, Apple_Silicon |
| Last Updated | 2026-10-28 00:00 GMT |
Overview
MLX implementation of jina-reranker-v3 for Apple Silicon — enables GPU-accelerated local cross-encoder reranking without cloud dependencies.
Description
The JinaMLXReranker module adapts the official jina-reranker-v3-mlx model for use as a local reranker on Apple Silicon (M-series). Uses the MLX framework with an MLP projector (1024→512→512) for reranking. Added type annotations and `top_n` parameter compared to upstream. License: CC BY-NC 4.0 (commercial usage requires Jina AI contact).
Usage
Use this reranker on Apple Silicon Macs for high-quality local reranking. Loaded as an alternative to the cross-encoder model when MLX is available.
Code Reference
Source Location
- Repository: MemoMind
- File: engine/hindsight_api/engine/jina_mlx_reranker.py
- Lines: L1-144
Signature
class _MLPProjector:
linear1: nn.Linear # 1024 -> 512
linear2: nn.Linear # 512 -> 512
def __call__(self, x): ...
def _load_projector(projector_path: str) -> _MLPProjector: ...
def _format_prompt(query: str, docs: list[str], special_tokens: dict[str, str]) -> str: ...
Import
from hindsight_api.engine.jina_mlx_reranker import JinaMLXReranker
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| query | str | Yes | Search query |
| docs | list[str] | Yes | Candidate documents |
| top_n | int | No | Number of top results to return |
Outputs
| Name | Type | Description |
|---|---|---|
| rerank() returns | list[dict] | Ranked documents with relevance scores |
Usage Examples
Local Reranking on Apple Silicon
from hindsight_api.engine.jina_mlx_reranker import JinaMLXReranker
reranker = JinaMLXReranker(model_path="jinaai/jina-reranker-v3-mlx")
results = reranker.rerank(
query="What is the capital of France?",
docs=["Paris is the capital of France.", "London is in the UK.", "Berlin is in Germany."],
top_n=2,
)
# results = [{"text": "Paris is...", "score": 0.95}, {"text": "London is...", "score": 0.3}]
Related Pages
Implements Principle
- Principle:24kchengYe_MemoMind_MLX_Local_Reranking
- Principle:24kchengYe_MemoMind_Cross_Encoder_Reranking