aicoolies logo
PyTorch logo
PyTorch logo

torchtune

Meta's official PyTorch library for LLM fine-tuning

open sourceupdated Jul 14, 2026

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.

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

Free and open-source under BSD license

Platforms

Python, PyTorch, Linux (CUDA GPUs recommended)

Categories

Tags

Use Cases

Related Tools

computed discovery: shared active categories · kept separate from editor-verified Alternatives

FiftyOne logo

FiftyOne

Open-source toolkit for curating datasets and evaluating visual AI models

FiftyOne is an open-source Python toolkit from Voxel51 for building high-quality datasets and better computer-vision and multimodal AI models. It pairs a browser-based visualization App with programmatic dataset curation, embeddings, similarity search, and model-evaluation workflows.

freemiumOpen SourceTelemetry
Open Notebook logo

Open Notebook

Private, self-hosted research notebooks with flexible AI models, source chat, and podcasts

Open Notebook is an MIT-licensed, self-hosted alternative to NotebookLM for collecting sources, chatting over research, generating reusable transformations, and producing multi-speaker podcasts. Its Docker stack keeps notebook data under the user's control while supporting 18-plus model providers, including local Ollama and LM Studio workflows.

Open SourceTelemetry
Hugging Face logo

Text Embeddings Inference

Hugging Face's open-source inference server for embeddings, rerankers, and classifiers

Text Embeddings Inference is Hugging Face's Apache-2.0 server for high-throughput embedding, reranking, and sequence-classification models. TEI packages token-based dynamic batching, optimized Transformers kernels, Safetensors loading, OpenAI-compatible embedding endpoints, Prometheus metrics, and configurable OpenTelemetry tracing in deployable CPU and GPU images.

Open Source
Presidio logo

Presidio

Open-source PII detection and anonymization for AI data flows

Presidio is an MIT-licensed privacy framework for identifying and anonymizing personally identifiable information in text, images, and structured data. It can act as a de-identification layer around LLM prompts, logs, RAG corpora, and customer-data workflows.

Open Source
ElevenLabs logo

ElevenLabs

Lifelike AI voice generation, cloning, and voice agents

ElevenLabs is an AI voice platform for text-to-speech, voice cloning, and conversational AI agents, built on models like Multilingual v2 and the low-latency Flash v2.5 and Turbo v2.5. Developers call its API to generate lifelike narration, clone voices from short audio samples, dub content across 30+ languages, add sound effects, and deploy real-time voice agents for customer service, IVR, and interactive apps, with SDKs for Python, JavaScript, and more.

freemium
Deep Lake logo

Deep Lake

AI data runtime for multimodal datasets and vector search

Deep Lake is an open-source AI data runtime from Activeloop for storing, versioning, and querying multimodal data and embeddings. It fits teams building RAG, training, evaluation, or dataset-heavy agent workflows that need a bridge between vector search, structured metadata, and large image, text, audio, or video collections.

Open Source

Used in Stacks

Comparisons

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

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 open source and free to use. Free and open-source under BSD license

Is torchtune open source?

Yes — torchtune is open source.

What are the best torchtune alternatives?

The top editor-verified torchtune alternatives are LLaMA-Factory, Ray.