1 · Two independent local models
Stage 1 · Nomic Embed Text v1.5 (137.30 MB q8)
Bi-encoder: 64-d Matryoshka filter + 768-d re-score (./worker.js).
Stage 2 · ms-marco-MiniLM-L-6-v2 (23.9 MB q8)
Cross-encoder: raw relevance logit per (query, passage) (./reranker-worker.js).
2 · Query, corpus & funnel shape
Prepare the models above.
3 · The funnel & rank shifts
| Passage | Filter rank (cos) | 768-d rank (cos) | Cross-encoder rank (logit) | Shift 768→CE |
|---|---|---|---|---|
| Run the funnel to fill this table. | ||||
How the funnel works
Matryoshka training means the first 64 coordinates already rank well, so the filter costs N×64 multiply-adds instead of N×768. Only the shortlist is re-scored at 768-d, and only the finalists pay for a cross-encoder forward pass that attends across query and passage tokens jointly.