torchtune: Fine-Tune and Post-Train Large Language Models

Summary
torchtune is a PyTorch library for configuring and running LLM post-training workflows, from supervised fine-tuning to preference optimization. It is aimed at developers who want editable recipes and model-specific configs, but is no longer actively maintained.
At a glance
- Language
- Python
- License
- BSD-3-Clause
- Stars
- 5.8k
- Forks
- 756
- Added to OSRepos
- July 5, 2026
- Last analyzed
- October 3, 2026
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Overview
torchtune is a Python library for authoring and running post-training workflows for large language models with PyTorch. It packages training recipes, model implementations, and YAML configuration files so developers can adapt fine-tuning and evaluation workflows rather than build them from scratch.
Its recipes cover supervised fine-tuning, knowledge distillation, preference optimization, reinforcement learning, and quantization-aware training. The project is best suited to practitioners comfortable with PyTorch and model-training infrastructure who need control over training code and configurations. The repository says development wound down in 2025, so it may be more appropriate for maintaining or studying existing workflows than for starting a project that depends on ongoing upstream support.
Key Features
- Recipes for supervised fine-tuning, including full fine-tuning and LoRA/QLoRA.
- Workflows for knowledge distillation, DPO, PPO, GRPO, and quantization-aware training.
- PyTorch implementations and configurations for models including Llama, Gemma, Mistral, Phi, and Qwen.
- YAML configs that can be copied, edited, or overridden from the command line.
- Single-device, multi-device, and, for some recipes, multi-node training options.
- Memory and performance techniques such as activation checkpointing, activation offloading, and lower-precision optimizers.
- Integrations with Hugging Face Hub and Datasets, torchao, evaluation tools, and experiment logging services.
Use Cases
- A model-training engineer wants to adapt a supported LLM with supervised fine-tuning and needs a configurable PyTorch recipe.
- An ML researcher wants to experiment with methods such as DPO or knowledge distillation using recipes they can inspect and modify.
- A team wants to fine-tune a model on constrained GPU memory and investigate options such as LoRA, QLoRA, or activation offloading.
- A developer maintaining an existing torchtune workflow needs to reproduce training or adapt its configs and model implementations.
Project Facts
- Language: Python
- License: BSD-3-Clause
- Stars: 5.8k
- Forks: 756
- Topics: []
- Archived: false
Getting Started
Install the package and its PyTorch dependencies:
pip install torch torchvision torchao
pip install torchtune
Then inspect the CLI with tune --help. See the repository README and documentation for setup details and recipes. The project is no longer actively maintained.
Alternatives
- axolotl: Axolotl also configures LLM fine-tuning and post-training, with broader support for LoRA, quantization, multimodal workflows, and distributed training.
- Ludwig: Ludwig supports declarative LLM fine-tuning alongside other ML tasks, using YAML configurations rather than torchtune’s editable PyTorch recipes.
Considerations
- The repository states that development wound down in 2025 and is no longer actively maintained. Plan for limited or no upstream updates and support.
- Training large models generally requires suitable accelerator hardware and model-weight access. Hardware and scaling support vary by recipe.
- The README describes testing against specific stable and nightly PyTorch releases, so check dependency compatibility before adopting it in a new environment.
- BSD-3-Clause covers torchtune itself; third-party model weights may have separate terms of use.
Found this useful?
Share it with someone who would like torchtune.
Comparisons
Source repository
Open the original repository on GitHub.
21 counted GitHub visits
Related repositories
Similar repositories that may be relevant next.

agentevals: Evaluate AI Agents from OpenTelemetry Traces
October 4, 2026
agentevals scores AI agent behavior from existing OpenTelemetry traces, without rerunning agents or making extra model calls. It suits teams building instrumented agents that need local evaluation, golden-set checks, or CI quality gates.

web-design: Create Consistent Web Pages with a Claude Code Skill
October 3, 2026
web-design is a Claude Code skill that turns product briefs, reference URLs, or screenshots into an editable design specification before generating web code. It is suited to developers and designers who want a repeatable, spec-led workflow for building consistent pages.

oomwoo: Build a DIY Robot Vacuum
October 2, 2026
OOMWOO is a planned, hackable robot vacuum built around Raspberry Pi, ROS2 and 2D LiDAR. It is aimed at makers who want to build and customize a locally controlled vacuum, but its hardware and build instructions are still in development.

shepherd: Supervise Agents with Reversible Execution Traces
October 2, 2026
Shepherd records agent work as inspectable, reversible execution traces and keeps changes as proposals for review. It is aimed at developers building systems that supervise, replay, or manage the work of other agents.