Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:24kchengYe MemoMind JinaMLXReranker

From Leeroopedia
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

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment