22nd of 126 in Training and fine-tuning

trl

Python library for post-training LLMs with SFT, DPO, GRPO and KTO

Run it:Vast.ai ↗ (opens in a new tab)Clore.ai ↗ (opens in a new tab)Affiliate links, no effect on a rank.

Stars
19.9k
License
Apache-2.0
Last commit
Nov 2026
Last release
Nov 2026
Language
Python
Stars, last 35 weeks+2,237
25 Mar 2026: 17,623 stars1 Apr 2026: 17,716 stars8 Apr 2026: 17,822 stars15 Apr 2026: 17,905 stars22 Apr 2026: 17,984 stars29 Apr 2026: 18,054 stars6 May 2026: 18,157 stars13 May 2026: 18,228 stars20 May 2026: 18,286 stars27 May 2026: 18,357 stars3 Jun 2026: 18,412 stars10 Jun 2026: 18,486 stars17 Jun 2026: 18,548 stars24 Jun 2026: 18,596 stars1 Jul 2026: 18,643 stars8 Jul 2026: 18,708 stars15 Jul 2026: 18,770 stars22 Jul 2026: 18,833 stars29 Jul 2026: 18,895 stars5 Aug 2026: 18,947 stars12 Aug 2026: 19,002 stars19 Aug 2026: 19,056 stars26 Aug 2026: 19,111 stars2 Sept 2026: 19,166 stars9 Sept 2026: 19,231 stars16 Sept 2026: 19,303 stars23 Sept 2026: 19,355 stars30 Sept 2026: 19,411 stars7 Oct 2026: 19,461 stars14 Oct 2026: 19,513 stars21 Oct 2026: 19,571 stars28 Oct 2026: 19,635 stars4 Nov 2026: 19,682 stars11 Nov 2026: 19,747 stars18 Nov 2026: 19,794 stars25 Nov 2026: 19,860 stars

17,623 on 25 Mar 202619,860 on 25 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

TRL provides trainer classes (SFTTrainer, GRPOTrainer, AsyncGRPOTrainer, DPOTrainer, KTOTrainer, RewardTrainer) for post-training Hugging Face Transformers models. It builds on Accelerate for DDP, DeepSpeed and FSDP scaling, and on PEFT for LoRA/QLoRA. A `trl` CLI runs SFT, DPO and KTO without writing code.

Who it is for: ML engineers fine-tuning and aligning LLMs with Hugging Face tooling

Strengths

  • Covers SFT, DPO, KTO, GRPO and reward model training behind one trainer API
  • Scales from one GPU to multi-node via Accelerate, DDP, DeepSpeed ZeRO and FSDP
  • PEFT integration allows LoRA/QLoRA training of large models on modest hardware
  • CLI runs sft, dpo and kto jobs from the shell without code

Weaknesses

  • AsyncGRPOTrainer needs a separate vLLM server on a different GPU than the trainer
  • Features under trl.experimental may change or be removed in any release
  • Tied to the Hugging Face Transformers ecosystem and its model formats
  • accuracy_reward needs the extra math-verify install

What it needs

  • GPU optional
  • Docker
  • Needs transformers, accelerate, peft, datasets, vllm (AsyncGRPOTrainer), math-verify (accuracy_reward)
  • Models: Hugging Face Transformers models, LoRA/QLoRA adapters via PEFT

What changed

From the release notes. No flag means the note does not say so, not that the upgrade is safe. Releases and problems by RSS

Head to head

Also in Training and fine-tuning

See all 126
Also in Training and fine-tuning
RankProjectScore
1peftPython library for LoRA and other parameter-efficient fine-tuning methods Live demo ↗ (opens in a new tab)21.9k starsApache-2.091 out of 100
3megatron-lmNVIDIA's library for training large transformer models across many GPUs18.6k starscustom license89 out of 100
#4unslothDesktop and web app to run and fine-tune local models Live demo ↗ (opens in a new tab)80.5k starsApache-2.088 out of 100
#5deepspeedPyTorch library for distributed training of very large models with ZeRO43.4k starsApache-2.088 out of 100
#6axolotlYAML-driven framework for fine-tuning and post-training LLMs Live demo ↗ (opens in a new tab)12.8k stars+123 (+1.0%) in 30 daysApache-2.088 out of 100