alt.freeweights.embed / gte-modernbert-base
From: Alibaba-NLP <huggingface.co/Alibaba-NLP>Newsgroups: alt.freeweights.embedSubject:

gte-modernbert-base

Date: 2026-11-14Commit: e7f32e3Signed: 2DC28CC7B26A283B ✓

Sentence similarity model with 149M parameters. Onnx and safetensors weights, 2.53 GB in all. Published by Alibaba-NLP under Apache-2.0.

149M params2.53GBgte-modernbert-baseonnx safetensorspermissive
FactsParams149MSize2.53 GBFormatsonnx, safetensorsTasksentence similarityLicenseApache-2.0From sourcepermissive
$ fw get Alibaba-NLP/gte-modernbert-base
# manifest sha256 4888eecc10ed… · 2.53 GB · 19 files
$ fw verify ./gte-modernbert-base Alibaba-NLP/gte-modernbert-base
From sourceHosted (signed)Alibaba-NLP/gte-modernbert-baseLast check: 2026-11-14 21:07 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Fine-tune of ModernBERT-base.

Works with

Evaluate with

Overview

Size
2.53 GB
Weights
298 MB (safetensors)
Parameters
149M
Formats
onnx, safetensors
Task
sentence similarity
License
Apache-2.0 (permissive)
Files
19, each with a sha256
Publisher
Alibaba-NLP
Added
2026-11-14
Section
alt.freeweights.embed
Lineage

Original release from the publisher.

Base model: answerdotai/ModernBERT-base

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-14 21:07 UTCpassed

Model card

From the publisher at commit e7f32e3. Shown as plain text with links; images open at the publisher.

gte-modernbert-base#

We are excited to introduce the gte-modernbert series of models, which are built upon the latest modernBERT pre-trained encoder-only foundation models. The gte-modernbert series models include both text embedding models and rerank models.

The gte-modernbert models demonstrates competitive performance in several text embedding and text retrieval evaluation tasks when compared to similar-scale models from the current open-source community. This includes assessments such as MTEB, LoCO, and COIR evaluation.

Model Overview#

  • Developed by: Tongyi Lab, Alibaba Group
  • Model Type: Text Embedding
  • Primary Language: English
  • Model Size: 149M
  • Max Input Length: 8192 tokens
  • Output Dimension: 768
Model list#
ModelsLanguageModel TypeModel SizeMax Seq. LengthDimensionMTEB-enBEIRLoCoCoIR
gte-modernbert-baseEnglishtext embedding149M819276864.3855.3387.5779.31
gte-reranker-modernbert-baseEnglishtext reranker149M8192--56.1990.6879.99

Usage#

Tip. For transformers and sentence-transformers, if your GPU supports it, the efficient Flash Attention 2 will be used automatically if you have flash_attn installed. It is not mandatory.

pip install flash_attn

Use with transformers

# Requires transformers>=4.48.0

import torch.nn.functional as F
from transformers import AutoModel, AutoTokenizer

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

model_path = "Alibaba-NLP/gte-modernbert-base"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModel.from_pretrained(model_path)

# Tokenize the input texts
batch_dict = tokenizer(input_texts, max_length=8192, padding=True, truncation=True, return_tensors='pt')

outputs = model(**batch_dict)
embeddings = outputs.last_hidden_state[:, 0]
 
# (Optionally) normalize embeddings
embeddings = F.normalize(embeddings, p=2, dim=1)
scores = (embeddings[:1] @ embeddings[1:].T) * 100
print(scores.tolist())
# [[42.89073944091797, 71.30911254882812, 33.664554595947266]]

Use with sentence-transformers:

# 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:])
print(similarities)
# tensor([[0.4289, 0.7131, 0.3366]])

Use with transformers.js:

// npm i @huggingface/transformers
import { pipeline, matmul } from "@huggingface/transformers";

// Create a feature extraction pipeline
const extractor = await pipeline(
  "feature-extraction",
  "Alibaba-NLP/gte-modernbert-base",
  { dtype: "fp32" }, // Supported options: "fp32", "fp16", "q8", "q4", "q4f16"
);

// Embed queries and documents
const embeddings = await extractor(
  [
    "what is the capital of China?",
    "how to implement quick sort in python?",
    "Beijing",
    "sorting algorithms",
  ],
  { pooling: "cls", normalize: true },
);

// Compute similarity scores
const similarities = (await matmul(embeddings.slice([0, 1]), embeddings.slice([1, null]).transpose(1, 0))).mul(100);
console.log(similarities.tolist()); // [[42.89077377319336, 71.30916595458984, 33.66455841064453]]

Additionally, you can also deploy Alibaba-NLP/gte-modernbert-base with Text Embeddings Inference (TEI) as follows:

  • CPU
docker run --platform linux/amd64 \
  -p 8080:80 \
  -v $PWD/data:/data \
  --pull always \
  ghcr.io/huggingface/text-embeddings-inference:cpu-1.7 \
  --model-id Alibaba-NLP/gte-modernbert-base
  • GPU
docker run --gpus all \
  -p 8080:80 \
  -v $PWD/data:/data \
  --pull always \
  ghcr.io/huggingface/text-embeddings-inference:1.7 \
  --model-id Alibaba-NLP/gte-modernbert-base

Then you can send requests to the deployed API via the OpenAI-compatible v1/embeddings route (more information about the OpenAI Embeddings API):

curl https://0.0.0.0:8080/v1/embeddings \
  -H "Content-Type: application/json" \
  -d '{
    "input": [
      "what is the capital of China?",
      "how to implement quick sort in python?",
      "Beijing",
      "sorting algorithms"
    ],
    "model": "Alibaba-NLP/gte-modernbert-base",
    "encoding_format": "float"
  }'

Training Details#

The gte-modernbert series of models follows the training scheme of the previous GTE models, with the only difference being that the pre-training language model base has been replaced from GTE-MLM to ModernBert. For more training details, please refer to our paper: mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrieval

Evaluation#

MTEB#

The results of other models are retrieved from MTEB leaderboard. Given that all models in the gte-modernbert series have a size of less than 1B parameters, we focused exclusively on the results of models under 1B from the MTEB leaderboard.

Model NameParam Size (M)DimensionSequence LengthAverage (56)Class. (12)Clust. (11)Pair Class. (3)Reran. (4)Retr. (15)STS (10)Summ. (1)
mxbai-embed-large-v1335102451264.6875.6446.7187.260.1154.398532.71
multilingual-e5-large-instruct560102451464.4177.5647.186.1958.5852.4784.7830.39
bge-large-en-v1.5335102451264.2375.9746.0887.1260.0354.2983.1131.61
gte-base-en-v1.5137768819264.1177.1746.8285.3357.6654.0981.9731.17
bge-base-en-v1.510976851263.5575.5345.7786.5558.8653.2582.431.07
gte-large-en-v1.54091024819265.3977.7547.9584.6358.5057.9181.4330.91
modernbert-embed-base149768819262.6274.3144.9883.9656.4252.8981.7831.39
nomic-embed-text-v1.5768819262.2873.5543.9384.6155.7853.0181.9430.4
gte-multilingual-base305768819261.470.8944.3184.2457.4751.0882.1130.58
jina-embeddings-v35721024819265.5182.5845.2184.0158.1353.8885.8129.71
gte-modernbert-base149768819264.3876.9946.4785.9359.2455.3381.5730.68
LoCo (Long Document Retrieval)(NDCG@10)#
Model NameDimensionSequence LengthAverage (5)QsmsumRetrievalSummScreenRetrievalQasperAbastractRetrievalQasperTitleRetrievalGovReportRetrieval
gte-qwen1.5-7b40963276887.5749.3793.1099.6797.5498.21
gte-large-v1.51024819286.7144.5592.6199.8297.8198.74
gte-base-v1.5768819287.4449.9191.7899.8297.1398.58
gte-modernbert-base768819288.8854.4593.0099.8298.0398.70
gte-reranker-modernbert-base-819290.6870.8694.0699.7399.1189.67
COIR (Code Retrieval Task)(NDCG@10)#
Model NameDimensionSequence LengthAverage(20)CodeSearchNet-ccr-goCodeSearchNet-ccr-javaCodeSearchNet-ccr-javascriptCodeSearchNet-ccr-phpCodeSearchNet-ccr-pythonCodeSearchNet-ccr-rubyCodeSearchNet-goCodeSearchNet-javaCodeSearchNet-javascriptCodeSearchNet-phpCodeSearchNet-pythonCodeSearchNet-rubyappscodefeedback-mtcodefeedback-stcodetrans-contestcodetrans-dlcosqastackoverflow-qasynthetic-text2sql
gte-modernbert-base768819279.3194.1593.5794.2791.5193.9390.6388.3283.2776.0585.1288.1677.5957.5482.3485.9571.8935.4643.4791.261.87
gte-reranker-modernbert-base-819279.9996.4396.8898.3291.8197.791.9688.8179.7176.2789.3998.3784.1147.5783.3788.9149.6636.3644.3789.5864.21
BEIR(NDCG@10)#
Model NameDimensionSequence LengthAverage(15)ArguAnaClimateFEVERCQADupstackAndroidRetrievalDBPediaFEVERFiQA2018HotpotQAMSMARCONFCorpusNQQuoraRetrievalSCIDOCSSciFactTouche2020TRECCOVID
gte-modernbert-base768819255.3372.6837.7442.6341.7991.0348.8169.4740.936.4457.6288.5521.2977.421.6881.95
gte-reranker-modernbert-base-819256.7369.0337.7944.6847.2394.5449.8178.1645.3830.6964.5787.7720.6073.5727.3679.89

Hiring#

We have open positions for Research Interns and Full-Time Researchers to join our team at Tongyi Lab. We are seeking passionate individuals with expertise in representation learning, LLM-driven information retrieval, Retrieval-Augmented Generation (RAG), and agent-based systems. Our team is located in the vibrant cities of Beijing and Hangzhou. If you are driven by curiosity and eager to make a meaningful impact through your work, we would love to hear from you. Please submit your resume along with a brief introduction to dingkun.ldk@alibaba-inc.com.

Citation#

If you find our paper or models helpful, feel free to give us a cite.

@inproceedings{zhang2024mgte,
  title={mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrieval},
  author={Zhang, Xin and Zhang, Yanzhao and Long, Dingkun and Xie, Wen and Dai, Ziqi and Tang, Jialong and Lin, Huan and Yang, Baosong and Xie, Pengjun and Huang, Fei and others},
  booktitle={Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: Industry Track},
  pages={1393--1412},
  year={2024}
}

@article{li2023towards,
  title={Towards general text embeddings with multi-stage contrastive learning},
  author={Li, Zehan and Zhang, Xin and Zhang, Yanzhao and Long, Dingkun and Xie, Pengjun and Zhang, Meishan},
  journal={arXiv preprint arXiv:2308.03281},
  year={2023}
}

Files

19 files · 2.53 GBWeights 298 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 19 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
1_Pooling/config.json297 B4bf279dd9204db673304cab6e7db8448f427412a0d87f04c3e19f1de55dd98cd
README.md14.0 KB97d40aa325f0e6eaddf77edc7187b7bba6fd3e31a555be3b5766f015c6c27550
config.json1.18 KB8ba54dc3d35d7194f5178a4194b649f146753e02dabd22bdca5c5cbac15069ed
config_sentence_transformers.json205 Bf6bbc7812d09c4ae1cba610fbdad3aea0ca9b3b8affe5a130d31709bdbc94e99
model.safetensors298 MB3e85899d5728cb7de79781c0c3acfb91ccef9f875f1f7e0b3c9f3dd4b6a724ba
modules.json229 B8f4b264b80206c830bebbdcae377e137925650a433b689343a63bdc9b3145460
onnx/model.onnx596 MB947f31df7effaeec4edb57c50e4ed7e0f2034d9336063f92615b92e3e0d24d78
onnx/model_bnb4.onnx217 MBc78d4d5844bce41d2c7297c9f58205962fb9f1dd361b7ca84fdc8f7ef85f478d
onnx/model_fp16.onnx298 MB4e4d6c757d5f8c2c6147cf07b8900e9250cbbc1db3dcf961516dfa5b2b562ae5
onnx/model_int8.onnx150 MBbae96b276d342bf86eeee07c1bdbc0c75bb82bf4033941aab7fabc1e33ee3b44
onnx/model_q4.onnx224 MB5d1278a1ba749c06b82f9a2f65c2c1c5765d36f2eb88b4888de62ff12b0724a2
onnx/model_q4f16.onnx140 MBd91bf57590f030b9a3441a1024419026d5b74abc1dc15691efe88e301a8063d7
onnx/model_quantized.onnx150 MBbae96b276d342bf86eeee07c1bdbc0c75bb82bf4033941aab7fabc1e33ee3b44
onnx/model_uint8.onnx150 MB1c35c226d1ab27591d4cec0feb94d9f181ed7e4a11c76834b035802bd8eb0bfa
pytorch_model.bin298 MBdc59a5ad66327b309471bd8c42b59a937ebc66cb37679c3e39a6cdef58388d45
special_tokens_map.json694 Bea97ecdbcc73713039d8d64dbb05e3689495c96657fbd9a18f5bed381be81049
tokenizer.json3.58 MB6c8aaa9a542084f2457eab775d4eeb51f92a70c0fd9de28d5edb0ddec3c08d30
tokenizer_config.json20.9 KB9654072f7c873161814043cf08cb5ed72f71d0b935abcd4e267935cb34352c21
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
e7f32e3c00 pinned now manifest updated, same commit2026-11-14 21:07 UTC19 files · 2.53 GB
e7f32e3c002026-11-14 21:07 UTC19 files · 2.53 GB

Use it

$ fw get Alibaba-NLP/gte-modernbert-base
# manifest sha256 4888eecc10ed… · 2.53 GB · 19 files
$ fw verify ./gte-modernbert-base Alibaba-NLP/gte-modernbert-base
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/Alibaba-NLP/gte-modernbert-base.json --dir ./gte-modernbert-base $ python3 fw.py verify ./gte-modernbert-base ./Alibaba-NLP__gte-modernbert-base.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download Alibaba-NLP/gte-modernbert-base --revision e7f32e3c00f91d699e8c43b53106206bcc72bb22 --local-dir ./gte-modernbert-base
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("Alibaba-NLP/gte-modernbert-base", revision="e7f32e3c00f91d699e8c43b53106206bcc72bb22") model = AutoModel.from_pretrained("Alibaba-NLP/gte-modernbert-base", revision="e7f32e3c00f91d699e8c43b53106206bcc72bb22", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("Alibaba-NLP/gte-modernbert-base", revision="e7f32e3c00f91d699e8c43b53106206bcc72bb22") vectors = model.encode(["Hello"])

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-14
Text in
README.md
Text sha256
97d40aa325f0e6eaddf77edc7187b7bba6fd3e31a555be3b5766f015c6c27550
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: Alibaba-NLP <huggingface.co/Alibaba-NLP>Newsgroups: alt.freeweights.embedSubject: gte-modernbert-baseDate: 2026-11-14Commit: e7f32e3Signed: 2DC28CC7B26A283B ✓
Upstream
Alibaba-NLP/gte-modernbert-base
Pinned commit
e7f32e3c00f91d699e8c43b53106206bcc72bb22
Manifest
gte-modernbert-base.json · .minisig
Manifest sha256
4888eecc10edc1b13edacc33e6ed86195f7c04917f1a0b84a666e109ae5b4fbe
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:07 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/Alibaba-NLP/gte-modernbert-base.json $ curl -O https://freeweights.allternit.com/manifests/Alibaba-NLP/gte-modernbert-base.json.minisig $ minisign -Vm gte-modernbert-base.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

answerdotai/ModernBERT-base · this model is a finetune of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download Alibaba-NLP/gte-modernbert-base
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. gte-modernbert-base.json. Provenance. Takedown history: none.
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-MiniLM-L6-v1
From: unsloth <huggingface.co/unsloth>Subject: all-MiniLM-L6-v2
From: mlx-community <huggingface.co/mlx-community>Subject: all-MiniLM-L6-v2-4bit
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-mpnet-base-v1
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: allenai-specter
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: bert-base-nli-max-tokens