Fine-Tuning Apache-2.0

Axolotl

YAML-config-driven fine-tuning framework. Supports LoRA, QLoRA, full FT, DPO, RLHF, multi-GPU via DeepSpeed and FSDP. The most flexible option for research.

Platforms: windowsmacoslinux

Axolotl is a configuration-driven fine-tuning framework built on top of Hugging Face transformers and trl. You describe your training run in a single YAML file — base model, dataset, LoRA vs. full FT, learning rate, packing, FlashAttention, DeepSpeed strategy — and Axolotl assembles the trainer, data collator, and accelerator config for you. It supports the full menu of post-training methods: SFT, LoRA, QLoRA, full-parameter, DPO, ORPO, KTO, RLHF, and continued pre-training, and it scales from one GPU to multi-node via DeepSpeed ZeRO and FSDP. The community — OpenHermes, Nous Research, many model-card authors — uses it as the default for reproducing and publishing runs, which makes Axolotl’s YAML schemas a de facto interchange format for training recipes in 2026.

Key Features

  • YAML-first configuration. A typical config is 40-60 lines covering model path, dataset list (ShareGPT, ChatML, Alpaca, JSONL, or HF Hub), lora_r / lora_alpha, sequence packing, and bf16. The same file reproduces a run months later or on a different cluster.
  • Every modern training method. SFT, LoRA, QLoRA, full FT, DPO, ORPO, KTO, IPO, RLHF (PPO), and reward modeling are first-class type: values. Switching from SFT to DPO is usually a one-line change plus a preference dataset.
  • Multi-GPU and multi-node. DeepSpeed ZeRO-2/3 and PyTorch FSDP are configured in the same YAML. Tensor parallelism is supported for the largest runs. This is where you go when a single 24GB card is not enough.
  • Largest dataset-format support. Axolotl’s prompt tokenizers and dataset loaders handle more chat formats than any other framework, so you rarely need to rewrite your data.

When to Use Axolotl

Use Axolotl when you need reproducible, shareable training configs; when you want one framework that spans SFT through DPO through full fine-tuning; or when you are scaling beyond a single GPU and want DeepSpeed/FSDP wired up for you. It is the most flexible option and the best fit for research and model-publishing workflows. Choose Unsloth instead when you are on a single GPU, want maximum speed, and do not need the breadth of methods. Choose LLaMA-Factory when you want a web UI to configure the run instead of hand-editing YAML.

Setup

# Recommended: dedicated environment, CUDA 12.1+
pip install axolotl[flash-attn,deepspeed]

# Or use the official Docker image:
docker run --gpus all --shm-size 16g -v $PWD:/workspace \
  wingedin/axolotl:main-latest

# Train from a config:
accelerate launch -m axolotl.cli.train examples/qlora-llama3.yml
# or
axolotl train examples/qlora-llama3.yml

Sample configs live in the repo’s examples/ directory. A minimal QLoRA run on Llama-3-8B fits in ~10GB VRAM with load_in_4bit: true and adapter: qlora. Outputs are LoRA adapters; merge with axolotl-cli merge or export to GGUF via llama.cpp.

See also