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

Alibaba (Tongyi Lab) - Open weights - verified

GTE ModernBERT Base embeddings

GTE ModernBERT Base is a current embedding model from Alibaba (Tongyi Lab), with open weights on Hugging Face at Alibaba-NLP/gte-modernbert-base. It returns 768-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 Apache 2.0, and you pay for the compute you run them on.

CurrentModel id: Alibaba-NLP/gte-modernbert-base- weights: Alibaba-NLP/gte-modernbert-base

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

Dimensions

  • 768default

Default output: 768 dimensions.

Pricing

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

Open weights

License
Apache 2.0apache-2.0
Commercial use
Commercial use allowedCommercial use is allowed, per the license.
Parameters
149M (149,014,272)

Worth knowing

English-only 149M ModernBERT embedding model with CLS pooling and an 8192-token input, also servable through Text Embeddings Inference with an OpenAI-compatible route.

Released . Multilingual: no.

Usage

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

Python
# Requires transformers>=4.48.0
from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim

input_texts = [
    "what is the capital of China?",
    "how to implement quick sort in python?",
    "Beijing",
    "sorting algorithms"
]

model = SentenceTransformer("Alibaba-NLP/gte-modernbert-base")
embeddings = model.encode(input_texts)
print(embeddings.shape)
# (4, 768)

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

Source: huggingface.co/Alibaba-NLP/gte-modernbert-base

FAQ

How many dimensions does GTE ModernBERT Base output?

Default output: 768 dimensions.

What is the max input length of GTE ModernBERT Base?

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

Can I use GTE ModernBERT Base commercially?

GTE ModernBERT Base is released under Apache 2.0, and commercial use is allowed. The license text is at https://www.apache.org/licenses/LICENSE-2.0.

What can GTE ModernBERT Base embed?

Text input, per the provider. It is not 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.