Framework
TRL
TRL is an open-source AI framework from Hugging Face, launched in 2020, made for developers.
A library for post-training language models with SFT, DPO, GRPO and other methods.
Main jobs: Fine-tuning. It is open source and free to use. You can use it on your own server, offline on your own machine and in the terminal.
Markdown version of https://godooo.ai/en/framework/trl. Every page on this site has one: add .md to its address.
At a glance
- Type
- Framework
- Made by
- Hugging Face
- Launched
- 2020
- Galaxy
- Models & APIs
- Open source
- Yes · Apache-2.0
- Source code
- github.com/huggingface/trl
- GitHub stars
- 19,377
- How you run it
- Self-host · Runs offline · Terminal
- Made for
- Developers
- Website
- hf.co
- Also known as
- Transformers Reinforcement Learning
What it can do
Fine-tuningmain jobunconfirmed
“TRL is a cutting-edge library designed for post-training foundation models using advanced techniques like Supervised Fine-Tuning (SFT), Group Relative Policy Optimization (GRPO), and Direct Preference Optimization (DPO).”— github.com, 2026-09-24
Model trainingsupportedunconfirmed
“TRL is a full stack library where we provide a set of tools to train transformer language models with methods like Supervised Fine-Tuning (SFT), Group Relative Policy Optimization (GRPO), Direct Preference Optimization (DPO), Reward Modeling, and more.”— huggingface.co, 2026-09-24
unconfirmedproposed by a machine, awaiting calibration
Alternatives
- nanoGPTOpen source, freeAlso does: Fine-tuning, Model training
- Kohya's GUIOpen source, freeAlso does: Fine-tuning, Model training
- LlamaFactoryOpen source, freeAlso does: Fine-tuning, Model training
- UnslothOpen source, freeAlso does: Fine-tuning, Model training
- AxolotlOpen source, freeAlso does: Fine-tuning
- MLXOpen source, freeAlso does: Model training, Fine-tuning
- PEFTOpen source, freeAlso does: Fine-tuning
- Hugging FaceFree plan + paid upgradesAlso does: Fine-tuning, Model training
- ModelScopeOpen source, freeAlso does: Fine-tuning, Model training
- Sentence TransformersOpen source, freeAlso does: Fine-tuning, Model training
- Together AIPaidAlso does: Fine-tuning, Model training
- ModalPaidAlso does: Fine-tuning, Model training
Connections
- Applies
- RLHF
- Built with
- Transformers
Questions
What is TRL?
TRL is an open-source AI framework from Hugging Face, launched in 2020, made for developers. A library for post-training language models with SFT, DPO, GRPO and other methods.
Is TRL free?
Yes. TRL is open source (Apache-2.0) and free to use.
Is TRL open source?
Yes, under the Apache-2.0 license. The source code is at https://github.com/huggingface/trl.
Can TRL run locally?
Yes. TRL can run offline on your own machine. It can also be self-hosted on your own server.
What can TRL do?
Main jobs: Fine-tuning. It can also do: Model training.
Who makes TRL?
TRL is made by Hugging Face.
What are open-source alternatives to TRL?
Open-source ones: nanoGPT, Kohya's GUI, LlamaFactory, Unsloth, Axolotl, MLX, PEFT and ModelScope. Others: Hugging Face, Together AI and Modal.
Sources
- github.com/huggingface/trlchecked 2026-09-24
- huggingface.co/docs/trl/indexchecked 2026-09-24
- hf.co/docs/trl