# Axolotl

> Config-driven fine-tuning for open LLMs, from LoRA to full post-training

- Category: Training & Fine-Tuning / Fine-Tuning Frameworks
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/axolotl-ai-cloud/axolotl
- Website: https://docs.axolotl.ai
- Canonical page: https://ai-tldr.dev/tools/axolotl/
- Updated: 2026-09-10

## In short

Axolotl is a free, open-source framework for fine-tuning and post-training open large language models. Instead of writing custom training loops, you describe a job in a YAML config file (the model, dataset, and method) and run a single command. It sits in the Fine-Tuning Frameworks category of the Training & Fine-Tuning tools and is open-source, written in Python and licensed Apache-2.0.

## Overview

Axolotl is a free, open-source framework for fine-tuning and post-training open large language models. Instead of writing custom training loops, you describe a job in a YAML config file (the model, dataset, and method) and run a single command. It supports common workflows like supervised fine-tuning (SFT), parameter-efficient methods such as LoRA and QLoRA, and preference-tuning methods like DPO and GRPO.

It targets developers and ML engineers who want to adapt existing open models to their own data without building infrastructure from scratch. Axolotl covers many model families, including Llama, Qwen, Mistral, Gemma, and GLM, and handles single-GPU runs as well as multi-GPU and multi-node training through DeepSpeed and FSDP.

Within the fine-tuning framework category, Axolotl sits between low-level training libraries and managed platforms: you keep full control over the training recipe in a reproducible config, while the framework handles data formatting, distributed setup, and the training loop for you.

## What it does

- Config-driven training: define the whole job (model, dataset, method, hyperparameters) in a single YAML file
- Multiple training methods: SFT, LoRA and QLoRA, plus preference tuning with DPO and GRPO
- Broad model support across families such as Llama, Qwen, Mistral, Gemma, GLM, and many more
- Multi-GPU and multi-node training via DeepSpeed and FSDP
- Ready-made example configs you can fetch and adapt with `axolotl fetch examples`
- Docker image and uv-based install for reproducible environments

## Getting started

Axolotl is a Python framework that needs a CUDA GPU. Install it, fetch the example configs, then start a training run from a YAML file.

1. Install Axolotl

   The project is uv-first. Create a Python 3.12 environment and install Axolotl with the DeepSpeed extra. Set the Torch backend to match your CUDA version.

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
export UV_TORCH_BACKEND=cu128
uv venv --python 3.12
source .venv/bin/activate
uv pip install torch==2.10.0 torchvision
uv pip install --no-build-isolation axolotl[deepspeed]
```

2. Or run it with Docker

   If you prefer not to manage a local environment, use the prebuilt image with GPU access.

```bash
docker run --gpus '"all"' --ipc=host --rm -it axolotlai/axolotl:main-latest
```

3. Fetch the example configs

   Download the bundled example YAML files (and optional DeepSpeed configs) to use as starting points.

```bash
axolotl fetch examples
axolotl fetch deepspeed_configs
```

4. Train a model

   Point the train command at a config file. This example runs LoRA fine-tuning on a 1B Llama 3 model.

```bash
axolotl train examples/llama-3/lora-1b.yml
```

## When to use it

- Adapt an open base model to your own instruction or chat dataset with SFT
- Fine-tune a large model cheaply on a single GPU using LoRA or QLoRA
- Align a model to human preferences with DPO or GRPO post-training
- Scale a training run across multiple GPUs or nodes using DeepSpeed or FSDP

## Version history

- 2026-09-10 v0.19.0: Adds native BitNet b1.58 ternary quantization-aware training via qat: weight_dtype: ternary, a declarative model-support system built on family templates, and the PoLoRA and AdamC optimizers. Chat-template tokenization of an 80-turn Qwen2.5 conversation drops from 1,577.6 ms to 96.4 ms.
