torchtune logo

torchtune

Free

A Native-PyTorch Library for LLM Fine-tuning.

FreeFree tier
Type
Open Source
Company
Meta

About torchtune

torchtune is a PyTorch native library for authoring, post-training, and experimenting with large language models. It provides hackable training recipes for supervised fine-tuning (SFT), knowledge distillation, direct preference optimization (DPO), proximal policy optimization (PPO), group relative policy optimization (GRPO), and quantization-aware training. The library includes simple PyTorch implementations of popular LLMs such as Llama, Gemma, Mistral, Phi, and Qwen, and leverages YAML configs for easy configuration of training, evaluation, quantization, and inference. It is designed for memory efficiency and performance scaling using the latest PyTorch APIs, with support for LoRA/QLoRA, activation offloading, multimodal QLoRA, and multi-node training. Note: As of 2025, torchtune is no longer actively maintained.

Key Features

Hackable training recipes for SFT, DPO, PPO, GRPO, knowledge distillation, and quantization-aware training
PyTorch native implementations of popular LLMs (Llama, Gemma, Mistral, Phi, Qwen)
YAML configs for easy configuration of training, evaluation, quantization, and inference
Supports LoRA, QLoRA, and full fine-tuning
Multi-node training support (added February 2025)
Activation offloading and multimodal QLoRA (v0.4.0)
Memory efficiency and performance scaling using latest PyTorch APIs

Pros & Cons

Pros
  • Open source and free to use
  • Native PyTorch integration with hackable recipes
  • Supports a wide range of post-training methods
  • Includes implementations of many popular LLMs
  • YAML configs simplify experiment setup
  • Memory efficient with support for LoRA/QLoRA and activation offloading
Cons
  • No longer actively maintained (development wound down in 2025)
  • Documentation and community support may decline over time

Best For

Post-training large language models for specific tasksSupervised fine-tuning (SFT) of base modelsKnowledge distillation from larger to smaller modelsReinforcement learning from human feedback (RLHF) using DPO, PPO, or GRPOQuantization-aware training for efficient deploymentExperimenting with LLM alignment techniques

FAQ

What is torchtune?
torchtune is a PyTorch native library for authoring, post-training, and experimenting with large language models.
What models does torchtune support?
It supports popular LLMs like Llama, Gemma, Mistral, Phi, Qwen, and more.
Is torchtune still actively maintained?
No, as of 2025, development has wound down and the library is no longer actively maintained.
What post-training methods are available?
torchtune provides recipes for SFT, knowledge distillation, DPO, PPO, GRPO, and quantization-aware training.
Is torchtune free?
Yes, it is open source and free to use.