aicoolies logo

torchtune

Meta's official PyTorch library for LLM fine-tuning

Share
open-sourceOpen Source
Visit Website →

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

Alternatives

Related Tools

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-sourceOpen Source
SeekDB logo

SeekDB

AI-native state store with hybrid vector and full-text search

SeekDB is an open-source AI-native state store from the OceanBase ecosystem that combines MySQL-compatible data access with hybrid vector and full-text retrieval. It targets agent and AI application teams that need embedded or server deployment, copy-on-write style sandboxes, and searchable state without gluing together several separate storage layers.

open-sourceOpen Source
Marqo logo

Marqo

Embedding-first search and discovery engine for AI-powered product experiences.

Marqo is an open-source tensor search engine that combines embedding generation and vector search in a single API, removing the need to manage separate embedding pipelines and vector databases. Built for product discovery and multi-modal search, it lets teams index text, images, and structured data together, returning ranked results based on semantic similarity rather than keyword overlap.

freemium
Magika logo

Magika

AI-powered file-type detection at Google scale

Open-source AI-powered file-type detection tool from Google that uses a custom deep-learning model under a few megabytes to identify more than 200 binary and textual content types in milliseconds, even on a single CPU. Magika ships as a CLI, Python package, JavaScript/TypeScript library, and an ONNX model, achieves around 99% accuracy on its test set, and is already used at Google scale across Gmail, Drive, and Safe Browsing as well as by VirusTotal and abuse.ch.

freeOpen Source
Zep logo

Zep

Context engineering platform for AI agents with temporal knowledge graphs

Zep is a context engineering platform that assembles relationship-aware context for AI agents from conversations, business data, documents, and events. It maintains a temporal knowledge graph that automatically extracts entities and relationships, tracking how context evolves over time. Zep delivers formatted context blocks optimized for LLMs with sub-200ms latency, integrating with LangChain, LlamaIndex, AutoGen, and Google ADK through Python, TypeScript, and Go SDKs.

freemium
Hindsight logo

Hindsight

Agent memory system that learns, not just remembers

Hindsight is an agent memory system that enables AI agents to learn from experience rather than just store conversations. It organizes memories into three biomimetic categories: World knowledge for facts, Experiences for agent events, and Mental Models for learned understanding. The system provides retain, recall, and reflect operations backed by a temporal knowledge graph with parallel retrieval strategies including semantic, keyword, graph traversal, and temporal search.

freemiumOpen Source

Used in Stacks

Comparisons