Skip to main content
Watch: I Built an AI App Without Leaving Databricks

BAAI - Open weights - verified

BGE-M3 embeddings

BGE-M3 is a current embedding model from BAAI, with open weights on Hugging Face at BAAI/bge-m3. It returns 1,024-dimension vectors by default and accepts up to 8,192 input tokens, for text input. There is no API price: the weights download from Hugging Face under MIT, and you pay for the compute you run them on.

CurrentModel id: BAAI/bge-m3- weights: BAAI/bge-m3

Default dims
1,024
Max input
8,192 tok
Price / 1M
Self-hosted
Inputs
Text

Dimensions

  • 1,024default

Default output: 1,024 dimensions.

Pricing

No API price: the weights are on Hugging Face and you run them on your own hardware or host.

Open weights

Hugging Face repo
BAAI/bge-m3
License
MITmit
Commercial use
Commercial use allowedCommercial use is allowed, per the license.
Parameters
Not stated

Worth knowing

One model produces dense, sparse (lexical weight) and multi-vector ColBERT outputs for hybrid retrieval, and queries need no instruction prefix.

Released . Multilingual: yes.

Usage

Copied verbatim from the page linked below. Placeholders such as project ids and API keys are the source's own.

Python
from FlagEmbedding import BGEM3FlagModel

model = BGEM3FlagModel('BAAI/bge-m3',  
                       use_fp16=True) # Setting use_fp16 to True speeds up computation with a slight performance degradation

sentences_1 = ["What is BGE M3?", "Defination of BM25"]
sentences_2 = ["BGE M3 is an embedding model supporting dense retrieval, lexical matching and multi-vector interaction.", 
               "BM25 is a bag-of-words retrieval function that ranks a set of documents based on the query terms appearing in each document"]

embeddings_1 = model.encode(sentences_1, 
                            batch_size=12, 
                            max_length=8192, # If you don't need such a long length, you can set a smaller value to speed up the encoding process.
                            )['dense_vecs']
embeddings_2 = model.encode(sentences_2)['dense_vecs']
similarity = embeddings_1 @ embeddings_2.T

Source: huggingface.co/BAAI/bge-m3

FAQ

How many dimensions does BGE-M3 output?

Default output: 1,024 dimensions.

What is the max input length of BGE-M3?

8,192 tokens per input, per the model card. Longer text has to be chunked before you embed it.

Can I use BGE-M3 commercially?

BGE-M3 is released under MIT, and commercial use is allowed. The license text is at https://huggingface.co/BAAI/bge-m3.

What can BGE-M3 embed?

Text input, per the provider. It is documented as multilingual.

Sources

Last verified from the pages below.

Other open-weight embedding models

Default dimensions and max input tokens for the other models you can run yourself.

All embedding models - Open-weight embedding models

Newsletter

New models, every week

One email per week. New model releases, embedding and retrieval updates and what they mean for what you build.