Home Projects trl
trl
Python

trl

Train transformer language models with reinforcement learning.

by huggingface · GitHub
Stars
Forks
License
Created
Last commit
Language
Apache-2.0Python
View on GitHub
In plain words

TRL is Hugging Face's library for post-training and aligning language models with supervised fine-tuning, DPO and reinforcement learning methods like PPO.

From the README

Install
pip install git+https://github.com/huggingface/trl.git

Excerpts from the project README on GitHub. Copyright and licensing remain with the respective authors.

You maintain this project?

Claim its page: indexed whatever its rank, translated into six languages, and enriched with what you write yourself.

Claim this page →
trl — GitHub preview card
📈 Star history
19.2k18.8k
2026-07-122026-08-31
📈 Track trl

Get an email alert on its next release or when it starts trending — never miss the moment.

Free · no card · unsubscribe anytime
Get email alerts →
📄 About

Train transformer language models with reinforcement learning.

trl has 19.2k stars on GitHub. It has been forked 2.9k times. trl is written mainly in Python. It has been in active development since 2020. trl is available under the Apache-2.0 license.

Read the full guide
Frequently asked questions

What is trl?

Train transformer language models with reinforcement learning.

Is trl open source?

trl is an open-source project. It is released under the Apache-2.0 license.

Is trl free?

Yes. trl is free and open source — you can use, modify and self-host it.

What license does trl use?

trl is available under the Apache-2.0 license.

What language is trl written in?

trl is written mainly in Python.

🏅 Maintainer of this project?
olud.ai badge — trl

Add this live badge to your README — your GitHub stars and directory rank, refreshed daily.

[![olud.ai](https://olud.ai/badge.php?tool=huggingface-trl)](https://olud.ai/project/huggingface-trl.html)
More badge options →
🧬 Related projects