feature-extraction · text · WASM q8 · 32.77 MB

Jina Embeddings v2 Small EN — 33M ALiBi Long-Context Embedder

Ultra-compact 33M-parameter JinaBERT with ALiBi (Attention with Linear Biases) and symmetric GEGLU blocks. Drops learned positional embeddings completely so a single 32.77 MB q8 WebAssembly download turns long passages into 512-dimensional unit vectors in ~10–35 ms with zero task prefixes.

At a glance

Upstream model jinaai/jina-embeddings-v2-small-en (ONNX: Xenova/jina-embeddings-v2-small-en)
Task / pipelinefeature-extraction (mean pooling + L2 normalize → [1, 512]; no instruction prefixes)
ArchitectureJinaBERT (4 layers, 8 heads, hidden 512, GEGLU 2048, ALiBi, 30,528 vocab, 33M params)
Context window8,192 tokens trained via ALiBi · 4,096 tokens measured safe browser WASM ceiling (6,144/8,192 exceed WASM heap)
Quantization & sizeq8 (onnx/model_quantized.onnx, 32.77 MB · 32,765,276 B)
BackendWebAssembly (Transformers.js 3.7.5 off-main-thread Web Worker; runs anywhere, no WebGPU required)
LicenseApache-2.0
Web APIsWebAssembly, 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.

  1. 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.

Use cases

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,
});
Show the code: off-main-thread Jina v2 Small EN embed() worker pass
Show the code: 512-d vector summary, NaN verification, and histogram binning

References