Installation
Install the latest stable release from PyPI:
pip install trl
Install with optional extras:
# PEFT (LoRA/QLoRA), quantization and Weights & Biases logging
pip install "trl[peft,quantization]"
Install the development version from source to get the newest trainers:
pip install git+https://github.com/huggingface/trl.git
Verify the install
import trl
print(trl.__version__)
Requirements
TRL requires Python 3.9+ and a recent version of transformers, accelerate, and datasets. A CUDA-capable GPU is strongly recommended — you can rent one from the Inferix marketplace if you don't have local hardware.