torchtune
$ tune Official Med Risktorchtune (tune) is PyTorch's official CLI for LLM fine-tuning, evaluation, and quantization using clean, hackable YAML recipes. It includes recipe discovery (tune ls), config extraction (tune cp), static YAML verification (tune validate), checkpoint downloads (tune download), and distributed execution (tune run).
pip install torchtune tune manages local recipe files, validates configs (tune validate), and launches local PyTorch torchrun jobs.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Strong non-interactive workflow with tune ls, tune cat, tune cp, and tune validate, though output is plain text rather than --json.
tune lsandtune validateenable pre-flight recipe discovery and validation- Inline
key=valueconfig overrides ontune run
tune validate catches config errors before allocating GPUs; writes only to local --output-dir / checkpoints.
- Static config verification via
tune validatebefore execution
Installable via pip install torchtune on Linux and macOS, requiring matched torch / torchao versions.
- Linux/macOS Python package requiring PyTorch ecosystem dependencies
Clean torchrun wrapper with composable recipes (lora, qlora, full), tune cp, and tune validate.
- Built-in multi-GPU
--nproc-per-nodesupport and composable recipes
Official PyTorch (pytorch/torchtune) project under BSD-3-Clause.
- Official
pytorch/torchtunerepository (BSD-3-Clause)
Clear official documentation at meta-pytorch.org/torchtune and self-describing tune --help.
- Official docs and built-in
tune ls/tune catinspection
Security, Auth & Guardrails
Accepts --hf-token or HF_TOKEN env var for gated Hugging Face downloads (tune download).
BSD-3-Clause open-source PyTorch library; GPU hardware required for LLM fine-tuning.
# torchtune (tune) Agent Rules - Always inspect `tune ls` and run `tune validate <config.yaml>` before launching `tune run`. - Specify `--output-dir` on `tune download` and pass bounded `epochs=1` / `max_steps_per_epoch` overrides when testing recipes.
Agent-Ready Command Recipes
Safe Read-Only Queries
tune ls
Lists all available fine-tuning, evaluation, and quantization recipes with their matching YAML configs.
tune validate ./my_config.yaml
Performs dry validation of YAML recipe fields and overrides without launching PyTorch workers.
Controlled Writes & Previews
tune cp llama3_1/8B_lora_single_device ./my_config.yaml
Copies an official recipe YAML into ./my_config.yaml without downloading weights or running training.
Strengths for Agents
- +
tune ls,tune cat,tune cp, andtune validateform a clean, inspectable recipe workflow. - + Seamless
torchrunwrapping (--nproc-per-node) and inlinekey=valueconfig overrides.
Caveats & Pitfalls
- ! No
--jsonoutput ontune lsortune validate. - !
tune runrequires matched PyTorch/CUDA/torchao wheels and substantial GPU VRAM.