Model reference · open weights
mxbai-embed-2d-large is an open-weight embedding model from mixedbread-ai. mxbai-embed-2d-large-v1 (FP16) weighs 670 MB; the smallest configuration that runs it is RTX 3060 12 GB.
Summary of the mixedbread-ai/mxbai-embed-2d-large-v1 model card, 2026-10-01
What it is
| Released by | mixedbread-ai |
|---|---|
| Released | 2024-03-04 |
| Parameters | 335M |
| VRAM | 670 MB for the weights |
What it runs on
| Card | Runs | Memory |
|---|---|---|
| RTX 3060 12 GB | fits | 11.6 GB |
| RTX 4060 Ti 16 GB | fits | 15.4 GB |
| RTX 3090 24 GB | fits | 23.4 GB |
| RTX 4090 24 GB | fits | 23.4 GB |
| RTX 5090 32 GB | fits | 31.0 GB |
| L40S 48 GB | fits | 44.0 GB |
| A100 80 GB | fits | 78.2 GB |
| H100 80 GB | fits | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | fits | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | fits | 107 GB |
| H200 141 GB | fits | 138 GB |
| B200 180 GB | fits | 176 GB |
From the model card
This is our 2DMSE sentence embedding model. It supports the adaptive transformer layer and embedding size. Find out more in our blog post.
TLDR: 2D-🪆 allows you to shrink the model and the embeddings layer. Shrinking only the embeddings model yields competetive results to other models like nomics embeddings model. Shrinking the model to ~50% maintains upto 85% of the performance without further training.
Here, we provide several ways to produce sentence embeddings with adaptive layers and embedding sizes. For this version, it is recommended to set adaptive layers from 20 to 24.
Currently, the best way to use our models is with the most recent version of sentence-transformers.
python -m pip install -U sentence-transformers
from sentence_transformers import models, SentenceTransformer
from sentence_transformers.util import cos_sim
# 1. load model with `cls` pooling
model = SentenceTransformer("mixedbread-ai/mxbai-embed-2d-large-v1")
# 2. set adaptive layer and embedding size.
# it is recommended to set layers from 20 to 24.
new_num_layers = 22 # 1D: set layer size
model[0].auto_model.encoder.layer = model[0].auto_model.encoder.layer[:new_num_layers]
new_embedding_size = 768 # 2D: set embedding size
# 3. encode
embeddings = model.encode(
[
'Who is german and likes bread?',
'Everybody in Germany.'
]
)
# Similarity of the first sentence with the other two
similarities = cos_sim(embeddings[0, :new_embedding_size], embeddings[1, :new_embedding_size])
print('similarities:', similarities)
You can also use the lastest angle-emb for inference, as follows:
python -m pip install -U angle-emb
from angle_emb import AnglE
from sentence_transformers.util import cos_sim
# 1. load model
model = AnglE.from_pretrained("mixedbread-ai/mxbai-embed-2d-large-v1", pooling_strategy='cls').cuda()
# 2. set adaptive layer and embedding size.
# it is recommended to set layers from 20 to 24.
layer_index = 22 # 1d: layer
embedding_size = 768 # 2d: embedding size
# 3. encode
embeddings = model.encode([
'Who is german and likes bread?',
'Everybody in Germany.'
], layer_index=layer_index, embedding_size=embedding_size)
similarities = cos_sim(embeddings[0], embeddings[1:])
print('similarities:', similarities)
If you haven't already, you can install the Transformers.js JavaScript library from NPM using:
npm i @xenova/transformers
You can then use the model to compute embeddings as follows:
import { pipeline, cos_sim } from '@xenova/transformers';
// Create a feature-extraction pipeline
const extractor = await pipeline('feature-extraction', 'mixedbread-ai/mxbai-embed-2d-large-v1', {
quantized: false, // (Optional) remove this line to use the 8-bit quantized model
});
// Compute sentence embeddings (with `cls` pooling)
const sentences = ['Who is german and likes bread?', 'Everybody in Germany.' ];
const output = await extractor(sentences, { pooling: 'cls' });
// Set embedding size and truncate embeddings
const new_embedding_size = 768;
const truncated = output.slice(null, [0, new_embedding_size]);
// Compute cosine similarity
console.log(cos_sim(truncated[0].data, truncated[1].data)); // 0.6979532021425204
You can use the model via our API as follows:
from mixedbread_ai.client import MixedbreadAI
from sklearn.metrics.pairwise import cosine_similarity
import os
mxbai = MixedbreadAI(api_key="{MIXEDBREAD_API_KEY}")
english_sentences = [
'What is the capital of Australia?',
'Canberra is the capital of Australia.'
]
res = mxbai.embeddings(
input=english_sentences,
model="mixedbread-ai/mxbai-embed-2d-large-v1",
dimensions=512,
)
embeddings = [entry.embedding for entry in res.data]
similarities = cosine_similarity([embeddings[0]], [embeddings[1]])
print(similarities)
The API comes with native INT8 and binary quantization support! Check out the docs for more information.
Please find more information in our blog post.
Apache 2.0
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.
Benchmarks
As published on the model card: the maker's own numbers, not measured by AxForge.
| Task | Dataset | Metric | Score |
|---|---|---|---|
| Classification | MTEB AmazonCounterfactualClassification (en) | accuracy | 74.761 |
| Classification | MTEB AmazonCounterfactualClassification (en) | ap | 37.906 |
| Classification | MTEB AmazonCounterfactualClassification (en) | f1 | 68.808 |
| Classification | MTEB AmazonPolarityClassification | accuracy | 93.256 |
| Classification | MTEB AmazonPolarityClassification | ap | 90.069 |
| Classification | MTEB AmazonPolarityClassification | f1 | 93.248 |
| Classification | MTEB AmazonReviewsClassification (en) | accuracy | 46.162 |
| Classification | MTEB AmazonReviewsClassification (en) | f1 | 45.670 |
| Retrieval | MTEB ArguAna | map_at_1 | 37.980 |
| Retrieval | MTEB ArguAna | map_at_10 | 54.918 |
| Retrieval | MTEB ArguAna | map_at_100 | 55.401 |
| Retrieval | MTEB ArguAna | map_at_1000 | 55.403 |
| Retrieval | MTEB ArguAna | map_at_3 | 50.249 |
| Retrieval | MTEB ArguAna | map_at_5 | 53.400 |
| Retrieval | MTEB ArguAna | mrr_at_1 | 38.834 |
| Retrieval | MTEB ArguAna | mrr_at_10 | 55.240 |
| Retrieval | MTEB ArguAna | mrr_at_100 | 55.737 |
| Retrieval | MTEB ArguAna | mrr_at_1000 | 55.738 |
| Retrieval | MTEB ArguAna | mrr_at_3 | 50.581 |
| Retrieval | MTEB ArguAna | mrr_at_5 | 53.710 |
| Retrieval | MTEB ArguAna | ndcg_at_1 | 37.980 |
| Retrieval | MTEB ArguAna | ndcg_at_10 | 63.629 |
| Retrieval | MTEB ArguAna | ndcg_at_100 | 65.567 |
| Retrieval | MTEB ArguAna | ndcg_at_1000 | 65.614 |