alt.freeweights.embed / modernbert-embed-base
From: nomic-ai <huggingface.co/nomic-ai>Newsgroups: alt.freeweights.embedSubject:

modernbert-embed-base

Date: 2026-11-14Commit: d556a88Signed: 2DC28CC7B26A283B ✓

Sentence similarity model with 149M parameters. Onnx and safetensors weights, 2.53 GB in all. Published by nomic-ai under Apache-2.0.

149M params2.53GBmodernbert-embed-baseonnx safetensorspermissive
FactsParams149MSize2.53 GBFormatsonnx, safetensorsTasksentence similarityLicenseApache-2.0From sourcepermissive
$ fw get nomic-ai/modernbert-embed-base
# manifest sha256 6475528f662f… · 2.53 GB · 20 files
$ fw verify ./modernbert-embed-base nomic-ai/modernbert-embed-base
From sourceHosted (signed)nomic-ai/modernbert-embed-baseLast check: 2026-11-14 21:10 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Fine-tune of ModernBERT-base.

Works with

Evaluate with

Overview

Size
2.53 GB
Weights
596 MB (safetensors)
Parameters
149M
Formats
onnx, safetensors
Task
sentence similarity
License
Apache-2.0 (permissive)
Files
20, each with a sha256
Publisher
nomic-ai
Added
2026-11-14
Section
alt.freeweights.embed
Lineage

Original release from the publisher.

Base model: answerdotai/ModernBERT-base

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-14 21:10 UTCpassed

Model card

From the publisher at commit d556a88. Shown as plain text with links; images open at the publisher.

ModernBERT Embed#

image/png

ModernBERT Embed is an embedding model trained from ModernBERT-base, bringing the new advances of ModernBERT to embeddings!

Trained on the Nomic Embed weakly-supervised and supervised datasets, modernbert-embed also supports Matryoshka Representation Learning dimensions of 256, reducing memory by 3x with minimal performance loss.

Performance#

ModelDimensionsAverage (56)Classification (12)Clustering (11)Pair Classification (3)Reranking (4)Retrieval (15)STS (10)Summarization (1)
nomic-embed-text-v176862.474.143.985.255.752.882.130.1
nomic-embed-text-v1.576862.2873.5543.9384.6155.7853.0181.9430.4
modernbert-embed-base76862.6274.3144.9883.9656.4252.8981.7831.39
nomic-embed-text-v1.525661.0472.143.1684.0955.1850.8181.3430.05
modernbert-embed-base25661.1772.4043.8283.4555.6950.6281.1231.27

Usage#

You can use these models directly with the latest transformers release and requires installing transformers>=4.48.0:

pip install transformers>=4.48.0

Reminder, this model is trained similarly to Nomic Embed and REQUIRES prefixes to be added to the input. For more information, see the instructions in Nomic Embed.

Most use cases, adding search_query: to the query and search_document: to the documents will be sufficient.

Sentence Transformers#
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("nomic-ai/modernbert-embed-base")

query_embeddings = model.encode([
    "search_query: What is TSNE?",
    "search_query: Who is Laurens van der Maaten?",
])
doc_embeddings = model.encode([
    "search_document: TSNE is a dimensionality reduction algorithm created by Laurens van Der Maaten",
])
print(query_embeddings.shape, doc_embeddings.shape)
# (2, 768) (1, 768)

similarities = model.similarity(query_embeddings, doc_embeddings)
print(similarities)
# tensor([[0.7214],
#         [0.3260]])

Click to see Sentence Transformers usage with Matryoshka Truncation

In Sentence Transformers, you can truncate embeddings to a smaller dimension by using the truncate_dim parameter when loading the SentenceTransformer model.

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("nomic-ai/modernbert-embed-base", truncate_dim=256)

query_embeddings = model.encode([
    "search_query: What is TSNE?",
    "search_query: Who is Laurens van der Maaten?",
])
doc_embeddings = model.encode([
    "search_document: TSNE is a dimensionality reduction algorithm created by Laurens van Der Maaten",
])
print(query_embeddings.shape, doc_embeddings.shape)
# (2, 256) (1, 256)

similarities = model.similarity(query_embeddings, doc_embeddings)
print(similarities)
# tensor([[0.7759],
#         [0.3419]])

Note the small differences compared to the full 768-dimensional similarities.

Transformers#
import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, AutoModel


def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0]
    input_mask_expanded = (
        attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    )
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(
        input_mask_expanded.sum(1), min=1e-9
    )


queries = ["search_query: What is TSNE?", "search_query: Who is Laurens van der Maaten?"]
documents = ["search_document: TSNE is a dimensionality reduction algorithm created by Laurens van Der Maaten"]

tokenizer = AutoTokenizer.from_pretrained("nomic-ai/modernbert-embed-base")
model = AutoModel.from_pretrained("nomic-ai/modernbert-embed-base")

encoded_queries = tokenizer(queries, padding=True, truncation=True, return_tensors="pt")
encoded_documents = tokenizer(documents, padding=True, truncation=True, return_tensors="pt")

with torch.no_grad():
    queries_outputs = model(**encoded_queries)
    documents_outputs = model(**encoded_documents)

query_embeddings = mean_pooling(queries_outputs, encoded_queries["attention_mask"])
query_embeddings = F.normalize(query_embeddings, p=2, dim=1)
doc_embeddings = mean_pooling(documents_outputs, encoded_documents["attention_mask"])
doc_embeddings = F.normalize(doc_embeddings, p=2, dim=1)
print(query_embeddings.shape, doc_embeddings.shape)
# torch.Size([2, 768]) torch.Size([1, 768])

similarities = query_embeddings @ doc_embeddings.T
print(similarities)
# tensor([[0.7214],
#         [0.3260]])

Click to see Transformers usage with Matryoshka Truncation

In transformers, you can truncate embeddings to a smaller dimension by slicing the mean pooled embeddings, prior to normalization.

import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, AutoModel


def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0]
    input_mask_expanded = (
        attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    )
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(
        input_mask_expanded.sum(1), min=1e-9
    )


queries = ["search_query: What is TSNE?", "search_query: Who is Laurens van der Maaten?"]
documents = ["search_document: TSNE is a dimensionality reduction algorithm created by Laurens van Der Maaten"]

tokenizer = AutoTokenizer.from_pretrained(".")
model = AutoModel.from_pretrained(".")
truncate_dim = 256

encoded_queries = tokenizer(queries, padding=True, truncation=True, return_tensors="pt")
encoded_documents = tokenizer(documents, padding=True, truncation=True, return_tensors="pt")

with torch.no_grad():
    queries_outputs = model(**encoded_queries)
    documents_outputs = model(**encoded_documents)

query_embeddings = mean_pooling(queries_outputs, encoded_queries["attention_mask"])
query_embeddings = query_embeddings[:, :truncate_dim]
query_embeddings = F.normalize(query_embeddings, p=2, dim=1)
doc_embeddings = mean_pooling(documents_outputs, encoded_documents["attention_mask"])
doc_embeddings = doc_embeddings[:, :truncate_dim]
doc_embeddings = F.normalize(doc_embeddings, p=2, dim=1)
print(query_embeddings.shape, doc_embeddings.shape)
# torch.Size([2, 256]) torch.Size([1, 256])

similarities = query_embeddings @ doc_embeddings.T
print(similarities)
# tensor([[0.7759],
#         [0.3419]])

Note the small differences compared to the full 768-dimensional similarities.

Transformers.js#

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

Then, you can compute embeddings as follows:

import { pipeline, matmul } from '@huggingface/transformers';

// Create a feature extraction pipeline
const extractor = await pipeline(
  "feature-extraction",
  "nomic-ai/modernbert-embed-base",
  { dtype: "fp32" }, // Supported options: "fp32", "fp16", "q8", "q4", "q4f16"
);

// Embed queries and documents
const query_embeddings = await extractor([
    "search_query: What is TSNE?",
    "search_query: Who is Laurens van der Maaten?",
  ], { pooling: "mean", normalize: true },
);
const doc_embeddings = await extractor([
    "search_document: TSNE is a dimensionality reduction algorithm created by Laurens van Der Maaten",
  ], { pooling: "mean", normalize: true },
);

// Compute similarity scores
const similarities = await matmul(query_embeddings, doc_embeddings.transpose(1, 0));
console.log(similarities.tolist()); // [[0.721383273601532], [0.3259955644607544]]

Training#

Click the Nomic Atlas map below to visualize a 5M sample of our contrastive pretraining data!

image/webp

We train our embedder using a multi-stage training pipeline. Starting from a long-context BERT model, the first unsupervised contrastive stage trains on a dataset generated from weakly related text pairs, such as question-answer pairs from forums like StackExchange and Quora, title-body pairs from Amazon reviews, and summarizations from news articles.

In the second finetuning stage, higher quality labeled datasets such as search queries and answers from web searches are leveraged. Data curation and hard-example mining is crucial in this stage.

For more details, see the Nomic Embed Technical Report and corresponding blog post.

Training data to train the models is released in its entirety. For more details, see the contrastors repository

Join the Nomic Community#

Citation#

If you find the model, dataset, or training code useful, please cite our work

@misc{nussbaum2024nomic,
      title={Nomic Embed: Training a Reproducible Long Context Text Embedder}, 
      author={Zach Nussbaum and John X. Morris and Brandon Duderstadt and Andriy Mulyar},
      year={2024},
      eprint={2402.01613},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Files

20 files · 2.53 GBWeights 596 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 20 files with their sha256
FileSizesha256
.gitattributes1.57 KBab80eb6c02ff8abd36a0351580b274bf14c4cc7d1bb9376a4e940da1f934af74
1_Pooling/config.json296 B1c8bc7bd750c5c20d8707f1c5c578f5d69bb3d1d5ebcf4b2fde5128de154ec1c
README.md445 KBc3f3cf74b304397141dfb4c2dcf649d3c5d2a5e4003232c3fe80d50b3ee6ca98
config.json1.26 KBdea4708ed1a6df7306b483037750464a96e77ccb0c7e88f4f61a0116944a71dd
config_sentence_transformers.json210 B4d3adefab0a4c1eccd38fac58b37c240573a6008087ba33b9e7c674940067588
model.safetensors596 MB69f22ccd1ee0971b6173678c4fcadd29a49a3f5b6b8a6927002418abe4bd5b9c
modernbertembed.png1.28 MBc97e3ae9104ae231d4f728dc6bdb70eb1f56c46a8bd4c7baf43bf882955607af
modules.json349 B84e40c8e006c9b1d6c122e02cba9b02458120b5fb0c87b746c41e0207cf642cf
onnx/model.onnx596 MB3b9dbe455b29fa24f50e7aa7c3ae923b0ad08ea87530cf2fe8e28ebc57a6ddc7
onnx/model_bnb4.onnx217 MBbd69b54788065a8bf8c2b6cc848f0c7be565f9fe75045002c6e372a736378c9a
onnx/model_fp16.onnx298 MBcfcf639f80f56463565c7d9e6d5536de5171c6216588c7e4781d36401bff4365
onnx/model_int8.onnx150 MB11b1bd3398254d66a4539883965ea81eafe76e14a66d734421f63cb9211f890a
onnx/model_q4.onnx224 MB298304d65e0b8d5c92be2ae0f3ce84bd8ee15b2040f1077e2dbba07970f28ea7
onnx/model_q4f16.onnx140 MB7815c0a1add70215c42d25f4abf53076a8df80eae57c2cf66b6295a8bafc4938
onnx/model_quantized.onnx150 MB11b1bd3398254d66a4539883965ea81eafe76e14a66d734421f63cb9211f890a
onnx/model_uint8.onnx150 MBc47e02acaf51e3232a146311de10266e4d1782097a4700f6d028a52e0045d6d8
sentence_bert_config.json54 Beb9b44b13c0f52a3b3685c3b1cbdea1ba8b04bea123b98f61610048940776eb1
special_tokens_map.json694 Bea97ecdbcc73713039d8d64dbb05e3689495c96657fbd9a18f5bed381be81049
tokenizer.json3.58 MB6c8aaa9a542084f2457eab775d4eeb51f92a70c0fd9de28d5edb0ddec3c08d30
tokenizer_config.json20.8 KB2966a59b9e9cf122279aec1249e22e5bc7ad8430c754e95031b13fd128d4e560
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
d556a88e33 pinned now manifest updated, same commit2026-11-14 21:10 UTC20 files · 2.53 GB
d556a88e332026-11-14 21:10 UTC20 files · 2.53 GB

Use it

$ fw get nomic-ai/modernbert-embed-base
# manifest sha256 6475528f662f… · 2.53 GB · 20 files
$ fw verify ./modernbert-embed-base nomic-ai/modernbert-embed-base
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/nomic-ai/modernbert-embed-base.json --dir ./modernbert-embed-base $ python3 fw.py verify ./modernbert-embed-base ./nomic-ai__modernbert-embed-base.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download nomic-ai/modernbert-embed-base --revision d556a88e332558790b210f7bdbe87da2fa94a8d8 --local-dir ./modernbert-embed-base
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("nomic-ai/modernbert-embed-base", revision="d556a88e332558790b210f7bdbe87da2fa94a8d8") model = AutoModel.from_pretrained("nomic-ai/modernbert-embed-base", revision="d556a88e332558790b210f7bdbe87da2fa94a8d8", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("nomic-ai/modernbert-embed-base", revision="d556a88e332558790b210f7bdbe87da2fa94a8d8") vectors = model.encode(["Hello"])

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-14
Text in
README.md
Text sha256
c3f3cf74b304397141dfb4c2dcf649d3c5d2a5e4003232c3fe80d50b3ee6ca98
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: nomic-ai <huggingface.co/nomic-ai>Newsgroups: alt.freeweights.embedSubject: modernbert-embed-baseDate: 2026-11-14Commit: d556a88Signed: 2DC28CC7B26A283B ✓
Upstream
nomic-ai/modernbert-embed-base
Pinned commit
d556a88e332558790b210f7bdbe87da2fa94a8d8
Manifest
modernbert-embed-base.json · .minisig
Manifest sha256
6475528f662fa4949b50d59eeb581d88b69f274e9a28b384eb580cb45c8ec12a
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:10 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/nomic-ai/modernbert-embed-base.json $ curl -O https://freeweights.allternit.com/manifests/nomic-ai/modernbert-embed-base.json.minisig $ minisign -Vm modernbert-embed-base.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

answerdotai/ModernBERT-base · this model is a finetune of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download nomic-ai/modernbert-embed-base
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. modernbert-embed-base.json. Provenance. Takedown history: none.
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-MiniLM-L6-v1
From: unsloth <huggingface.co/unsloth>Subject: all-MiniLM-L6-v2
From: mlx-community <huggingface.co/mlx-community>Subject: all-MiniLM-L6-v2-4bit
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-mpnet-base-v1
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: allenai-specter
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: bert-base-nli-max-tokens