AI Potluck
Model components / Fine-tuning code

TRL

Hugging Face

TRL (Transformers Reinforcement Learning) post-trains language models through Trainer classes covering supervised fine-tuning, preference optimization (DPO, KTO, ORPO, CPO), online methods (GRPO, RLOO, PPO), reward modeling, and knowledge distillation. Built on Hugging Face Transformers, it scales through Accelerate with DDP, DeepSpeed ZeRO, and FSDP, and integrates PEFT for LoRA and QLoRA training. A trl command-line interface runs the same methods without Python code. Hugging Face maintains it.

The documented trainer taxonomy marks PPO, ORPO, CPO, BCO, online DPO, and the two distillation trainers experimental, so the method list is not uniformly stable API. Verified 2026-08-08 via the TRL documentation index and the repository README.

Openness

5 high confidence
5.0
license
Apache-2.0(OSI)
source
public(huggingface/trl)
governance
Hugging Face
managed-tier
none
core-gated
ungated

Apache-2.0 throughout, an OSI license, with the full source public. There is no proprietary core and no paid managed-training service that withholds features from the published package.

  • https://github.com/huggingface/trl/blob/main/LICENSE recorded 2026-08-08

    Rendered blob of the repository LICENSE. Body carries the full Apache License text: the heading block "Apache License / Version 2.0, January 2004 / http://www.apache.org/licenses/", the section "TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION" with "1. Definitions." following it, and the appendix notice "Copyright 2020-2026 The HuggingFace Team". No added use restriction or field-of-use clause.

  • https://raw.githubusercontent.com/huggingface/trl/main/LICENSE recorded 2026-08-08

    11,355-byte plain-text Apache License Version 2.0 (January 2004), 201 lines, unmodified through section 9 and the appendix, closing with "Copyright 2020-2026 The HuggingFace Team" and the standard "Licensed under the Apache License, Version 2.0" notice. Stable plain-text form of the same file the cited blob URL renders.

  • https://raw.githubusercontent.com/huggingface/trl/main/README.md recorded 2026-08-08

    Installation section gives three routes to the running product from the published repo: "pip install trl", "pip install git+https://github.com/huggingface/trl.git", and "git clone https://github.com/huggingface/trl.git; cd trl/; pip install -e .[dev]". Highlights name SFTTrainer, GRPOTrainer, DPOTrainer and KTOTrainer, Accelerate scaling "from single GPU to multi-node clusters" via DDP and DeepSpeed, and PEFT LoRA/QLoRA. The CLI section shows "trl sft", "trl dpo", "trl kto" invocations. The file offers no paid, premium or enterprise edition and names no feature that the published source cannot build.

  • https://raw.githubusercontent.com/huggingface/trl/main/pyproject.toml recorded 2026-08-08

    [project] declares name = "trl", license = "Apache-2.0", license-files = ["LICENSE"], requires-python = ">=3.10", and [project.scripts] trl = "trl.cli:main" - the CLI entry point ships in the same package. [project.optional-dependencies] lists bco, deepspeed, kernels, liger and further extras, all pulling open packages (scikit-learn, deepspeed, liger-kernel, transformers); there is no commercial, enterprise or premium extra and no reference to a separate closed distribution.

  • https://huggingface.co/docs/trl/index recorded 2026-08-08

    The "Taxonomy" section prints the complete trainer set of the installed library - online: GRPOTrainer, RLOOTrainer, OnlineDPOTrainer, NashMDTrainer, PPOTrainer, XPOTrainer; reward modeling: RewardTrainer, PRMTrainer; offline: SFTTrainer, DPOTrainer, KTOTrainer, BCOTrainer, CPOTrainer, ORPOTrainer; knowledge distillation: GKDTrainer, MiniLLMTrainer. The only per-trainer markers are the legend's own two (vLLM support and experimental); no trainer is marked as belonging to a paid or hosted tier.

  • https://huggingface.co/pricing recorded 2026-08-08

    Hugging Face's paid offering, read for the core-gated question. The plans are PRO ($9/month), Team ($20/month per user) and Enterprise ($50/month per user), plus per-TB Hub storage ($8-18/TB/mo) and hourly Spaces hardware. Every listed benefit is Hub/account scoped - private storage, inference credits, ZeroGPU quota, SSO, audit logs, resource groups. The page does not mention TRL at all (zero occurrences of the string in the body) and gates no TRL trainer or feature behind a plan.

  • https://pypi.org/project/trl/ recorded 2026-08-08

    Package page for trl. "License expression: Apache-2.0" with a link to the SPDX License List; Author: Leandro von Werra; "Requires Python >=3.10"; "Provides Extra: bco, deepspeed, kernels, liger, peft, quality, quantization, scikit, test, vllm, vlm, math" - no commercial or enterprise extra. Confirms the distributed wheel carries the same Apache-2.0 terms as the repository.

Adoption

4 high confidence
4.0

~3.81M PyPI downloads last month; standard library for RLHF/post-training in the HF stack, integrated with Transformers/Accelerate and used across labs and open-model post-training pipelines.

  • https://pypistats.org/packages/trl recorded 2026-08-08

    Package page for trl. "Downloads last day: 139,036 / Downloads last week: 884,630 / Downloads last month: 3,677,381". Header block reads "Latest version: 1.9.2" and "Summary: Train transformer language models with reinforcement learning." 3.68M monthly puts the package in the 1M-10M band, level 4.

  • https://pypistats.org/api/packages/trl/recent recorded 2026-08-08

    Full JSON body: {"data":{"last_day":139036,"last_month":3677381,"last_week":884630},"package":"trl","type":"recent_downloads"}. Machine-readable form of the same figure the HTML page renders, so the band is re-derivable without parsing HTML.

Capability

4 high confidence
4.0

The broadest coverage of post-training methods among the open libraries: SFT, the DPO/IPO/KTO/ORPO preference family, PPO, GRPO and reward modeling. It leans on Hugging Face Accelerate (DeepSpeed, FSDP, BF16 and FP8) for distributed training rather than implementing frontier-scale parallelism itself, which places it one tier below Megatron-LM, the library this category treats as the top of the scale.

  • https://huggingface.co/docs/trl/index recorded 2026-08-08

    The "Taxonomy" section is the feature matrix the band rests on: "Online methods GRPOTrainer / RLOOTrainer / OnlineDPOTrainer / NashMDTrainer / PPOTrainer / XPOTrainer; Reward modeling RewardTrainer / PRMTrainer; Offline methods SFTTrainer / DPOTrainer / KTOTrainer / BCOTrainer / CPOTrainer / ORPOTrainer; Knowledge distillation GKDTrainer / MiniLLMTrainer". The Integrations nav lists DeepSpeed, Harbor, Kernels Hub, Liger Kernel, OpenEnv, OpenReward, PEFT, RapidFire AI, Trackio, Unsloth, vLLM - scale is delegated to integrations rather than a native parallelism engine, which is what keeps this a tier below the Megatron-LM anchor. IPO appears nowhere on the page.

  • https://raw.githubusercontent.com/huggingface/trl/main/README.md recorded 2026-08-08

    Quick Start states "Each trainer in TRL is a light wrapper around the Transformers trainer and natively supports distributed training methods like DDP, DeepSpeed ZeRO, and FSDP", and Highlights state it "Leverages Accelerate to scale from single GPU to multi-node clusters" and that "Full integration with PEFT enables training on large models with modest hardware via quantization and LoRA/QLoRA", plus an Unsloth integration "for accelerating training using optimized kernels". Working SFTTrainer, GRPOTrainer, DPOTrainer, KTOTrainer and RewardTrainer examples follow. No FP8 claim appears in the file.

Verified 2026-08-08