#4040th of 53 in Training and fine-tuning

alignment-handbook

Training scripts and YAML recipes for SFT, DPO and ORPO of LLMs

Stars
5.7k
License
Apache-2.0
Last commit
Sep 2026
Language
Python
Stars, last 29 weeks+163
21 Apr 2026: 5,549 stars28 Apr 2026: 5,565 stars5 May 2026: 5,568 stars12 May 2026: 5,575 stars19 May 2026: 5,580 stars26 May 2026: 5,585 stars2 Jun 2026: 5,586 stars9 Jun 2026: 5,594 stars16 Jun 2026: 5,599 stars23 Jun 2026: 5,604 stars30 Jun 2026: 5,613 stars7 Jul 2026: 5,616 stars14 Jul 2026: 5,626 stars21 Jul 2026: 5,631 stars28 Jul 2026: 5,641 stars4 Aug 2026: 5,645 stars11 Aug 2026: 5,648 stars18 Aug 2026: 5,653 stars25 Aug 2026: 5,660 stars1 Sept 2026: 5,665 stars8 Sept 2026: 5,671 stars15 Sept 2026: 5,674 stars22 Sept 2026: 5,676 stars29 Sept 2026: 5,685 stars6 Oct 2026: 5,688 stars13 Oct 2026: 5,694 stars20 Oct 2026: 5,697 stars27 Oct 2026: 5,701 stars3 Nov 2026: 5,706 stars10 Nov 2026: 5,712 stars

5,549 on 21 Apr 20265,712 on 10 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

Hugging Face's reference repo for post-training language models. It provides scripts for continued pretraining, SFT, DPO and ORPO, plus YAML recipes that reproduce models such as Zephyr 7B, StarChat2, SmolLM2 and SmolLM3. Each script supports full-weight training with DeepSpeed ZeRO-3 or LoRA/QLoRA.

Who it is for: ML engineers fine-tuning and preference-aligning open LLMs on their own GPUs

Strengths

  • One YAML file per training run, so published models can be reproduced
  • Covers continued pretraining, SFT, DPO and ORPO, with full-weight (ZeRO-3) or LoRA/QLoRA
  • Recipes for Zephyr, StarChat2, SmolLM2, SmolLM3 and a Constitutional AI setup
  • Apache-2.0 licensed, maintained by Hugging Face

Weaknesses

  • Pins PyTorch 2.6.0 and flash-attn 2.7.4.post1, so setup is tied to specific CUDA builds
  • Requires Flash Attention 2, which needs a compatible NVIDIA GPU
  • Reference recipes, not a general trainer; guides on DPO and preferences are still in progress
  • No Docker image or release; installed from source with uv

What it needs

  • GPU required
  • Needs PyTorch 2.6.0, Flash Attention 2 (2.7.4.post1), DeepSpeed, Hugging Face Hub account, Git LFS
  • Models: Zephyr 7B, Gemma 7B, Mixtral 8x22B, SmolLM / SmolLM2 / SmolLM3, StarChat2 15B

Quick answers

Is alignment-handbook open source?

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

Does alignment-handbook 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