--- id: torchtune version: "0.6.1" license: BSD 3-Clause License Copyright 2024 Meta Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1.… (full text in the JSON record) license_treatment: permissive maintenance: active --- # torchtune — A native-PyTorch library for LLM fine-tuning License: permissive · Maintenance: active · Downloads: 329.0K/mo ## What it is and what it does torchtune is a native-PyTorch library that provides end-to-end support for fine-tuning and post-training large language models. It bundles PyTorch implementations of popular models (Llama, Gemma, Mistral, Phi, Qwen) with YAML-configurable training recipes covering the full post-training lifecycle: supervised fine-tuning, knowledge distillation, reinforcement learning methods (DPO, PPO, GRPO), and quantization-aware training. It supports single-device, multi-device, and multi-node training with various weight-update strategies including full fine-tuning and LoRA/QLoRA. The library targets researchers and practitioners who need to adapt pre-trained models to specific tasks or domains. It abstracts away low-level PyTorch complexity while exposing configuration through YAML, allowing users to experiment with different training methods and model sizes without rewriting training loops. Dependencies include data-loading libraries (torchdata, datasets, huggingface_hub), tokenizers (sentencepiece, tiktoken, tokenizers), and utility packages (omegaconf, psutil, Pillow) to support model loading, preprocessing, and monitoring. Use it for: - Fine-tune models on custom datasets using LoRA to reduce memory requirements on a single GPU. - Perform knowledge distillation to compress a large teacher model into a smaller student model using LoRA on distributed hardware. - Apply DPO to align model outputs with human preferences using multi-device training. - Run quantization-aware training on distributed nodes to produce efficient inference-ready models. - Experiment with different post-training methods via config swaps without rewriting training code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. torchtune is a PyTorch library for fine-tuning, post-training, and experimenting with large language models using recipes for SFT, knowledge distillation, DPO, PPO, GRPO, and quantization-aware training. Yes. torchtune is actively maintained (latest release April 2025), has no known vulnerabilities, low install friction, and a permissive BSD license. It is purpose-built for LLM fine-tuning with broad recipe coverage and model support. Install if you need to fine-tune or post-train language models; skip if you only need inference or work exclusively with models outside its supported set. ## Install pip install torchtune uv add torchtune poetry add torchtune ## Installing torchtune Before you install: Low install friction; pure Python wheel with 14 runtime dependencies including PyTorch ecosystem packages and tokenization libraries. Active maintenance with latest release in April 2025 and 5797 GitHub stars. License in practice: BSD 3-Clause permissive license allows commercial and private use with attribution and liability disclaimer; no restrictions on derivative works or redistribution. Quickstart: pip install torchtune from torchtune.models.llama3_2 import llama3_2 # Configure and run a training recipe via CLI: # tune run lora_finetune_single_device --config llama3_2/3B_lora_single_device Requires Python >=3.9 and PyTorch with CUDA support for GPU training; model weights must be downloaded from huggingface_hub or kagglehub. Verify before relying: - Whether all 14 runtime dependencies are required for basic usage or if subsets suffice for specific recipes. - Specific hardware requirements or CUDA version constraints not documented in the fact sheet. - Production-readiness and performance characteristics of multi-node training beyond the February 2025 announcement. ## Package facts - License: BSD 3-Clause License Copyright 2024 Meta Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1.… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 329.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags llm fine-tuning pytorch, language model post-training, lora qat dpo training, supervised finetuning recipes, rlhf dpo ppo training, quantization aware training, model adaptation tuning, llm-training, model-finetuning, pytorch-native [View on SkillFed](https://skillfed.io/packages/torchtune) · [View on PyPI](https://pypi.org/project/torchtune/)