Contents
Figure 1: Best GitHub Repos for Fine-Tuning LLMs — four repos dominate fine-tuning conversations. Every comparison crowns a different winner, and most lean on the same recycled speed chart.
Four open-source repos dominate fine-tuning conversations: Unsloth, Axolotl, TRL, and LLaMA-Factory. Every comparison crowns a different winner, and most of them lean on the same recycled speed chart.
That chart deserves suspicion. One August 2026 analysis traces the widely copied four-number training-time table back to a single undated blog post from a GPU-rental vendor. The post named no repository, seed, or commit, and it pinned an Axolotl version roughly ten releases behind the current one. If a hardware proposal cites that table, ask for the config.
This guide compares the four repos on what actually differs: scope, hardware, parallelism, checkpoint coverage, reproducibility, and security. FYI, I researched this in early November 2026, and the most detailed source I found dates from August 6, 2026, so check version numbers and star counts yourself. Numbered brackets like [1] point to the sources at the end. The code samples are mine and untested.
The Short Version
- One GPU, mainstream checkpoint, speed and memory matter most: Unsloth.
- Several GPUs, long context, or multi-node, with reproducible configs: Axolotl.
- Alignment work and custom training objectives (DPO, GRPO, your own loss): TRL.
- First fine-tune, or a team that wants a web UI: LLaMA-Factory, pinned to a patched version and kept off the open network.
- Torchtune: Not a live option anymore, as I explain below.
These tools overlap and combine. One comparison notes that Unsloth's optimizations can run as a backend inside other tools, and that LLaMA-Factory does exactly that [3]. Another says Unsloth swaps the kernel layer underneath the same Hugging Face API, so you can pair it with TRL for preference training [4].
A Maintenance Check First: Torchtune
Torchtune appears in older shortlists as PyTorch's official fine-tuning library. According to the August 2026 analysis, its README now says it's no longer actively maintained, a maintainer announced in July 2025 that development was stopping, and its last release was in April 2025 [1]. A separate comparison page still lists it as an option [3], which shows how stale lists linger. Skip it for new work.
The Four Contenders
TRL (Hugging Face)
TRL is the library other tools build on or around. One roundup describes it as the pick when the training objective matters more than training speed, and says that for anything beyond supervised fine-tuning (GRPO, DPO, PPO, RLOO), TRL is the answer [2]. A Korean-language summary of another comparison says it provides a reference implementation of GRPO and defines the trainer layer that Axolotl and LLaMA-Factory call internally, and it warns that its API changes between versions often enough to make migrations painful [6].
The August analysis agrees on the cadence: TRL shipped eight releases in about nine weeks, so you need a lockfile and a habit of reading the changelog [1].
Here's a minimal supervised fine-tuning sketch. The model and dataset names are illustrative:
from datasets import load_dataset
from peft import LoraConfig
from trl import SFTConfig, SFTTrainer
dataset = load_dataset("trl-lib/Capybara", split="train")
trainer = SFTTrainer(
model="Qwen/Qwen2.5-0.5B",
train_dataset=dataset,
args=SFTConfig(output_dir="sft-out", max_steps=100),
peft_config=LoraConfig(r=16, lora_alpha=32, task_type="CAUSAL_LM"),
)
trainer.train()
- Best for: Alignment research, custom objectives, and teams that live in the Hugging Face ecosystem.
- Watch out: Fast-moving APIs. Pin versions. My guides on DPO and GRPO cover the methods themselves.
Unsloth
Unsloth's pitch is kernel-level efficiency. A roundup says it's the pick for one GPU where nothing else comes close on efficiency [2], and a third source describes it as kernel-first, with a Studio interface as an add-on, in contrast with LLaMA-Factory's UI-first design [4]. The August analysis cites Unsloth's own documentation for real measurements: on one MoE-style model it reports a 7.3x step-time speedup and 35.7% lower peak memory at 8K context on a B200, and the same page shows another model where the speedup shrinks to about 1.1x at 16K context. The takeaway: the advantage depends on how well the kernels cover your specific checkpoint [1]. Those numbers are vendor-published, which the analysis says plainly [1].
Two cautions deserve emphasis:
- Checkpoint coverage. The analysis says Unsloth's acceleration works from a lookup table keyed by exact Hugging Face repository ID, so an unmapped checkpoint falls back to a generic path and loses the benefit [1]. Test your exact checkpoint on a cheap instance before you reserve GPU time.
- Multi-GPU is real and limited. The claim that Unsloth is single-GPU only is stale. Its docs cover DDP and FSDP through Accelerate. But the analysis found no documentation for tensor, context, or expert parallelism, and it lists open issues about multi-GPU correctness [1]. A separate source calls multi-GPU recent, with single-GPU as the well-trodden path [4].
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="unsloth/Llama-3.2-1B-Instruct", # illustrative; check the mapped list
max_seq_length=2048,
load_in_4bit=True,
)
model = FastLanguageModel.get_peft_model(
model,
r=16,
lora_alpha=16,
target_modules=["q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj"],
)
- Best for: Solo practitioners and small teams on one NVIDIA GPU.
- Watch out: Coverage and the multi-node story.
Axolotl
Axolotl centers on configuration files. One roundup calls it the workhorse for production pipelines, praising YAML-driven reproducibility, strong multi-GPU and multi-node support, and DeepSpeed and FSDP integration [2]. The Korean summary says one YAML file can combine DeepSpeed ZeRO-2 and ZeRO-3, FSDP, tensor parallelism, and context parallelism, and that Axolotl supports long-context fine-tuning with ring-attention-style sequence parallelism [6]. The August analysis found that Axolotl publishes a matrix of supported parallelism combinations, including config keys for tensor, context, and expert parallelism, and it warns about two details: a deprecated key named sequence_parallel_degree that old posts still use (the current key is context_parallel_size), and a config note that tensor parallelism works only with DeepSpeed's AutoTP [1].
A minimal QLoRA config looks like this. Treat the values as a starting point and check Axolotl's current docs for the exact keys and launch command:
base_model: Qwen/Qwen2.5-0.5B
load_in_4bit: true
adapter: qlora
lora_r: 16
lora_alpha: 32
lora_target_linear: true
datasets:
- path: tatsu-lab/alpaca
type: alpaca
sequence_len: 2048
micro_batch_size: 2
gradient_accumulation_steps: 4
num_epochs: 1
learning_rate: 0.0002
output_dir: ./outputs/qlora-out
- Best for: Multi-GPU runs, long contexts, and audit-minded teams that want the whole run in one committed file.
- Watch out: A steeper learning curve, which a comparison table rates as the highest of the four [5].
LLaMA-Factory
LLaMA-Factory has the lowest barrier to entry. One roundup says its web UI gets you running in minutes [2], and another describes the largest community among these tools thanks to that UI [3]. The August analysis says it's the fastest UI-driven path, and notes that it has no kernels of its own: acceleration from Unsloth is an opt-in flag, off by default [1].
The same analysis flags a security history. It lists four published advisories, two of them remote code execution, and says 0.9.4 is the minimum safe version. It also recommends never exposing the training UI beyond localhost or a bastion host [1]. The Korean summary adds that distributed training setups work through YAML and the command line, not the web UI, so the learning curve steepens once you pass one GPU [6].
# Launch the web UI (bind to localhost; do not expose it to a network)
llamafactory-cli webui
- Best for: First-time fine-tuners, broad model support, and vision-language experiments (one roundup credits it with the broadest VLM support [2]).
- Watch out: Keep it patched, keep it private, and publish your config next to any timing you report.
What Actually Differs
Feature lists no longer separate these tools. All four handle LoRA, QLoRA, and full fine-tuning, and the August analysis says reading a feature matrix tells you almost nothing [1]. Four things matter more:
- Parallelism ceiling. Data parallelism only, or tensor, context, and expert parallelism too? Axolotl and TRL document richer options than Unsloth [1].
- Checkpoint coverage. Does the fast path cover your exact model [1]?
- Run artifacts. Can you reconstruct the run six months later? A single committed YAML file helps, and notebook-driven workflows make it harder [1].
- Security and maintenance. Check advisories and release cadence, because they differ a lot [1].
Hardware: What Fits Where
Context length eats memory faster than parameters do. Two published floors give a rough sense:
- Unsloth's docs list about 6 GB as a minimum for an 8B model at 4-bit QLoRA, and about 22 GB for 16-bit LoRA [1].
- LLaMA-Factory's hardware table lists about 6 GB for QLoRA on a 7B model and about 120 GB for full bf16 fine-tuning [1].
The analysis stresses that these are floors at short sequences, and that long context dominates once you pass a few thousand tokens [1]. Another source gives a rule of thumb that QLoRA handles most consumer-GPU fine-tuning and that a 12 GB card is a reasonable minimum [5]. Size your card for the context you need.
Don't Trust a Speed Table, Run Your Own
Published speed comparisons rarely control for the things that matter: model, sequence length, batch size, precision, library versions, and whether acceleration flags were on. Measure your own workload. Here's a small helper (untested) for step time and peak memory:
import time
import torch
def benchmark(train_step, steps=20, warmup=5):
for _ in range(warmup):
train_step()
torch.cuda.synchronize()
torch.cuda.reset_peak_memory_stats()
t0 = time.perf_counter()
for _ in range(steps):
train_step()
torch.cuda.synchronize()
return {
"sec_per_step": (time.perf_counter() - t0) / steps,
"peak_gb": torch.cuda.max_memory_allocated() / 1e9,
}
Run the same model, data, sequence length, and effective batch size through each framework. Record library versions, GPU model, and every acceleration flag. Report quality too, since a faster run that trains a worse model doesn't count.
Check Repo Health
The numbers move fast. The August analysis lists star counts in the tens of thousands for LLaMA-Factory and Unsloth, around nineteen thousand for TRL, and around twelve thousand for Axolotl [1]. A February-to-March 2026 roundup shows different figures and different version numbers [2], which tells you how quickly such data goes stale and how much sources disagree. Check each repository directly for stars, last commit, open issues, license, and the latest release. From my own knowledge, the repos live at github.com/unslothai/unsloth, github.com/axolotl-ai-cloud/axolotl, github.com/huggingface/trl, and github.com/hiyouga/LLaMA-Factory, but I didn't verify those URLs, so confirm them. My guide on finding good learning repos includes a short script that checks a repo's health through the GitHub API.
Combine Them Instead of Choosing
The tools complement each other:
- TRL + Unsloth: Preference or RL training with faster kernels [2][4].
- LLaMA-Factory + Unsloth: A UI workflow with Unsloth acceleration, as one comparison notes [3].
- Axolotl calling TRL trainers: Reproducible configs on top of TRL's methods [6].
A practical path: prototype on one GPU with Unsloth or LLaMA-Factory, move the recipe to Axolotl or TRL when you need scale or a custom objective, and keep your evaluation harness independent of all of them.
Mistakes I See Teams Make
- Choosing by stars. Stars measure attention, not fit.
- Trusting the recycled speed table [1].
- Skipping the checkpoint check on Unsloth [1].
- Exposing a training web UI to a network [1].
- Copying old config keys. Deprecated names linger in blog posts [1]. :/
- Not pinning versions. TRL moves quickly [1][6].
- Skipping evaluation. A fine-tune that you can't measure isn't a result. :)
- Fine-tuning when you didn't need to. One roundup opens with that point [2], and prompt engineering or retrieval often does the job.
Your Quick-Start Checklist
- Confirm you need fine-tuning rather than prompting or retrieval.
- Write down your hardware, model, and context length.
- Pick by scenario: Unsloth for one GPU, Axolotl for scale, TRL for custom objectives, LLaMA-Factory for a UI.
- Check your exact checkpoint against the framework's supported list.
- Pin versions, and commit your config.
- Run a small benchmark on your own workload.
- Evaluate on held-out data before and after.
- Review security notes, and keep UIs off open networks.
Wrapping Up
There's no single best fine-tuning repo. TRL owns the training objectives, Unsloth owns single-GPU efficiency when your checkpoint is covered, Axolotl owns reproducible multi-GPU pipelines, and LLaMA-Factory owns the easiest on-ramp. The tools work together more than they compete.
Pick the one that matches your hardware and goal, test your exact model before you commit GPU time, and measure your own results. A fine-tuning stack proves itself on your data, not on anyone's chart.
Sources
[1]Particula Tech, "Unsloth vs Axolotl vs LLaMA-Factory vs TRL: How to Pick" (August 6, 2026; consultancy blog; versions, star counts, torchtune status, Unsloth coverage and parallelism, Axolotl parallelism keys, LLaMA-Factory advisories; I paraphrased and didn't verify its repository data): https://particula.tech/blog/unsloth-vs-axolotl-vs-llama-factory-vs-trl[2]DEV Community (Ultra Dune), "EVAL #003: Fine-Tuning in 2026: Axolotl vs Unsloth vs TRL vs LLaMA-Factory" — roundup with scenario recommendations; its version and star figures differ from [1]: https://dev.to/ultraduneai/eval-003-fine-tuning-in-2026-axolotl-vs-unsloth-vs-trl-vs-llama-factory-2ohg[3]xaytune documentation, "How xaytune Compares" (comparison page from the maker of a competing tool; interfaces, web UI, Unsloth as a backend): https://szaher.github.io/xaytune/comparison/[4]x-cmd, Unsloth install page (comparison with TRL, Axolotl, and LLaMA-Factory; multi-GPU status): https://x-cmd.com/install/unsloth[5]Techsy, "How to Fine-Tune an LLM" (framework table and QLoRA hardware rule of thumb): https://techsy.io/en/blog/how-to-fine-tune-llm
Related Articles
- Best GitHub Repositories for Reinforcement Learning (2026)
- Best GitHub Repositories for Machine Learning and AI (2026)
- Tianshou vs ElegantRL vs CleanRL vs Pearl: RL Library Comparison
- How to Run Research Code from a Paper's GitHub Repo
- How to Judge a GitHub ML Repo Before You Use It
- Evaluate RL Policy vs Baseline Heuristic