Model reference · open weights

modernbert-embed

Embeddings nomic-ai Embeddings 1 build Open weights 243k dl/mo

modernbert-embed is an open-weight embedding model from nomic-ai. modernbert-embed-base (FP32) weighs 298 MB; the smallest configuration that runs it is RTX 3060 12 GB.

  • modernbert-embed is a 149M parameter sentence-similarity model developed by nomic-ai and released under the Apache 2.0 license.
  • It supports English text with a context length of 8192 tokens and utilizes Matryoshka Representation Learning to allow embedding dimensions of 256.

Summary of the nomic-ai/modernbert-embed-base model card, 2026-10-01

What it is

Released bynomic-ai
Released2024-12-29
Parameters149M
VRAM298 MB for the weights

What it runs on

Memory and cards for modernbert-embed-base (FP32)

298 MBweights, file size
1.1 GBruntime overhead
CardRunsMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What nomic-ai says about modernbert-embed

Read the model card

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]])

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]])

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
    )

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

Benchmarks

Reported results

As published on the model card: the maker's own numbers, not measured by AxForge.

TaskDatasetMetricScore
ClassificationMTEB AmazonCounterfactualClassification (en)accuracy78.134
ClassificationMTEB AmazonCounterfactualClassification (en)ap42.190
ClassificationMTEB AmazonCounterfactualClassification (en)f172.344
ClassificationMTEB AmazonPolarityClassificationaccuracy93.094
ClassificationMTEB AmazonPolarityClassificationap90.037
ClassificationMTEB AmazonPolarityClassificationf193.087
ClassificationMTEB AmazonReviewsClassification (en)accuracy48.428
ClassificationMTEB AmazonReviewsClassification (en)f147.743
RetrievalMTEB ArguAnamap_at_123.898
RetrievalMTEB ArguAnamap_at_1039.775
RetrievalMTEB ArguAnamap_at_10040.827
RetrievalMTEB ArguAnamap_at_100040.837
RetrievalMTEB ArguAnamap_at_2040.604
RetrievalMTEB ArguAnamap_at_334.519
RetrievalMTEB ArguAnamap_at_537.307
RetrievalMTEB ArguAnamrr_at_124.395
RetrievalMTEB ArguAnamrr_at_1039.963
RetrievalMTEB ArguAnamrr_at_10041.014
RetrievalMTEB ArguAnamrr_at_100041.024
RetrievalMTEB ArguAnamrr_at_2040.791
RetrievalMTEB ArguAnamrr_at_334.732
RetrievalMTEB ArguAnamrr_at_537.481
RetrievalMTEB ArguAnandcg_at_123.898
RetrievalMTEB ArguAnandcg_at_1048.962
© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms