Skip to page content
SAVRN
Search Plan a project

Open-weight model · Feature extraction

UltraBERT-Embed-150M-ONNX

by Pastel Labs pastel-labs/UltraBERT-Embed-150M-ONNX

UltraBERT-Embed-150M-ONNX is an open-weight model for feature extraction from Pastel Labs, released under Apache License 2.0. Its published files total 911.1 MB.

ONNX export of dmis-lab/UltraBERT-Embed-150M for ONNX Runtime and Transformers.js. All credit for the model goes to dmis-lab. The weights are theirs, under the same Apache-2.0 license. We only converted the format.

Parameters—
Context—
Weights907.6 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By Pastel Labs, published under apache-2.0, revision ad1d5fe2f80f.

ONNX export of dmis-lab/UltraBERT-Embed-150M for ONNX Runtime and Transformers.js. All credit for the model goes to dmis-lab. The weights are theirs, under the same Apache-2.0 license. We only converted the format. Inputs are inputids and attentionmask, with dynamic batch size and sequence length. Output is lasthiddenstate. The sliding-window (128 tokens) and full-attention layers are built from the attention mask inside the graph, so padding and any length work. We ran 20 English texts through the original PyTorch model and through each ONNX file, then compared the sentence embedding (first-token pooling, as in the sentence-transformers config) with cosine similarity. Fifteen texts are…

Read Pastel Labs's full model card

ONNX export of dmis-lab/UltraBERT-Embed-150M for ONNX Runtime and Transformers.js. All credit for the model goes to dmis-lab. The weights are theirs, under the same Apache-2.0 license. We only converted the format.

Files

Precision File Size Min cosine Mean cosine
fp32 onnx/model.onnx 605 MB 1.0000 1.00000
fp16 onnx/model_fp16.onnx 303 MB 0.9999 0.99997

Inputs are input_ids and attention_mask, with dynamic batch size and sequence length. Output is last_hidden_state. The sliding-window (128 tokens) and full-attention layers are built from the attention mask inside the graph, so padding and any length work.

How we checked it

We ran 20 English texts through the original PyTorch model and through each ONNX file, then compared the sentence embedding (first-token pooling, as in the sentence-transformers config) with cosine similarity. Fifteen texts are short (3 to 25 tokens: questions, reviews, code, SQL, news, medical notes). Five are long book excerpts of 2,000 to 8,000 tokens.

Pass bar: cosine of at least 0.99 on every text. fp32 and fp16 pass.

We left out a 4-bit (q4) file. Weight-only 4-bit quantization (ONNX Runtime MatMulNBits, block size 32) gave a minimum cosine of 0.905, below the bar. Asymmetric, HQQ and block-16 variants did not reach 0.99 either.

Transformers.js 3 loaded each file in Node, produced the same token ids as the Python tokenizer, and reproduced the ONNX Runtime vectors (cosine above 0.999). We also ran it in headless Chrome with the WebAssembly backend: fp32 and fp16 reproduced the ONNX Runtime vectors (cosine 1.0000 and 1.0000).

Usage with Transformers.js

import { AutoTokenizer, AutoModel } from '@huggingface/transformers';

const id = 'pastel-labs/UltraBERT-Embed-150M-ONNX';
const tokenizer = await AutoTokenizer.from_pretrained(id);
const model = await AutoModel.from_pretrained(id, { dtype: 'fp16' }); // or 'fp32'

async function embed(text) {
  const { last_hidden_state } = await model(tokenizer(text));
  const v = last_hidden_state.data.slice(0, 768); // first token
  const n = Math.hypot(...v);
  return v.map((x) => x / n);
}

Transformers.js v3 has no ultrabert model type, so it prints "Unknown model class" and falls back to the base class, which works. Pooling is the first token, as in 1_Pooling/config.json. Use AutoModel as above rather than the feature-extraction pipeline, so the pooling is explicit.

Notes

  • fp16 marks the RMSNorm and softmax ops to stay in fp32 to avoid overflow; matrix multiplies run in fp16.
  • Exported with the PyTorch TorchScript exporter, opset 17, from the original modeling_ultrabert.py (eager attention).
  • English only, like the original.

Configuration

Architecture
UltrabertModel
Layers
24
Hidden size
768
Feed-forward size
1,024
Attention heads
6
Key/value heads
6
Head dimension
128
Vocabulary size
49,152
Model type
ultrabert

Identity and Version

Repository
pastel-labs/UltraBERT-Embed-150M-ONNX
Publisher
Pastel Labs
Task
Feature extraction
Modality
Text
Library
transformers.js
Parameters
Not stated by the source
Languages
en
Revision
ad1d5fe2f80f92274849d54261377589f79661a7
First published
2026-10-15
Last updated
2026-10-15

Files and Weights

13 files, 911.1 MB in total. The weights are 2 files totalling 907.6 MB in onnx.

Weights2 files · 907.6 MB
Configuration7 files · 35.5 KB
Tokenizer2 files · 3.5 MB
Documentation1 file · 3.0 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
onnx/model.onnxWeights604.6 MB 2d747633eb4c
onnx/model_fp16.onnxWeights302.9 MB f37a48b58373
1_Pooling/config.jsonConfiguration89 B —
config.jsonConfiguration1.7 KB —
config_sentence_transformers.jsonConfiguration364 B —
configuration_ultrabert.pyConfiguration2.2 KB —
modeling_ultrabert.pyConfiguration30.6 KB —
modules.jsonConfiguration277 B —
sentence_bert_config.jsonConfiguration241 B —
README.mdDocumentation3.0 KB —
.gitattributesRepository1.5 KB —
tokenizer.jsonTokenizer3.5 MB —
tokenizer_config.jsonTokenizer844 B —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
907.6 MB
Download from Pastel Labs

Released by Pastel Labs through its official repository on Hugging Face. Read the license.

Built From

  • Derived from dmis-lab/UltraBERT-Embed-150M
  • Quantized from dmis-lab/UltraBERT-Embed-150M

Memory Requirements

PrecisionWeights in memory
As published907.6 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About UltraBERT-Embed-150M-ONNX

Can I use UltraBERT-Embed-150M-ONNX commercially?

Yes. UltraBERT-Embed-150M-ONNX is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Feature extraction

all-MiniLM-L6-v2

Joshua

https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: You can then use the model to compute embeddings like this: You can convert this Tensor to a nested JavaScript array using.tolist(): Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights apache-2.0 512 tokens transformers.js

Model · Feature extraction

bge-base-en-v1.5

Joshua

https://huggingface.co/BAAI/bge-base-en-v1.5 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: You can then use the model to compute embeddings, as follows: You can also use the model for retrieval. For example: Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights mit 512 tokens transformers.js

For more details please refer to our Github: FlagEmbedding. If you are looking for a model that supports more languages, longer texts, and other retrieval methods, you can try using bge-m3. FlagEmbedding focuses on retrieval-augmented LLMs, consisting of the following projects currently: - 1/30/2024: Release BGE-M3, a new member to BGE model series! M3 stands for Multi-linguality (100+ languages), Multi-granularities (input length up to 8192), Multi-Functionality (unification of dense, lexical, multi-vec/colbert retrieval). It is the first embedding model which supports all three retrieval methods, achieving new SOTA on multi-lingual (MIRACL) and cross-lingual (MKQA) benchmarks. Technical…

Open weights mit 512 tokens sentence-transformers

Model · Feature extraction

wavlm-large

Microsoft

The large model pretrained on 16kHz sampled speech audio. When using the model, make sure that your speech input is also sampled at 16kHz. Note: This model does not have a tokenizer as it was pretrained on audio alone. In order to use this model speech recognition, a tokenizer should be created and the model should be fine-tuned on labeled text data. Check out this blog for more in-detail explanation of how to fine-tune the model. - 60,000 hours of Libri-Light - 10,000 hours of GigaSpeech - 24,000 hours of VoxPopuli Authors: Sanyuan Chen, Chengyi Wang, Zhengyang Chen, Yu Wu, Shujie Liu, Zhuo Chen, Jinyu Li, Naoyuki Kanda, Takuya Yoshioka, Xiong Xiao, Jian Wu, Long Zhou, Shuo Ren, Yanmin…

Open weights transformers

Model · Feature extraction

splade-cocondenser-selfdistil

NAVER

SPLADE model for passage retrieval. For additional details, please visit: This is a SPLADE Sparse Encoder model. It maps sentences & paragraphs to a 30522-dimensional sparse vector space and can be used for semantic search and sparse retrieval. First install the Sentence Transformers library: Then you can load this model and run inference. If you use our checkpoint, please cite our work

Open weights cc-by-nc-sa-4.0 512 tokens sentence-transformers