SAVRN
Search Contact SAVRN

Open-weight model · Fill mask

ModernBERT-base

by Answer.AI answerdotai/ModernBERT-base

ModernBERT is a modernized bidirectional encoder-only Transformer model (BERT-style) pre-trained on 2 trillion tokens of English and code data with a native context length of up to 8,192 tokens.

Parameters150M
Context8,192
Weights3.1 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads4.5M

Runs On

What it takes to serve ModernBERT-base (150M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.3 GB 0.4 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

SAVRN's Notes on ModernBERT-base

Fill mask is the listed task, so treat it as an encoder you train onto a job, retrieval or classification over long documents, not one you talk to. Memory barely enters the hardware decision: 0.3 GB of weights and 0.4 GB needed at 16-bit against the cheapest Index setup, an MI300X with 192 GB at $1.85 an hour on-demand. Size the box for throughput on long inputs, not for the model.

Under Apache 2.0 you can fine-tune it, ship the result commercially and redistribute it, provided the license and copyright notices stay attached and significant changes are stated. Before committing, confirm 8,192 tokens covers your longest inputs, and note the stored precision is float32 and the 3.1 GB repository holds three formats, well beyond the 0.3 GB you load. The page shows no reported evaluations and no Index host price; the paper, arXiv:2412.13663, is the only reference.

Model Card

By Answer.AI, published under apache-2.0, revision 8949b909ec90.

ModernBERT

Table of Contents

  1. Model Summary
  2. Usage
  3. Evaluation
  4. Limitations
  5. Training
  6. License
  7. Citation

Model Summary

ModernBERT is a modernized bidirectional encoder-only Transformer model (BERT-style) pre-trained on 2 trillion tokens of English and code data with a native context length of up to 8,192 tokens. ModernBERT leverages recent architectural improvements such as:

  • Rotary Positional Embeddings (RoPE) for long-context support.
  • Local-Global Alternating Attention for efficiency on long inputs.
  • Unpadding and Flash Attention for efficient inference.

ModernBERT’s native long context length makes it ideal for tasks that require processing long documents, such as retrieval, classification, and semantic search within large corpora. The model was trained on a large corpus of text and code, making it suitable for a wide range of downstream tasks, including code retrieval and hybrid (text + code) semantic search.

It is available in the following sizes:

Read the full model card (899 words)

Configuration

Architecture
ModernBertForMaskedLM
Context length (tokens)
8,192
Layers
22
Hidden size
768
Feed-forward size
1,152
Attention heads
12
Vocabulary size
50,368
Stored precision
float32
Model type
modernbert

Identity and Version

Repository
answerdotai/ModernBERT-base
Publisher
Answer.AI
Task
Fill mask
Modality
Text
Library
transformers
Parameters
150M parameters
Languages
en
Revision
8949b909ec900327062f0ebf497f51aef5e6f0c8
First published
2024-12-11
Last updated
2025-01-15

Files and Weights

16 files, 3.1 GB in total. The weights are 10 files totalling 3.1 GB in bin, onnx, safetensors.

Weights10 files · 3.1 GB
Configuration2 files · 1.9 KB
Tokenizer2 files · 2.2 MB
Documentation1 file · 8.4 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights598.6 MB 340ac08b74ee
onnx/model.onnxWeights599.0 MB 0f6e8bf251fb
onnx/model_bnb4.onnxWeights217.8 MB 7814510559de
onnx/model_fp16.onnxWeights299.7 MB d9e191270aaf
onnx/model_int8.onnxWeights151.1 MB fba16e64c4df
onnx/model_q4.onnxWeights224.8 MB 21d1de44c781
onnx/model_q4f16.onnxWeights140.3 MB 97c0b382317d
onnx/model_quantized.onnxWeights151.1 MB fba16e64c4df
onnx/model_uint8.onnxWeights151.1 MB 755b789bfd7b
pytorch_model.binWeights598.7 MB 9a3b4d34f236
config.jsonConfiguration1.2 KB
special_tokens_map.jsonConfiguration694 B
README.mdDocumentation8.4 KB
.gitattributesRepository1.5 KB
tokenizer.jsonTokenizer2.1 MB
tokenizer_config.jsonTokenizer20.8 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
3.1 GB
Download from Answer.AI

Released by Answer.AI through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published3.1 GB
16-bit0.3 GB
8-bit0.1 GB
4-bit0.1 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Built on This Model

Compare ModernBERT-base

Questions About ModernBERT-base

How much GPU memory does ModernBERT-base need?

About 0.4 GB at 16-bit and 0.1 GB at 4-bit: the weights (150M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run ModernBERT-base on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use ModernBERT-base commercially?

Yes. ModernBERT-base is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is ModernBERT-base's context length?

8,192 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Fill mask

bert-base-arabertv02

AUB MIND LAB

AraBERT is an Arabic pretrained language model based on Google's BERT architechture. AraBERT uses the same BERT-Base config. More details are available in the AraBERT Paper and in the AraBERT Meetup There are two versions of the model, AraBERTv0.1 and AraBERTv1, with the difference being that AraBERTv1 uses pre-segmented text where prefixes and suffixes were split using the Farasa Segmenter. We evaluate AraBERT models on different downstream tasks and compare them to mBERT), and other state of the art models (To the extent of our knowledge). The Tasks were Sentiment Analysis on 6 different datasets (HARD, ASTD-Balanced, ArsenTD-Lev, LABR), Named Entity Recognition with the ANERcorp, and…

Open weights 136M parameters 512 tokens transformers

This model is a distilled version of the BERT base multilingual model. The code for the distillation process can be found here. This model is cased: it does make a difference between english and English. The model is trained on the concatenation of Wikipedia in 104 different languages listed here. The model has 6 layers, 768 dimension and 12 heads, totalizing 134M parameters (compared to 177M parameters for mBERT-base). On average, this model, referred to as DistilmBERT, is twice as fast as mBERT-base. We encourage potential users of this model to check out the BERT base multilingual model card to learn more about usage, limitations and potential biases. You can use the raw model for either…

Open weights apache-2.0 135M parameters 512 tokens transformers

Pretrained model on the top 102 languages with the largest Wikipedia using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is uncased: it does not make a difference between english and English. Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by the Hugging Face team. BERT is a transformers model pretrained on a large corpus of multilingual data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process…

Open weights apache-2.0 168M parameters 512 tokens transformers

Model · Fill mask

roberta-base

Facebook AI community

Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is case-sensitive: it makes a difference between english and English. Disclaimer: The team releasing RoBERTa did not write a model card for this model so this model card has been written by the Hugging Face team. RoBERTa is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels…

Open weights mit 125M parameters 514 tokens transformers

Model · Fill mask

codebert-python

NeuLab @ LTI/CMU

This is a microsoft/codebert-base-mlm model, trained for 1,000,000 steps (with batchsize=32) on Python code from the codeparrot/github-code-clean dataset, on the masked-language-modeling task. It is intended to be used in CodeBERTScore: https://github.com/neulab/code-bert-score, but can be used for any other model or task. If you use this model for research, please cite

Open weights 125M parameters 514 tokens transformers

Pretrained model on the top 104 languages with the largest Wikipedia using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is case sensitive: it makes a difference between english and English. Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by the Hugging Face team. BERT is a transformers model pretrained on a large corpus of multilingual data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to…

Open weights apache-2.0 179M parameters 512 tokens transformers