Unsloth vs Axolotl vs TRL vs LLaMA-Factory
These four all train open models, but they ask you to own different parts of the loop. The decision is less about which produces a better model than about which leaves you with a process you can repeat.
Short answer
Start with Unsloth if you are one person on one GPU: the memory and speed gains are real and the loop stays short enough to understand.
By Kunj Shah · Licence and cost facts verified · method
- UnslothHand-written kernels, fastest and smallest memory.
- AxolotlConfig-driven, broad architecture support.
- TRLReference trainers for SFT, DPO and RLHF.
- LLaMA-FactoryUnified UI and config across methods.
| Dimension | Unsloth | Axolotl | TRL | LLaMA-Factory |
|---|---|---|---|---|
| Memory footprint | Lowest: 2x faster, ~60% less VRAM | Moderate, depends on backend | Baseline, framework overhead | Moderate, wraps TRL and PEFT |
| Methods supported | SFT, DPO, GRPO, ORPO | SFT, DPO, PPO, ORPO, KTO | SFT, DPO, PPO, GRPO, KTO | SFT, DPO, PPO, ORPO, KTO, RLHF |
| Configuration | Python code, explicit | YAML config, minimal code | Python code, full control | YAML or Web UI |
| Architecture coverage | Llama, Mistral, Qwen, Gemma and friends | Very broad, via transformers | Anything transformers supports | Very broad, via transformers |
| Best for | One person, one GPU, fast iteration | Teams wanting reproducible YAML runs | Researchers needing custom training loops | Teams wanting a UI and many methods |
| Where it loses | Narrower architecture list than Axolotl | Less kernel-level speed than Unsloth | You write and maintain the loop | Heavier stack, more moving parts |
Scroll the table sideways to see every tool.
What this table is not. These are editorial judgements, not benchmarks: Lattice has not run these tools head to head, and no cell uses GitHub stars or vendor benchmark claims as evidence. Licence and cost facts are re-checked on a schedule the build enforces: the receipt is public.
The recommendation
Which should you choose: Unsloth, Axolotl, TRL or LLaMA-Factory?
Start with Unsloth if you are one person on one GPU: the memory and speed gains are real and the loop stays short enough to understand. Move to Axolotl or LLaMA-Factory when runs need to be reproducible across a team, because YAML config beats a notebook. Reach for TRL directly when you need a method the wrappers have not exposed yet, or a custom loss, and accept that you now own the training loop.
Rules of thumb
- Fine-tuning teaches behaviour, not facts. If the answer changes monthly, it belongs in retrieval.
- Measure on your own eval set before and after. A lower loss is not a better model.
- A fine-tuned model is a new artefact you have to serve and retrain. Budget for that before you start.
Quick answers
- When should you use Unsloth, and when should you skip it?
- Use Unsloth when: LoRA fine-tuning on a single GPU, with memory and time roughly halved. Skip it when: you need a training stack you can audit line by line.
- When should you use Axolotl, and when should you skip it?
- Use Axolotl when: configuration-driven fine-tuning across many architectures. Skip it when: you need to hand-tune the training loop itself.
- When should you use TRL, and when should you skip it?
- Use TRL when: post-training trainers for SFT, DPO and GRPO on top of any PEFT setup. Skip it when: you are training from scratch rather than aligning an existing model.
- When should you use LLaMA-Factory, and when should you skip it?
- Use LLaMA-Factory when: one interface for SFT, DPO and RLHF across open models. Skip it when: you want a minimal, readable training script.