TRL — Transformers Reinforcement Learning
TRL v1.0 (released March 31, 2026) is the canonical post-training library — 75+ methods, 3M downloads/month, a Stability Contract, and a production CLI. It is the standard to teach first because every higher-level tool (Axolotl, Unsloth) either wraps it or competes with it on its terms.
TRL is the substrate. SFTTrainer, DPOTrainer, KTOTrainer, RLOOTrainer, GRPOTrainer, reward modeling, and async RL are all thin wrappers over the HuggingFace Transformers Trainer — same optimizer, same data collator, same distributed story (DDP, DeepSpeed ZeRO, FSDP).
v1.0 turned TRL from an experiment into infrastructure. The Stability Contract means trainer signatures, config keys, and CLI flags are now maintained across releases. Three million monthly downloads means major downstream projects (Axolotl, Unsloth, HuggingFace Jobs) treat it as a build-time dependency.
The CLI is the production path. `trl sft`, `trl dpo`, `trl grpo` run the same trainers as the Python API, from a YAML config, with no training code to write or maintain. This is how most real jobs are launched.
Teach TRL first because everything else is defined relative to it. Axolotl wraps TRL under the hood (config + multi-GPU). Unsloth competes by replacing TRL's kernels for single-GPU speed. Knowing the TRL API is the Rosetta Stone for the entire ecosystem.