Model reference · open weights

mxbai-embed-large

Embeddings mixedbread-ai Embeddings 1 build Open weights 3.1M dl/mo

mxbai-embed-large is an open-weight embedding model from mixedbread-ai. mxbai-embed-large-v1 (FP16) weighs 670 MB; the smallest configuration that runs it is RTX 3060 12 GB.

  • mxbai-embed-large is a 335M parameter feature extraction model developed by mixedbread-ai for generating sentence embeddings.
  • It supports English text with a context length of 512 tokens and is released under the Apache 2.0 license.
  • The model features Matryoshka Representation Learning and binary quantization capabilities to reduce memory usage.

Summary of the mixedbread-ai/mxbai-embed-large-v1 model card, 2026-10-01

What it is

Released bymixedbread-ai
Released2024-03-07
Parameters335M
VRAM670 MB for the weights

What it runs on

Memory and cards for mxbai-embed-large-v1 (FP16)

670 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 mixedbread-ai says about mxbai-embed-large

Read the model card

Here, we provide several ways to produce sentence embeddings. Please note that you have to provide the prompt Represent this sentence for searching relevant passages: for query if you want to use it for retrieval. Besides that you don't need any prompt. Our model also supports Matryoshka Representation Learning and binary quantization.

Quickstart

Here, we provide several ways to produce sentence embeddings. Please note that you have to provide the prompt Represent this sentence for searching relevant passages: for query if you want to use it for retrieval. Besides that you don't need any prompt.

sentence-transformers

python -m pip install -U sentence-transformers
from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim
from sentence_transformers.quantization import quantize_embeddings

# 1. Specify preffered dimensions
dimensions = 512

# 2. load model
model = SentenceTransformer("mixedbread-ai/mxbai-embed-large-v1", truncate_dim=dimensions)

# The prompt used for query retrieval tasks:
# query_prompt = 'Represent this sentence for searching relevant passages: '

query = "A man is eating a piece of bread"
docs = [
    "A man is eating food.",
    "A man is eating pasta.",
    "The girl is carrying a baby.",
    "A man is riding a horse.",
]

# 2. Encode
query_embedding = model.encode(query, prompt_name="query")
# Equivalent Alternatives:
# query_embedding = model.encode(query_prompt + query)
# query_embedding = model.encode(query, prompt=query_prompt)

docs_embeddings = model.encode(docs)

# Optional: Quantize the embeddings
binary_query_embedding = quantize_embeddings(query_embedding, precision="ubinary")
binary_docs_embeddings = quantize_embeddings(docs_embeddings, precision="ubinary")

similarities = cos_sim(query_embedding, docs_embeddings)
print('similarities:', similarities)

Transformers

from typing import Dict

import torch
import numpy as np
from transformers import AutoModel, AutoTokenizer
from sentence_transformers.util import cos_sim

# For retrieval you need to pass this prompt. Please find our more in our blog post.
def transform_query(query: str) -> str:
    """ For retrieval, add the prompt for query (not for documents).
    """
    return f'Represent this sentence for searching relevant passages: {query}'

# The model works really well with cls pooling (default) but also with mean pooling.
def pooling(outputs: torch.Tensor, inputs: Dict,  strategy: str = 'cls') -> np.ndarray:
    if strategy == 'cls':
        outputs = outputs[:, 0]
    elif strategy == 'mean':
        outputs = torch.sum(
            outputs * inputs["attention_mask"][:, :, None], dim=1) / torch.sum(inputs["attention_mask"], dim=1, keepdim=True)
    else:
        raise NotImplementedError
    return outputs.detach().cpu().numpy()

# 1. load model
model_id = 'mixedbread-ai/mxbai-embed-large-v1'
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModel.from_pretrained(model_id).cuda()

docs = [
    transform_query('A man is eating a piece of bread'),
    "A man is eating food.",
    "A man is eating pasta.",
    "The girl is carrying a baby.",
    "A man is riding a horse.",
]

# 2. encode
inputs = tokenizer(docs, padding=True, return_tensors='pt')
for k, v in inputs.items():
    inputs[k] = v.cuda()
outputs = model(**inputs).last_hidden_state
embeddings = pooling(outputs, inputs, 'cls')

similarities = cos_sim(embeddings[0], embeddings[1:])
print('similarities:', similarities)

Transformers.js

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

npm i @huggingface/transformers

You can then use the model to compute embeddings like this:

import { pipeline, cos_sim } from "@huggingface/transformers";

// Create a feature extraction pipeline
const extractor = await pipeline("feature-extraction", "mixedbread-ai/mxbai-embed-large-v1", {
    dtype: "fp32", // Options: "fp32", "fp16", "q8"
});

// Generate sentence embeddings
const docs = [
    "Represent this sentence for searching relevant passages: A man is eating a piece of bread",
    "A man is eating food.",
    "A man is eating pasta.",
    "The girl is carrying a baby.",
    "A man is riding a horse.",
]
const output = await extractor(docs, { pooling: "cls" });

// Compute similarity scores
const [source_embeddings, ...document_embeddings ] = output.tolist();
const similarities = document_embeddings.map(x => cos_sim(source_embeddings, x));
console.log(similarities); // [0.7919578577247139, 0.6369278664248345, 0.16512018371357193, 0.3620778366720027]

Using API

You can use the model via our API as follows:

from mixedbread_ai.client import MixedbreadAI, EncodingFormat
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-large-v1",
     normalized=True,
     encoding_format=[EncodingFormat.FLOAT, EncodingFormat.UBINARY, EncodingFormat.INT_8],
     dimensions=512
)

encoded_embeddings = res.data[0].embedding
print(res.dimensions, encoded_embeddings.ubinary, encoded_embeddings.float_, encoded_embeddings.int_8)

The API comes with native int8 and binary quantization support! Check out the docs for more information.

Infinity

docker run --gpus all -v $PWD/data:/app/.cache -p "7997":"7997" \
michaelf34/infinity:0.0.68 \
v2 --model-id mixedbread-ai/mxbai-embed-large-v1 --revision "main" --dtype float16 --engine torch --port 7997

Evaluation

As of March 2024, our model archives SOTA performance f

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)accuracy75.045
ClassificationMTEB AmazonCounterfactualClassification (en)ap37.736
ClassificationMTEB AmazonCounterfactualClassification (en)f168.927
ClassificationMTEB AmazonPolarityClassificationaccuracy93.840
ClassificationMTEB AmazonPolarityClassificationap90.932
ClassificationMTEB AmazonPolarityClassificationf193.830
ClassificationMTEB AmazonReviewsClassification (en)accuracy49.184
ClassificationMTEB AmazonReviewsClassification (en)f148.742
RetrievalMTEB ArguAnamap_at_141.252
RetrievalMTEB ArguAnamap_at_1057.778
RetrievalMTEB ArguAnamap_at_10058.233
RetrievalMTEB ArguAnamap_at_100058.237
RetrievalMTEB ArguAnamap_at_353.450
RetrievalMTEB ArguAnamap_at_556.376
RetrievalMTEB ArguAnamrr_at_141.679
RetrievalMTEB ArguAnamrr_at_1057.927
RetrievalMTEB ArguAnamrr_at_10058.389
RetrievalMTEB ArguAnamrr_at_100058.392
RetrievalMTEB ArguAnamrr_at_353.651
RetrievalMTEB ArguAnamrr_at_556.521
RetrievalMTEB ArguAnandcg_at_141.252
RetrievalMTEB ArguAnandcg_at_1066.018
RetrievalMTEB ArguAnandcg_at_10067.774
RetrievalMTEB ArguAnandcg_at_100067.844
© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms