At a glance
| Upstream model | jinaai/jina-embeddings-v2-small-en (ONNX: Xenova/jina-embeddings-v2-small-en) |
|---|---|
| Task / pipeline | feature-extraction (mean pooling + L2 normalize → [1, 512]; no instruction prefixes) |
| Architecture | JinaBERT (4 layers, 8 heads, hidden 512, GEGLU 2048, ALiBi, 30,528 vocab, 33M params) |
| Context window | 8,192 tokens trained via ALiBi · 4,096 tokens measured safe browser WASM ceiling (6,144/8,192 exceed WASM heap) |
| Quantization & size | q8 (onnx/model_quantized.onnx, 32.77 MB · 32,765,276 B) |
| Backend | WebAssembly (Transformers.js 3.7.5 off-main-thread Web Worker; runs anywhere, no WebGPU required) |
| License | Apache-2.0 |
| Web APIs | WebAssembly, Web Workers, Cache Storage, Blob/File API — all Baseline widely available |
Run it — Live 512-d ALiBi Semantic Pair & Passage Inspector
Query ranking
Unit-normalized cosine similarity against the query vector.
- Embed passages above to see live semantic scores.
Pairwise cosine matrix
Select any cell to inspect exact pairwise cosine similarity.
Embed at least 2 passages to compute the symmetric similarity matrix.
See inside — 512-d vector geometry & distribution
Embed passages above to inspect live 512-d vector bounds, L2 norm, and top active dimensions.
Why it matters
At 32.77 MB, Jina Embeddings v2 Small EN is nearly the size of MiniLM (23 MB) yet replaces fixed 512-token position embeddings with ALiBi linear attention biases. Developers get fast local browser inference without maintaining server-side embedding APIs or chopping moderately long RFCs, contracts, and API specs into 512-token fragments.
- Zero-prefix ergonomics — feed raw queries and documents directly without asymmetric prefixes.
- Long-context recall — keeps tail clauses past token 512 inside the same single-vector pass (up to 4,096 tokens safely in browser WASM).
- Ultra-light hybrid RAG — pair 32.77 MB Jina v2 Small EN retrieval with a 22.7 MB cross-encoder reranker for a 55.5 MB end-to-end local stack.
Use cases
Basics · ALiBi & Scaling
Compare full ALiBi vs 512-token truncation on a 1,200-token doc and benchmark 128→2,048 token latency live.
Practical · KB & Dedup
Upload .csv/.json/.md/.txt files, run cancellable FIFO indexing, search, and cluster near-duplicates.
Wild · Needle & PCA
Sweep a buried needle across 10%–90% document depth and watch full ALiBi vs 512-clip drift on a 2D PCA map.
Multi-model · 55.5 MB RAG
Retrieve long docs with Jina v2 Small EN (32.77 MB) and rerank top hits with MS MARCO MiniLM (22.7 MB).
How the API works
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";
const extractor = await pipeline(
"feature-extraction",
"Xenova/jina-embeddings-v2-small-en",
{ device: "wasm", dtype: "q8" }
);
// Mean pooling + L2 normalize -> [2, 512] unit vectors (no prefixes needed)
const out = await extractor([query, longDocument], {
pooling: "mean",
normalize: true,
});