← Back to articles Blog

Unsloth: 2x Faster LLM Fine-Tuning at Half the Memory

Emmanuel Ekunsumi · 5 min read · 2026-07-23

Unsloth is an open-source Python library that dramatically accelerates LLM fine-tuning — delivering 2x faster training speed and 60% less memory usage compared to standard Hugging Face + PEFT approaches. It's become the default fine-tuning tool for developers who want to run LoRA or QLoRA training on consumer hardware without hitting VRAM limits.

What Unsloth actually does

Unsloth optimizes the core computational bottlenecks in transformer fine-tuning through three main techniques:

Unsloth vs standard LoRA training

UnslothStandard PEFT/LoRA
Training speed2x fasterBaseline
VRAM usage~40% of baselineBaseline
Model qualityIdentical (no approximations)Identical
Supported modelsLlama, Qwen, Mistral, Gemma, Phi, DeepSeek, +moreAll models
Hardware requiredNVIDIA GPU (CUDA)NVIDIA GPU (CUDA)
LicenseApache 2.0 (core), AGPL (some extensions)Apache 2.0

Getting started

pip install unsloth

from unsloth import FastLanguageModel
import torch

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="unsloth/llama-3.2-8b-bnb-4bit",
    max_seq_length=2048,
    dtype=None,
    load_in_4bit=True,
)

# Add LoRA adapters
model = FastLanguageModel.get_peft_model(
    model,
    r=16,
    target_modules=["q_proj", "v_proj", "k_proj", "o_proj"],
    lora_alpha=16,
    lora_dropout=0,
    bias="none",
    use_gradient_checkpointing="unsloth",
)

# Then train normally with SFTTrainer or your own loop

What you can fine-tune on consumer hardware with Unsloth

ModelGPU needed (standard)GPU needed (Unsloth)
Llama 3.2-8BRTX 3090 (24GB)RTX 3060 (12GB)
Llama 3.3-70B2x A100 80GB1x A100 80GB
Qwen2.5-32B2x RTX 40901x RTX 4090
Mistral-7BRTX 3080 (10GB)RTX 3060 Ti (8GB)

Unsloth for inference

Unsloth also accelerates inference via its GGUF export pipeline. After fine-tuning, you can export directly to quantized GGUF for use with llama.cpp or Ollama:

model.save_pretrained_gguf("my-model", tokenizer, quantization_method="q4_k_m")
# Outputs my-model-unsloth.Q4_K_M.gguf — ready for Ollama or llama.cpp

The token cost angle

Faster fine-tuning means lower cloud GPU costs. A fine-tuning run that takes 4 hours on standard LoRA takes ~2 hours with Unsloth — halving your GPU rental bill. For iterative fine-tuning workflows where you run many experiments, this compounds significantly.

And a well fine-tuned model can replace verbose system prompts — baking behavior into weights rather than injecting it as context tokens on every call. See our guide on LLM token waste for how this reduces per-call costs.

Track inference costs after fine-tuning

Tokoscope measures token costs before and after fine-tuning so you can quantify the actual savings. Free to start.

Get started free →