Xenova's BGE-Small Brings Private Semantic Search Directly to JavaScript

An ONNX port of BAAI's 33M-parameter embedding model runs entirely in the browser through Transformers.js, hitting 850K monthly downloads.

·
·
·
Xenova's BGE-Small Brings Private Semantic Search Directly to JavaScriptPRO
Read2 min
TypeModel
SubtopicEmbeddings
  • Xenova/bge-small-en-v1.5 is an ONNX port of BAAI's embedding model for Transformers.js, running fully client-side.
  • 33.4M parameters, 384-dimensional output vectors, 512-token max input, MIT license.
  • Quantized int8/uint8 weights are around 32MB, small enough to ship in a web app.
  • Scores 53.86 on MTEB English v2 retrieval, close to the larger bge-base-en-v1.5.
  • Install via npm i @huggingface/transformers and use the feature-extraction pipeline.
  • Over 850K downloads on Hugging Face, used in browser-based vector DBs and local RAG tools.

The Xenova model page packages BAAI’s compact English embedding model as ONNX assets that Transformers.js can execute in a browser or Node.js. Applications can generate 384-dimensional vectors without calling a hosted embedding API or running a Python inference service, enabling private semantic search while shifting work to the user’s device.

The Hub page reported 757,481 downloads in the prior month and 20 likes, indicating substantial use for a client-side embedding model.

ONNX is the bridge to JavaScript

BAAI’s upstream model card describes a 33.4-million-parameter English model trained for dense retrieval, semantic similarity, clustering, and related tasks. Its v1.5 training produces a more useful spread of similarity scores and reduces dependence on query instructions.

The Xenova repository supplies the tokenizer, configuration, and ONNX weight files in the layout Transformers.js expects. ONNX stores the network as a portable computation graph, while Transformers.js handles tokenization, model loading, pooling, and execution through ONNX Runtime.

Browser inference uses WebAssembly by default. Supported browsers can request WebGPU by passing { device: 'webgpu' } when creating the pipeline. Node.js uses the same high-level API, so one integration can cover browser, Electron, and server-side JavaScript environments.

Thirty-three million parameters, 384 values

Model size determines download time, memory use, and inference latency on client hardware. The full-precision ONNX file is about 127 MB, while the 8-bit variants are roughly 32 to 34 MB before adding the tokenizer and runtime files.

Property Value Practical effect
Parameters 33.4 million Lower compute and memory requirements than base-sized BGE models
Embedding width 384 values About 1.5 KB per vector in

Pro article

This story is for Pro members

You've reached the end of the free preview. Upgrade to AlphaSignal Pro to read the full article - and everything else behind the paywall.

Trending
  • No trending articles

Comments

avatar

Next Reads