# huggingface/alignment-handbook

Robust recipes to align language models with human and AI preferences

Repository: https://github.com/huggingface/alignment-handbook
Canonical: https://ross.abutalabs.com/products/alignment-handbook
Homepage: https://huggingface.co/HuggingFaceH4
Language: Python
License: Apache-2.0
License Family: permissive
Topics: llm, rlhf, transformers
Last push: 2026-05-26T10:32:37+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 84, release rhythm 35, longevity 78
- inputs: {"age_days": 1104, "days_push": 99, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5671, forks 490 (observed 2026-08-28T04:09:27.677547+00:00)

## What it is
A collection of robust training recipes and scripts from Hugging Face for aligning large language models with human and AI preferences, covering SFT, DPO, ORPO, and RLHF pipelines. It includes reproducible recipes behind models like Zephyr and SmolLM, along with associated datasets and evaluation guidance.

## Use cases
- fine-tune an LLM with DPO
- run supervised fine-tuning on a chat dataset
- align a model with human preferences using RLHF
- reproduce the Zephyr training recipe
- train a small instruct model like SmolLM
- compare preference alignment methods like DPO vs KTO vs IPO

## When to choose
- you want battle-tested, reproducible recipes for LLM post-training
- you're using the Hugging Face Transformers/TRL ecosystem
- you need proven recipes for SFT plus preference alignment (DPO, ORPO, RLHF)

## When to avoid
- you only need inference or serving of LLMs
- you want a general-purpose training framework rather than opinionated recipes
- you're training non-language models

## Facets
- artifact type: library
- maturity: active
- function: llm-training, machine-learning, deep-learning
- domain: large-language-models, machine-learning, deep-learning, artificial-intelligence
- platform: python
- tags: rlhf, dpo, sft, orpo, fine-tuning, transformers, recipes, zephyr, gpu, linux

## Member repositories
- huggingface/alignment-handbook (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:27.677547+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:54:17.389377+00:00, confidence not recorded.
  - readme: https://github.com/huggingface/alignment-handbook (fetched 2026-08-28T04:09:27.677547+00:00, sha 67d9bd237b57)
  - homepage: https://huggingface.co/HuggingFaceH4 (fetched 2026-08-29T08:49:32.818712+00:00, sha 112fe2e162c0)
  - site_page: https://huggingface.co/docs (fetched 2026-08-29T08:49:32.828239+00:00, sha bdec26667b98)
  - site_page: https://huggingface.co/docs/hub/organizations-cards (fetched 2026-08-29T08:49:32.832070+00:00, sha 635040b5f704)
  - registry_pypi: https://pypi.org/pypi/alignment-handbook/json (fetched 2026-08-29T08:49:32.835359+00:00, sha d802541aa449)
  - site_page: https://huggingface.co/pricing (fetched 2026-08-29T08:49:32.830089+00:00, sha de6b7a178be5)
  - site_page: https://huggingface.co/huggingface (fetched 2026-08-29T08:49:32.833721+00:00, sha 5ade86515c8a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
