Back to blog
June 20, 2026·5 min read·1,163views

Fine-Tuning Your First LLM with Unsloth (Yes, on a Free GPU)

Parvesh Sainiby Parvesh Saini
Fine-Tuning Your First LLM with Unsloth (Yes, on a Free GPU)

For most of my time building with LLMs, fine-tuning lived in a mental bucket labeled "things other people do." People with GPU clusters. People with ML PhDs. I built everything with prompting and RAG, and mostly that was correct.

Then I had a problem prompting couldn't fix cleanly, spent a weekend with Unsloth on a free Colab GPU, and came out the other side with a small model that did exactly what I wanted. The surprise wasn't that it worked. It's how little ceremony it took.

What Unsloth actually does

Unsloth is an open-source library that makes fine-tuning LLMs dramatically cheaper and faster. The headline numbers (roughly 2x faster training with a fraction of the memory) come from the founders hand-writing the GPU kernels (in Triton) for the operations that dominate training, instead of relying on the generic implementations everyone else uses.

Why that matters practically: memory is the wall. Fine-tuning even a small 8B-parameter model normally wants more VRAM than any consumer GPU has. Unsloth combines its optimized kernels with QLoRA (a technique where you freeze the original model in compressed 4-bit form and train only a small set of adapter weights on top) and suddenly the whole job fits in the 16GB of a free Colab T4.

That's the unlock. Not "faster for labs." It's "possible for you."

When fine-tuning is the right tool (and when it isn't)

This is the part most tutorials skip, and it's where beginners burn their time. The decision rule I use:

  • New knowledge → RAG, not fine-tuning. If the model needs to answer from your documents, retrieve them at query time. Fine-tuning is a terrible database: facts baked into weights go stale and blur.
  • New behavior → fine-tuning. If the model needs to respond differently (a consistent output format, a specific tone, domain jargon used correctly, reliable structured output) that's what training data teaches best.
  • A big model does it well but slowly/expensively → fine-tune a small one. This is the workhorse case: use a frontier model to generate a few thousand quality examples of the task, then train an 8B model to replicate it. You trade a small accuracy loss for something you can run locally, privately, and essentially for free.

My first real run was the third case: an extraction task (messy text in, clean JSON out) that a frontier model handled fine at a per-call cost that annoyed me at volume. Prompting a small model got me most of the way but kept producing format drift. A fine-tune on a few thousand examples fixed the drift almost completely.

What the weekend actually looked like

The honest timeline, because I think it's useful calibration:

Hour one: the notebook. Unsloth publishes ready-made Colab notebooks for every major open model: Llama, Qwen, Gemma, Mistral. You pick one, and the loading-and-training scaffolding is already written. I changed maybe ten lines.

Most of the time: the dataset. This is the real work, and it's data work, not ML work. Formatting examples into instruction/response pairs, throwing out ambiguous ones, making sure the chat template matched the model. The single biggest lesson: a thousand clean examples beat ten thousand sloppy ones. Every bad example is you teaching the model the wrong thing, on purpose, repeatedly.

Training: anticlimactic. An hour or two on the free T4. Loss goes down. You check outputs on held-out examples, not vibes. I kept fifty test cases the model never saw and compared before/after.

The good part: deployment. Unsloth exports straight to GGUF, the format Ollama and llama.cpp use. ollama run on my own laptop, and the model is just... mine. No API key, no per-token bill, works on a plane. That moment is genuinely a little addictive.

The gotchas that got me

  • Chat template mismatches. Every model family formats conversations differently, and training with the wrong template silently produces a model that seems mysteriously stupid. Unsloth has helpers for this. Use them rather than hand-rolling strings.
  • Overfitting on small data. Train too many epochs on a small dataset and the model memorizes instead of generalizing. Watch your evaluation examples, not the training loss.
  • Skipping the baseline. Before training anything, seriously try to prompt your way there and write down how far you got. Fine-tuning without a baseline means you can't tell whether the weekend was worth it.

Reading the source

Because Unsloth sits at the intersection of "friendly notebook API" and "hand-tuned GPU kernels," the codebase is a fun read, high-level Python that quietly swaps in optimized implementations underneath the Hugging Face stack. Digging around in it led to a couple of merged PRs, and the maintainers (it's famously a two-brother team plus community) are quick and generous with reviews. Open-source projects this leveraged, tiny team, enormous usage, tend to genuinely appreciate contributions.

Your starter recipe

  1. Pick a small model (Llama 3.1 8B or Qwen 8B are safe defaults) and open Unsloth's Colab notebook for it.
  2. Choose a narrow task: one format, one behavior. "Extract fields into this JSON schema" is perfect. "Be a better assistant" is not.
  3. Build 500–1,000 clean examples. Use a frontier model to help generate them, then review a sample by hand.
  4. Hold out 50 examples. Evaluate before and after on those, mechanically.
  5. Export to GGUF, run it in Ollama, and enjoy owning a model.

The broader shift Unsloth represents is the same one open source always brings: a capability that was institutional becomes personal. Fine-tuning used to be a budget line item. Now it's a weekend, a free GPU, and a dataset you cared enough to clean.


Join the newsletter

Get the latest updates straight to your inbox.

Your privacy is important. I never share your email.

© 2026 Parvesh Saini. All rights reserved.