trl logo

trl

huggingface/trl

Train transformer language models with reinforcement learning

GraphCanon updated Sep 20, 2026 · GitHub synced Sep 20, 2026

58views this month

19k stars3.0k forksLast push Sep 18, 2026 Python Apache-2.0

Decision brief

TRL is a Python library for training transformer language models with reinforcement learning, offering dedicated trainer classes for post-training and PEFT adapters, and supporting distributed training methods.

Good fit when

  • When you need to post-train language models or PEFT adapters on custom datasets with reinforcement learning.
  • If you require support for distributed training methods such as DDP, DeepSpeed ZeRO, and FSDP.

Avoid when

  • If your project does not require reinforcement learning for training transformer models.
  • When you do not need the specific distributed training methods supported by TRL.
Requirements:
TRL requires Python and is built on top of the Hugging Face Transformers library.

Observed Sep 18, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Very active (0d since push)
As of Sep 18, 2026
Provenance
Not a fork · Organization account
As of Sep 18, 2026
Security (OSV)
No lockfile
As of Sep 18, 2026

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Backing

Company context for Hugging Face. Display-only - separate from trust and ranking.

Company
Hugging Face·GitHub org profile·Jul 11, 2026
Employees
160·Wikidata (P1128 employees)·Jul 11, 2026
Funding
$235,000,000 (2023-08)·GraphCanon curated seed (public press)·Jul 11, 2026
Commercial model
OSS + managed cloud·GraphCanon curated seed·Jul 11, 2026

Install

pip install trl
PyPI

How it fits your stack(2)

Typed graph edges - alternatives, integrations, successors, and dependencies. Ranked by relationship type, not raw GitHub stars.

Relationship graph

Optional deeper exploration of typed edges and category neighbours.

Similar tools

Same-category neighbours not already linked as typed edges.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

TRL provides dedicated trainer classes for post-training language models or PEFT adapters on custom datasets, supporting distributed training methods.

Capability facts

CLI
CLI entrypoint

Source: pyproject.toml:[project.scripts] · Sep 18, 2026

Languages
python

Source: github.language+pyproject.toml · Sep 18, 2026

Categories

Graph entities

Tags

README

Quick Start For more flexibility and control over training, TRL provides dedicated trainer classes to post train language models or PEFT adapters on a custom dataset. Each trainer in TRL is a light wrapper around the 🤗 Transformers trainer and natively supports distributed train...

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.