Back to directory

TRL

A library for post-training foundation language models with reinforcement learning and preference optimization methods, such as supervised fine-tuning, GRPO and DPO, built on top of Hugging Face Transformers.

TRL

TRL is a library for post-training foundation models using methods such as supervised fine-tuning (SFT), Group Relative Policy Optimization (GRPO) and Direct Preference Optimization (DPO). It is built on the Hugging Face Transformers ecosystem and supports a range of model architectures and modalities.

Dedicated trainer classes, including SFTTrainer, GRPOTrainer, DPOTrainer and KTOTrainer, wrap the Transformers trainer and natively support distributed training methods such as DDP, DeepSpeed ZeRO and FSDP, scaling from a single GPU to multi-node clusters through Hugging Face Accelerate. Integration with PEFT enables training large models on modest hardware through quantization and LoRA or QLoRA, and integration with Unsloth accelerates training with optimized kernels.

A command-line interface lets a user fine-tune a model without writing code. TRL installs from PyPI and is written in Python.

More in Models

See all 405
  • mini-AGI

    github.com

    A continual learning language model that trains from scratch on a single 8 GB VRAM GPU, assembling its own architecture and adapting its size to the hardware and data available rather than shipping as a fixed pretrained model.

  • An open-source contrastive-embedding pipeline that maps technical CVE vulnerability descriptions to formal cybersecurity compliance controls in NIST SP 800-53 and CMMC, published with its model generation, fine-tuning and evaluation code.

  • peekaboolean

    github.com

    A small vision-language model, fine-tuned with LoRA on a 500-million-parameter backbone, that answers typed multiple-choice, ordinal-score and yes/no questions about an image with calibrated probabilities, in about 400 milliseconds on a laptop.