AI Blog

Unsloth vs Axolotl vs TRL vs LlamaFactory: Pick by Coupling, Not Throughput

These four are not four alternatives at one layer — TRL is the trainer API, Axolotl and LlamaFactory wrap it, and Unsloth rewrites its source at import time. That single fact predicts the thing you will actually feel: TRL shipped 1.9.2 in July while two of the others still pin the 0.x line. The famous speed table nobody can source is the wrong axis entirely.

By Agentic AI Wiki 12 min read

Every comparison of these four opens with a wall-clock table, and the most-quoted one — Unsloth 3.2 hours, LlamaFactory 3.4, Axolotl 5.8 on a single A100 — has no primary source, no framework versions, and appears to descend from a GPU vendor's 2025 blog post that ran on a 4090. Throw it out. The fact that actually predicts your next twelve months is structural: TRL is the trainer API, Axolotl and LlamaFactory import it, and Unsloth rewrites its source at import time. TRL shipped 1.9.2 in July. Two of the other three still pin the 0.x line.

At a glance

Four projects, three layers, and one dependency relationship that explains most of the differences people attribute to philosophy.

ProjectWhat it actually isTRL it targetsLatest release
TRLThe trainer API — the others build on itis TRL1.9.2, 28 Jul 2026
AxolotlYAML/CLI orchestration + its own Triton kernels==1.8.00.18.0, 17 Jul 2026
UnslothTriton kernels; patches transformers, source-rewrites TRL<=0.24.02026.8.2, 3 Aug 2026
LlamaFactoryZero-code CLI + Gradio GUI over transformers/TRL<=0.24.00.9.5, 30 May 2026
GitHub stars comparison Horizontal bar chart of GitHub stars observed on 4 August 2026: LlamaFactory 73,738, Unsloth 69,508, TRL 18,994, Axolotl 12,303. GitHub stars, observed 4 Aug 2026 20K 40K 60K LlamaFactory 73,738 Unsloth 69,508 TRL 18,994 Axolotl 12,303
Stars, observed 4 August 2026. Note that the two most-starred projects are the two furthest behind on the dependency they share.

Two housekeeping notes before anything else, because both will waste your afternoon. The repository formerly at hiyouga/LLaMA-Factory was renamed to hiyouga/LlamaFactory during 2026; old URLs still redirect. And Unsloth ships two version streams that must not be conflated — the pip library is 2026.8.2, while the v0.1.5xx-beta tags on GitHub version Unsloth Studio, a different product.

Three layers, not four options

How the four fine-tuning projects relate to each other PyTorch, transformers, PEFT and accelerate form the base layer. TRL sits above it as the trainer API. Axolotl and LlamaFactory sit above TRL and import its trainers. Unsloth sits to the side and reaches into both lower layers, patching transformers and rewriting TRL trainer source at import time. What each project does to the layer below Axolotl imports TRL trainers plus own Triton kernels LlamaFactory wraps transformers Trainer TRL on preference stages Unsloth Triton kernels patches transformers rewrites TRL source at import time so it must pin what it rewrites TRL · the trainer API SFT · DPO · GRPO · KTO · Reward · RLOO stable ORPO · CPO · PPO · PRM in trl.experimental PyTorch · transformers · PEFT · accelerate the layer everything ultimately calls Three of them stack. One reaches sideways into the libraries it sits on. That is why two of the four still pin the TRL 0.x line while TRL ships 1.9.2.
Three of them stack. One of them reaches sideways into the libraries below it, and that is the whole story.

What each one does to the layer below

TRL is Hugging Face's trainer library and the thing the others are made of. Axolotl imports its trainers directly — DPOTrainer, GRPOTrainer, KTOTrainer, RewardTrainer, the vLLM client — and adds a YAML config surface, a CLI, and a set of its own Triton kernels whose LoRA implementation credits Unsloth for the approach. LlamaFactory wraps transformers.Trainer for SFT and reward modelling and reaches for TRL on the preference stages, then puts a Gradio GUI on top.

Unsloth does something categorically different. At import it reassigns functions inside transformers, rewrites model source, and — this is the part worth internalising — it iterates over trl.trainer, takes the source code of each Trainer class, string-patches it, and execs the result back. That is what buys the kernel-level speedups, and it is also why the pin exists.

The pin is the product decision

If you rewrite another library's source, you can only support the versions whose source you have accounted for. Unsloth's published pins cap at trl<=0.24.0 and transformers<=5.5.0 with thirteen individual version exclusions. LlamaFactory caps at trl<=0.24.0 too. TRL is at 1.9.2, having gone 1.0 on 30 March 2026. Axolotl pins trl==1.8.0 and transformers==5.14.1 exactly.

So the practical question is not which trainer is fastest. It is: when a new model family lands and support arrives in transformers, how long until you can train it? Axolotl's answer is one exact-pin bump, usually within weeks — its 2026 cadence has been roughly monthly. Unsloth's answer is that it ships model support directly and often early, but on its own frozen view of the stack. LlamaFactory's answer, on a release cadence of roughly twice a year, is that you may be waiting. That is the trade, and it is a real one in both directions: exact pins are hostile to shared environments, and you cannot co-install Axolotl 0.18.0 with anything else that wants a different transformers.

The experimental namespace is a live risk for one of them

TRL 1.x keeps six trainers stable — SFT, DPO, GRPO, KTO, Reward and RLOO — and moved a long list into trl.experimental, including ORPO, CPO, PPO, Online DPO and PRM. The stability contract there is explicit: anything under that namespace may change or be removed in any release, including a patch release, with no deprecation. Axolotl imports ORPO, CPO and PRM from precisely that namespace. If you have an ORPO recipe in production on Axolotl, you are one upstream patch release away from it moving, and the exact pin is what is protecting you.

The parallelism wall

Parallelism support matrix Four project rows against five parallelism columns. Axolotl supports DDP, FSDP or ZeRO, tensor parallel, context parallel and expert parallel. TRL supports the first four and has no first-class expert parallelism. LlamaFactory supports the first two fully and offers tensor and context parallel only for full fine-tuning on pretraining and SFT stages. Unsloth supports the first two and has none of the last three as training configuration. First-class parallelism, as documented by each project DDP FSDP / ZeRO Tensor parallel Context parallel Expert parallel Axolotl Yes FSDP2 Yes Yes Yes (MoE) TRL Yes Both Yes Ring + Ulysses None LlamaFactory Yes ZeRO-3 Full FT only pt / sft Full FT only pt / sft None Unsloth Yes Via Accelerate None None None First-class Gated to some stages Not offered for training
Everything supports DDP. The right-hand three columns are where a project stops being an option.

The axis that actually forces migrations is not speed, it is the shape of parallelism you need when the model stops fitting your first assumption. All four do DDP and all four do sharded data parallelism through DeepSpeed ZeRO or FSDP. Past that they diverge sharply, and the divergence is documented rather than inferred.

Axolotl publishes the most explicit matrix of the four: FSDP2, HSDP, tensor parallel, context parallel and expert parallel, with the valid 2D and 3D combinations enumerated and the invalid ones raising NotImplementedError — expert parallel cannot compose with TP or CP, DDP cannot compose with either. It also documents an unusually long list of what does not work together, which reads as a footgun inventory and is worth more than a feature list. TRL exposes tensor parallel through Accelerate and ships two sequence-parallel implementations side by side: ring attention on FSDP2, which is SDPA-only and cannot use Flash Attention, and ALST/Ulysses on DeepSpeed, which needs the head count to divide the parallel size.

LlamaFactory gained tensor and context parallelism in its 2026 line through a HyperParallel backend, plus Megatron-Core and Megatron-Bridge adapters — but the docstring gates them to full fine-tuning on pretraining and SFT stages only, so no LoRA and no preference training. Unsloth has none of the three as first-class training configuration; the tensor-parallel controls in its README are for GGUF inference, not training.

One thing you should hear stated carefully rather than confidently, because the sources genuinely disagree with each other. Unsloth's multi-GPU support is present and documented in the open-source package as of 2026 — DDP through torchrun, with FSDP and DeepSpeed via Accelerate, and rank-aware loading, per-device RoPE caches and world-size-aware GRPO batching all visible in the code. The old hard block that raised "Unsloth currently does not support multi GPU setups" still exists in the source but its patcher is commented out, so it no longer fires; a live version survives only in a legacy training helper. Meanwhile the vendor's pricing page still lists multi-GPU as a paid tier. The two have not been reconciled, and if that distinction matters to your plan, test it before you commit.

Where each one is genuinely the right answer

Feature parity is close enough on the basics — all four do LoRA, QLoRA and full fine-tuning, all four do DPO and KTO — that the choice comes down to what you need at the edges.

If you…PickBecause
Train agentic RL with verifiable rewardsTRL, or AxolotlGRPO is stable in TRL 1.x with environment integrations; Axolotl adds async GRPO. LlamaFactory has no GRPO at all — it lives in the separate EasyR1 repo
Need TP, CP or expert parallelism on a MoEAxolotlOnly project with all three as first-class config and the valid combinations documented
Are fitting a large model onto one or two GPUsUnslothThe kernel work is real and the VRAM reductions are the reason to accept the pin
Want non-engineers to launch runsLlamaFactoryLLaMA Board is the only mature training GUI here; Unsloth Studio is new and a different product shape
Train on Ascend NPUsLlamaFactoryFirst-class CANN support with prebuilt images. Axolotl lists Ascend parity as out of scope
Need audio or omni-modal fine-tuningLlamaFactoryBroadest modality coverage; Axolotl calls its multimodal path experimental with no full parity
Want to stay current with the ecosystemTRL directlyEvery wrapper is by construction behind it, and you can add Liger or Unsloth as an integration

Two sharp edges are worth naming because both are the silent kind. Axolotl shipped a bug, fixed in May 2026, where the multimodal training path ignored train_on_inputs, roles_to_train and train_on_eos for every multimodal model except one — models trained on the full conversation while the config said otherwise, with no error. And Unsloth's licence is not the single Apache-2.0 the badge suggests: the core package is Apache-2.0, Unsloth Studio is AGPL-3.0, and the unsloth_zoo package that carries the kernels and patching layer declares LGPL-3.0-or-later. If your legal review assumed one licence for the whole thing, it assumed wrong.

About that benchmark

There is no credible independent head-to-head of these four published in 2026. Four articles compare them; none publishes configs, scripts or logs, and the most-cited one re-quotes vendor claims verbatim rather than running anything. The widely circulated A100 wall-clock table has no primary attribution and its closest apparent ancestor is a GPU vendor's April 2025 post benchmarking on an RTX 4090 — a year old, different hardware, and single-GPU, which means it says nothing at all about the multi-GPU axis it is most often cited for.

The best-documented number in this space is TRL's own: Qwen3-8B on one to eight H100s with the accelerate config and script published, reaching context lengths over 300k tokens at eight GPUs. Everything else — Unsloth's 2× speed and 70% VRAM reduction, its 12× MoE figure and its 712 ms-versus-5,227 ms B200 step time, Axolotl's 58% faster async GRPO steps, LlamaFactory's entire VRAM requirement table, which is explicitly marked as estimated — is self-reported by the project, mostly without a stated setup. Those claims are not necessarily wrong. They are just not measurements you can check, and a QLoRA run at 512 tokens on one GPU is kernel-bound in a way that structurally flatters the kernel project and penalises the orchestration layers.

If throughput decides your choice, the only defensible move is to run your model, your sequence length and your parallelism plan on your own hardware for an afternoon. The rest of this comparison is trying to tell you which project will still be a viable choice in six months, which is the question a benchmark cannot answer.

FAQ

Can I use Unsloth from inside Axolotl or LlamaFactory?

LlamaFactory has a use_unsloth flag that switches in Unsloth as an acceleration backend, and TRL documents an official Unsloth integration. Axolotl instead wrote its own Triton kernels, crediting Unsloth for the approach. So the kernels are reachable from more than one place, but you inherit Unsloth's version constraints along with them.

Why does LlamaFactory not have GRPO?

Its training stages are pretraining, SFT, reward modelling, PPO, DPO and KTO — ORPO and SimPO are implemented as loss variants of the DPO stage rather than as separate trainers. The project's answer for verifiable-reward RL is a separate repository, EasyR1. If GRPO is your workload, this is the disqualifying fact.

Is Unsloth still a library or is it a UI now?

Both, and the emphasis moved in 2026. The repository description and README now lead with Unsloth Studio, a local web UI for running and training models, with the pip package rebranded as "Unsloth Core". The library is actively developed — it shipped on 3 August 2026 — but if you last looked a year ago, the project's centre of gravity has shifted.

Which one should I use to fine-tune a model for an agent?

If the training signal is a verifiable reward over trajectories, TRL or Axolotl, because that is where GRPO and the environment integrations are. If you are distilling a smaller model to handle routine steps in an agent loop, any of the four will do supervised fine-tuning fine and you should pick on operational fit instead.

Do the exact pins in Axolotl mean I cannot upgrade transformers?

Within a shared environment, effectively yes — that is the cost of exact pinning, and it is why Axolotl ships Docker images and cloud templates. The benefit is that a given Axolotl version is reproducible in a way that a range-pinned project is not.

Further reading

On this wiki:

Project sources: