feature-extraction · MRL + 1-bit binary · text · WASM q8 · 24.45 MB

Mixedbread mxbai-embed-xsmall-v1 — 24 MB Edge-Speed 384-d Embedder

Run mixedbread-ai/mxbai-embed-xsmall-v1 (Apache-2.0, 22.7M params, 24.45 MB single-file q8 ONNX) completely inside a Web Worker. Built on all-MiniLM-L6-v2 with AnglE loss + Espresso training, it delivers ~24 ms CPU WASM 384-d vectors, 4096-token position embeddings, Matryoshka truncation, and 32× binary compression.

At a glance

Model card mixedbread-ai/mxbai-embed-xsmall-v1
Pipeline task feature-extraction (pooling: "mean", normalize: true)
Architecture BertModel (MiniLM-L6-v2 AnglE + Espresso, 22.7M params, 6 layers, 12 heads, 384-d)
Context window 4096 max position embeddings (tokenizer_config.json defaults model_max_length: 512)
Quantization & size q8 CPU WASM — 24.45 MB (onnx/model_quantized.onnx, 24,448,010 bytes)
Compression features Matryoshka truncation (384 → 256 → 128 → 64) + 1-bit binary quantization (32× smaller)
License & runtime Apache-2.0 · shared ../../lib/webai.js (WebAssembly + module Web Worker)

Run it — live 384-d semantic workbench

Symmetric by default, prefix optional: Unlike mxbai-embed-large-v1, mxbai-embed-xsmall-v1 publishes empty prompts in config_sentence_transformers.json and works without a mandatory query instruction. Toggle the retrieval prefix below or click Measure prefix uplift to inspect live cosine & margin differences on your exact text.

Tip: drag and drop a file onto this zone or press Ctrl/⌘+V anywhere outside an input to replace the comparison passages.

Query → Passage Cosine Ranking

  1. Waiting for live model inference…

Pairwise Passage Cosine Matrix

Cosine matrix renders after embedding runs.

See inside — 384-d vector sparkline & 16-bin histogram

Inspect the actual L2-normalized 384-d vector emitted by mixedbread-ai/mxbai-embed-xsmall-v1 with Matryoshka boundary markers (64d, 128d, 256d), real countNonFinite() health checks, and top-magnitude coordinates.

Embed texts above to inspect vector coordinates.

Why it matters — edge-speed retrieval in 24.45 MB

At 24.45 MB quantized to 8-bit integer ONNX, mxbai-embed-xsmall-v1 downloads in seconds, runs in ~24 ms per call on CPU WebAssembly without WebGPU, and still beats all-MiniLM-L6-v2 on MTEB retrieval (42.80 vs 41.56 NDCG@10) and long-document benchmarks. Combined with Matryoshka truncation and 1-bit binary quantization, you can ship complete offline search, clustering, and two-stage RAG entirely on the visitor's device.

Use-case ladder

How the API works

import { pipeline } from "@huggingface/transformers";

const extractor = await pipeline(
  "feature-extraction",
  "mixedbread-ai/mxbai-embed-xsmall-v1",
  { device: "wasm", dtype: "q8" },
);

const output = await extractor(
  ["What is sourdough fermentation?", "Mix flour, water, and starter."],
  { pooling: "mean", normalize: true },
);
// output.dims -> [2, 384] L2-normalized float32 embeddings

Show the code

Show the code: worker pipeline load & epoch-safe disposal (worker.js)
Show the code: off-main-thread mean-pooled 384-d extraction & NaN check (worker.js)
Show the code: 16-bin vector summary & non-finite health check (xsmall-core.mjs)

References