Key Features
- Multiple trainers: SFTTrainer, GRPOTrainer, DPOTrainer, RewardTrainer, PPOTrainer
- CLI interface: Fine-tune models without writing code
- Scalable: Single GPU to multi-node clusters via Accelerate and DeepSpeed
- PEFT integration: LoRA and QLoRA for efficient training on large models
- Built on Transformers: Full compatibility with Hugging Face ecosystem
FAQ
Q: What is TRL? A: TRL is a Hugging Face library with 17.9K+ stars for post-training LLMs using SFT, DPO, GRPO, and reward modeling. It scales from single GPU to multi-node and includes a no-code CLI. Apache 2.0.
Q: How do I install TRL?
A: Run pip install trl. Use the CLI with trl sft --model_name_or_path <model> --dataset_name <dataset> or the Python API with SFTTrainer/DPOTrainer classes.