huggingface/trl
Train transformer language models with reinforcement learning. observed · 2026-08-28
Health v2 · maintenance only
99/100
- Activity 99
- Release rhythm 99
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 11.0
- age_days: 2350
- days_rel: 7
- days_push: 7
- n_releases_24m: 57
Adoption not part of the score
19155 stars · 2933 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
TRL is a Hugging Face library for post-training transformer language models with techniques like Supervised Fine-Tuning (SFT), GRPO, DPO, KTO, reward modeling, and knowledge distillation. It builds on the Transformers ecosystem and scales from single GPUs to multi-node clusters via Accelerate, DeepSpeed, PEFT/LoRA, and vLLM.
Use cases
- fine-tune an LLM with SFT on my own dataset
- train a language model with RLHF or DPO preference optimization
- run GRPO reinforcement learning to improve model reasoning
- post-train a foundation model with LoRA on a single GPU
- distill a teacher LLM into a smaller student model
- train a reward model for preference tuning
- scale LLM fine-tuning across multiple GPUs with DeepSpeed
When to choose
- You want to fine-tune or post-train transformer LLMs within the Hugging Face Transformers ecosystem
- You need modern alignment methods like SFT, DPO, GRPO, or KTO with a consistent trainer API
- You want parameter-efficient training (LoRA/QLoRA) or multi-GPU/multi-node scaling out of the box
When to avoid
- You are training non-transformer models or non-language modalities
- You need a framework-agnostic trainer outside PyTorch/Hugging Face
- You only need inference or serving of models rather than training
Facets
library · maturity active
llm-training machine-learning deep-learning cli large-language-models machine-learning reinforcement-learning artificial-intelligence python windows rlhf sft dpo grpo post-training huggingface transformers fine-tuning peft vllm gpu linux macos
10 sources
- readme: https://github.com/huggingface/trl · fetched 2026-08-28 · 4807cbb081fa
- homepage: http://hf.co/docs/trl · fetched 2026-08-29 · bde8532f3e6d
- site_page: https://huggingface.co/docs · fetched 2026-08-29 · bdec26667b98
- site_page: https://huggingface.co/docs/trl/installation · fetched 2026-08-29 · 6ab19072d32e
- site_page: https://huggingface.co/docs/trl/quickstart · fetched 2026-08-29 · 01a41386510e
- site_page: https://huggingface.co/docs/trl/usage_stats · fetched 2026-08-29 · 539ae35bc43f
- site_page: https://huggingface.co/docs/trl/chat_templates · fetched 2026-08-29 · 97c6c183ad73
- site_page: https://huggingface.co/docs/trl/dataset_formats · fetched 2026-08-29 · b9155d8286b5
- site_page: https://huggingface.co/docs/trl/paper_index · fetched 2026-08-29 · d84fa056581e
- registry_pypi: https://pypi.org/pypi/trl/json · fetched 2026-08-29 · 6e063225592c
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| huggingface/trl | main | 99 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem