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
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.
Live Query-Prefix Uplift (raw query vs retrieval prefix)
| Passage | Raw rank | Raw cos | Prefixed rank | Prefixed cos | Score delta |
|---|
Query → Passage Cosine Ranking
- 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.
- Zero-server document search & dedup: embed customer FAQs or runbooks locally with zero API keys or data egress.
- 32× smaller vector indexes: compress 384-d float32 vectors (1,536 B) down to 48 B binary bitsets in IndexedDB or OPFS.
- Two-stage local RAG: retrieve Top-K candidates at ~24 ms, then refine with a compact cross-encoder reranker.
Use-case ladder
-
Basics — Matryoshka & 32× Binary Compression Lab:
slice
384d → 256d → 128d → 64dplusint8and1-bit binaryand measure live MRR, Spearmanρ, and cosine retention. - Practical — Multi-Doc RAG Indexer & Near-Duplicate Detector: sequential cancellable FIFO batch indexing, RFC 4180 CSV/JSON/MD/TXT upload, cosine clustering slider, and OWASP formula-safe exports.
- Wild — 2D PCA Semantic Map, Prefix Ablation & Adversarial Trap Lab: interactive keyboard/click 2D PCA constellation, query-prefix ablation, and 5 stress-test probes.
-
Multi-model — 47.2 MB Retrieve + Rerank Pipeline:
chain
mxbai-embed-xsmall-v1(24.45 MB) withXenova/ms-marco-MiniLM-L-6-v2(22.7 MB) to inspect live Spearmanρand rank-shift badges.
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