TRL documentation
Installation
Getting started
Conceptual Guides
How-to guides
Command Line Interface (CLI)Customizing the TrainingReducing Memory UsageSpeeding Up TrainingUsing Trained Models
Integrations
Examples
Example OverviewCommunity TutorialsSentiment TuningTraining StackLlamaDetoxifying a Language ModelLearning to Use ToolsMulti Adapter RLHF
API
You are viewing v0.15.0 version. A newer version v1.5.1 is available.
Installation
You can install TRL either from PyPI or from source:
PyPI
Install the library with pip or uv:
uv
pip
uv is a fast Rust-based Python package and project manager. Refer to Installation for installation instructions), .
uv pip install trl
Source
You can also install the latest version from source. First clone the repo and then run the installation with pip:
git clone https://github.com/huggingface/trl.git
cd trl/
pip install -e .If you want the development install you can replace the pip install with the following:
pip install -e ".[dev]"