Skip to content
aicoolies logo
PyTorch logo

torchtune

Meta's official PyTorch library for LLM fine-tuning

torchtune is Meta's official PyTorch-native library for fine-tuning large language models. It provides composable building blocks for training recipes covering LoRA, QLoRA, full fine-tuning, DPO, and knowledge distillation. Supports Llama, Mistral, Gemma, Qwen, and Phi model families with distributed training across multiple GPUs. Designed as a hackable, dependency-minimal alternative to higher-level frameworks.

About torchtune

torchtune provides a PyTorch-native approach to LLM fine-tuning that prioritizes composability and transparency over abstraction. Rather than hiding training complexity behind a unified interface, torchtune exposes clean building blocks that researchers and engineers can combine, modify, and extend according to their specific requirements. The library ships with battle-tested training recipes for supervised fine-tuning, LoRA and QLoRA parameter-efficient tuning, direct preference optimization, knowledge distillation, and continued pre-training.

As Meta's official fine-tuning library within the PyTorch ecosystem, torchtune maintains first-class support for the Llama model family while extending compatibility to Mistral, Gemma, Qwen, and Phi architectures. The recipes handle distributed training across multiple GPUs using PyTorch's native FSDP and tensor parallelism, memory optimization through activation checkpointing and gradient accumulation, and quantization through integration with torchao. Unlike wrapper frameworks that add layers of abstraction, torchtune's minimal dependency design makes it straightforward to debug training issues and customize behavior at any level of the stack.

The library integrates with the broader PyTorch ecosystem including Hugging Face for model and dataset loading, Weights & Biases and TensorBoard for experiment tracking, and EleutherAI's lm-evaluation-harness for model evaluation. Configuration is handled through YAML files and a CLI that supports recipe execution with override parameters, enabling reproducible experiments without writing boilerplate code. With over 5,700 GitHub stars, torchtune has become the preferred choice for teams that want fine-tuning capabilities without sacrificing visibility into the training process.

Pricing & Platform Specs

Pricing Summary

100% open-source LLM fine-tuning library developed as a native PyTorch ecosystem project under the BSD-3-Clause license ($0). Free for research, commercial, and enterprise applications with zero licensing fees. Runs on local consumer GPUs or distributed multi-node clusters using PyTorch FSDP, LoRA, QLoRA, and memory-efficient recipes without third-party platform lock-in.

full pricing breakdown →

Supported Platforms

Python, PyTorch, Linux (CUDA GPUs recommended)

Explore categories, tags & use cases

Categories

Unified framework for fine-tuning 100+ large language models

LLaMA-Factory is an open-source toolkit providing a unified interface for fine-tuning over 100 LLMs and vision-language models. It supports SFT, RLHF with PPO and DPO, LoRA and QLoRA for memory-efficient training, and continuous pre-training. The LLaMA Board web UI enables no-code configuration, while CLI and YAML workflows serve advanced users. Integrates with Hugging Face, ModelScope, vLLM, and SGLang for model deployment.

Open Source

Distributed AI compute engine for scaling Python and ML workloads

Ray is an open-source distributed computing framework built for scaling AI and Python applications from a laptop to thousands of GPUs. It provides libraries for distributed training, hyperparameter tuning, model serving, reinforcement learning, and data processing under a single unified API. Ray's public site highlights OpenAI and other enterprise users. Maintained by Anyscale with Apache-2.0 open-source licensing.

freemiumOpen Source

Side-by-Side Comparisons

Unsloth logo
Unsloth
vs
PyTorch logo
torchtune

Unsloth vs torchtune — Single-GPU Speed vs PyTorch-Native Control

Unsloth and torchtune both help teams fine-tune open models, but they optimize for different operators. Unsloth is the faster default for lean teams that want local training, lower VRAM pressure, and a growing Studio workflow around open models. torchtune is more useful when a PyTorch team wants transparent recipes and framework-native control, but its public repo now carries a maintenance wind-down notice that should shape new adoption decisions.

Unslothtorchtune

Community experience

Sources & verification

Sources checked
Content verified

Verification dates are editorial checks. Routine CMS saves and automatic updatedAt timestamps do not advance them.

FAQ

What is torchtune?

torchtune is Meta's official PyTorch-native library for fine-tuning large language models. It provides composable building blocks for training recipes covering LoRA, QLoRA, full fine-tuning, DPO, and knowledge distillation. Supports Llama, Mistral, Gemma, Qwen, and Phi model families with distributed training across multiple GPUs. Designed as a hackable, dependency-minimal alternative to higher-level frameworks.

Is torchtune free?

Yes — torchtune is free to use. 100% open-source LLM fine-tuning library developed as a native PyTorch ecosystem project under the BSD-3-Clause license ($0). Free for research, commercial, and enterprise applications with zero licensing fees. Runs on local consumer GPUs or distributed multi-node clusters using PyTorch FSDP, LoRA, QLoRA, and memory-efficient recipes without third-party platform lock-in.

Is torchtune open source?

Yes — torchtune is open source.

Is torchtune still maintained?

Yes — torchtune is active. Its listing was last verified on September 6, 2026.

What are the best torchtune alternatives?

The first editor-selected torchtune alternatives are LLaMA-Factory, Ray.