text-ranking · text · WASM q8 · 38.30 MB

Jina Reranker v1 Turbo EN — 38M 8K-Context ALiBi Cross-Encoder

Distilled 6-layer, 37.8M-parameter JinaBERT cross-encoder with symmetric bidirectional ALiBi and GEGLU feed-forward blocks. Reads each query and candidate passage together across up to 8,192 tokens (distinct from the smaller 4-layer 33M Tiny model) in a compact 38.30 MB q8 WebAssembly download.

At a glance

Model ID jinaai/jina-reranker-v1-turbo-en
Task / pipeline text-ranking via AutoTokenizer + AutoModelForSequenceClassification (num_labels = 1)
Architecture JinaBERT (6 layers, 12 attention heads, hidden 384, GEGLU 1536, ALiBi, 61,056 vocab, 37.8M params)
Context window 8,192 tokens via ALiBi (worker overrides tokenizer_config.json's 512 default to 8,192; verified 128–4,096 tok in CPU WASM)
Quantization & size q8 (onnx/model_quantized.onnx, 38.30 MB · 38,295,104 B)
Backend WebAssembly (shared lib/webai.js Transformers.js 3.7.5 off-main-thread Web Worker; runs anywhere, no WebGPU needed)
License Apache-2.0 (apache-2.0)
Web APIs WebAssembly, Web Workers, Cache Storage, Blob/File API — all Baseline widely available

Run it — Live 8K ALiBi Cross-Encoder Reranking Table

Tip: drag-and-drop a .txt, .md, .csv, or .json file here, or paste text/files with Ctrl/Cmd+V outside inputs.

Passages ranked by Jina Reranker v1 Turbo EN raw cross-encoder logit and calibrated sigmoid
Rank Shift Passage Logit Sigmoid σ(z) Softmax Margin Tokens Lexical
Initialise the model above to score and rerank candidate passages.

See inside — Sigmoid calibration & joint pair tokenization

Every candidate pair is tokenized jointly as <s> query </s></s> passage </s> using RoBERTa-style byte-level BPE (61,056 vocab). Below, each passage's raw unbounded logit z is mapped onto the logistic calibration curve σ(z) = 1 / (1 + e−z) alongside the leading joint pair tokens fed into the 6-layer ALiBi stack.

Logit → Sigmoid σ(z) curve

Joint pair token prefix (pair #1)

Run a query to inspect the live <s> query </s></s> passage token stream.

Why it matters

Two-stage retrieval pairs a fast bi-encoder or keyword retriever with a cross-encoder reranker. At 38.30 MB, jina-reranker-v1-turbo-en brings a 6-layer, 8K-context cross-encoder directly into client-side WebAssembly (~35 ms per short pair on CPU) so sensitive architectural ADRs, clinical notes, and legal clauses stay strictly on-device.

Use-case ladder

Practical

Multi-Query RAG Eval Suite

Upload RFC 4180 CSV/JSON/MD/TXT corpora, run cancellable FIFO eval batches, and measure real MRR@5, nDCG@5, and Top-1 accuracy.

Multi-model

71.1 MB ALiBi Retrieve → Rerank

Chain Jina v2 Small EN (32.77 MB bi-encoder) into Jina Reranker v1 Turbo EN (38.30 MB cross-encoder) with live Spearman ρ.

How the API works

import { AutoTokenizer, AutoModelForSequenceClassification } from "@huggingface/transformers";

const tokenizer = await AutoTokenizer.from_pretrained("jinaai/jina-reranker-v1-turbo-en");
tokenizer.model_max_length = 8192; // override tokenizer_config 512 default for ALiBi 8K
const model = await AutoModelForSequenceClassification.from_pretrained(
  "jinaai/jina-reranker-v1-turbo-en",
  { device: "wasm", dtype: "q8" }
);

const enc = tokenizer(passages.map(() => query), {
  text_pair: passages,
  padding: true,
  truncation: true,
  max_length: 4096
});
const { logits } = await model(enc); // one raw relevance logit per (query, passage) pair

Show the code

Show the code: AutoTokenizer + AutoModelForSequenceClassification 8K ALiBi setup
Show the code: raw logit ranking, sigmoid calibration, softmax share & NaN guard

References