100% in your browser

Live reranking demo

Paste a query and candidate passages. A cross-encoder scores every pair; a bi-encoder proxy (token overlap) shows why independent embeddings mis-order. Compare two models, share a link, or enable WebGPU for faster inference.

See the effect before you download anything

This example needs no model — the left column is the real output of the token-overlap heuristic used elsewhere on this page. The interactive demo below scores your own text with an actual cross-encoder.

Query: “How do I add a reranking step to my RAG pipeline?”

Before — bi-encoder proxy (token overlap)
1
0.0500
Cohere Rerank, Jina Reranker and bge-reranker are common hosted or open options for the reranking stage.
2
0.0400
To wire a cross-encoder into RAG: retrieve 50–100 candidates with vector search, rerank them with a cross-encoder, then keep only the top 5 for the prompt.
3
0.0000
A reranker takes the query and each retrieved chunk together and outputs a precise relevance score, so you can reorder the top-k before sending them to the LLM.
4
0.0000
Bi-encoders embed the query and documents separately, which is fast for first-stage retrieval but weaker at fine-grained ranking.
5
0.0000
Picking a chunk size of 200–400 tokens with some overlap usually retrieves better than indexing whole documents.
6
0.0000
London is the capital of the United Kingdom and one of the most populous cities in Europe.
After — what a reranker fixes
1
Direct answer
To wire a cross-encoder into RAG: retrieve 50–100 candidates with vector search, rerank them with a cross-encoder, then keep only the top 5 for the prompt.
2
Supporting
A reranker takes the query and each retrieved chunk together and outputs a precise relevance score, so you can reorder the top-k before sending them to the LLM.
3
Supporting
Cohere Rerank, Jina Reranker and bge-reranker are common hosted or open options for the reranking stage.
4
Related
Picking a chunk size of 200–400 tokens with some overlap usually retrieves better than indexing whole documents.
5
Related
Bi-encoders embed the query and documents separately, which is fast for first-stage retrieval but weaker at fine-grained ranking.
6
Off-topic
London is the capital of the United Kingdom and one of the most populous cities in Europe.

The left column runs live in your browser right now — zero downloads, deterministic token-overlap math, the same code the interactive demo uses for its middle column. The right column is the order a working cross-encoder is expected to produce for this query, checked by reading rather than captured from a model run on this page; load the model below to see its own scores on this exact example.

Load a real model (33 MB) and try your own text ↓

Privacy & cost: everything here runs locally with transformers.js on ONNX Runtime Web. Your query and passages never leave the browser, there’s no API key, and there’s no per-call cost — which is exactly why this page can be free and abuse-proof.

How this demo works

The model is a cross-encoder: instead of embedding the query and each passage separately, it feeds the pair (query, passage) through the network together and outputs a single relevance score. The middle column shows a bi-encoder proxy (token overlap only) so you can see why cosine-style retrieval often mis-orders before reranking.

  1. Your query is paired with every candidate passage.
  2. Each pair is tokenised and run through the cross-encoder.
  3. The output logit is squashed to a 0–1 relevance score.
  4. Passages are sorted by score; compare against the bi-encoder proxy column.

That’s the same operation you’d run as the second stage of a RAG pipeline — only here it happens in a browser tab instead of behind an API.

Tips: use Enter in the query field to run, Ctrl+Enter in the passages box, Esc to clear. Copy the share link to send your exact query to a colleague. Enable model comparison to see how jina-tiny and mxbai-xsmall disagree on edge cases.

Read: what is a reranker? →