#5151st of 53 in Training and fine-tuning

modernbert

Research code for pre-training and evaluating ModernBERT encoder models

Stars
1.8k
License
Apache-2.0
Last commit
Mar 2026
Language
Python
Stars, last 29 weeks+134
21 Apr 2026: 1,647 stars28 Apr 2026: 1,650 stars5 May 2026: 1,652 stars12 May 2026: 1,659 stars19 May 2026: 1,663 stars26 May 2026: 1,665 stars2 Jun 2026: 1,667 stars9 Jun 2026: 1,676 stars16 Jun 2026: 1,681 stars23 Jun 2026: 1,686 stars30 Jun 2026: 1,690 stars7 Jul 2026: 1,690 stars14 Jul 2026: 1,692 stars21 Jul 2026: 1,695 stars28 Jul 2026: 1,697 stars4 Aug 2026: 1,701 stars11 Aug 2026: 1,703 stars18 Aug 2026: 1,706 stars25 Aug 2026: 1,709 stars1 Sept 2026: 1,713 stars8 Sept 2026: 1,716 stars15 Sept 2026: 1,719 stars22 Sept 2026: 1,736 stars29 Sept 2026: 1,750 stars6 Oct 2026: 1,758 stars13 Oct 2026: 1,768 stars20 Oct 2026: 1,773 stars27 Oct 2026: 1,777 stars3 Nov 2026: 1,780 stars10 Nov 2026: 1,781 stars

1,647 on 21 Apr 20261,781 on 10 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

Research repository behind ModernBERT, a BERT-style bidirectional encoder. It provides FlexBERT, a modular set of encoder building blocks configured through YAML, plus pre-training on the Composer framework and GLUE evaluation scripts. Example scripts train dense retrievers with Sentence Transformers and ColBERT models with PyLate.

Who it is for: ML researchers pre-training or evaluating encoder models on their own GPUs

Strengths

  • Full pre-training and GLUE evaluation code, stated to be the code used in the paper
  • YAML-configured FlexBERT blocks with example configs in the yamls folder
  • Example scripts for Sentence Transformers dense retrieval and PyLate ColBERT training
  • Supports Flash Attention 3 on H100 with Flash Attention 2 fallback

Weaknesses

  • README describes itself as barebones and under construction
  • Intermediate checkpoints are listed as release pending
  • Setup needs a GPU machine, conda environment and flash-attn 2.6.3 build or wheel
  • Streaming dataset class distributes memory unevenly across accelerators, per the README

What it needs

  • GPU required
  • Needs conda, composer, flash-attn 2.6.3, Sentence Transformers, PyLate
  • Models: ModernBERT, FlexBERT, BERT (GLUE evals), ColBERT (PyLate)

Quick answers

Is modernbert open source?

Yes. Its code is on GitHub under the Apache-2.0 license.

Does modernbert need a GPU?

Yes, it needs a GPU.

Also in Training and fine-tuning

See all 53
Also in Training and fine-tuning
RankProjectScore
1unslothDesktop and web app to run and fine-tune local models Live demo ↗ (opens in a new tab)79.3k stars+1,694 (+2.2%) in 30 daysApache-2.088 out of 100
2peftPython library for LoRA and other parameter-efficient fine-tuning of Transformers models Live demo ↗ (opens in a new tab)21.9k stars+133 (+0.6%) in 30 daysApache-2.088 out of 100
3deepspeedPyTorch library for distributed training of very large models with ZeRO43.3k stars+166 (+0.4%) in 30 daysApache-2.086 out of 100
#4verlReinforcement learning training library for LLM post-training with PPO and GRPO24.2k stars+391 (+1.6%) in 30 daysApache-2.086 out of 100
#5trlPost-training library with SFT, DPO, GRPO and KTO trainers19.7k stars+247 (+1.3%) in 30 daysApache-2.086 out of 100