LoRA And QLoRA Explained: How to Fine-tune a Local AI Model Without a Data Center
Did you know that you can fine-tune a 7B model on your desktop with just 16 GB of VRAM?AI

Photo: Jacob Bobo
Pre-trained AI models are generalists by design. Ask one to write in your company's voice or follow specific coding standards, it will often miss the mark.
For a long time, fixing that meant one of two things. You could try to be careful with your prompts, repeating instructions every time. Or, you could attempt a full fine-tuning run, a process that traditionally needed a data center's worth of GPUs.
Low-Rank Adaptation, LoRA for short, turned that around completely. QLoRA, which is a quantized version of LoRA, can adapt any language model to your data with only a single graphics card running on your personal computer. If you want to know more about how working with LoRA and QLoRA is different from standard AI fine-tuning, here's what you need to know.
What Fine-tuning Actually Does
"Fine-tuning" loosely describes more than half of any customization techniques you can apply to your general-purpose LLM. But it's different from prompting or RAG.
Prompts can shape how a model performs a specific task by sharing instructions in the moment, during a period called inference time. It works for one-off requests, but the instructions need to be repeated every time if you want to get the same results.
RAG (retrieval-augmented generation), takes a different approach by pulling in outside information like documents or web content. It's very useful for keeping a model up-to-date with facts, but it doesn't change anything permanent about the model itself.
But with fine-tuning, you can actually adjust the model's internal parameters, like the numerical values (called weights) that determine how the model processes and generates text. The new behavior becomes part of the model permanently, instead of something layered on top each time you ask.
Until now, the biggest catch with fine-tuning has been cost. Updating every weight in a large model demands enormous amounts of GPU memory. For example, a typical 7B model (~7 billion individual weights) needs 100 to 120 GB of VRAM to fine-tune in full. That's the kind of hardware reserved for data centers, not personal workstations.
LoRA: How It Works
LoRA stands for Low-Rank Adaptation, a technique introduced by Microsoft researchers in 2021. The idea is to skip rewriting the whole model during fine-tuning and instead attach a smaller trainable patch beside it while the rest remains untouched.
The original model's weights stay frozen, meaning they don't change at all during training. LoRA then inserts two small additional sets of weights next to specific parts of the model, which are usually the attention layers responsible for figuring out which words in a sentence relate to which other words.
Only those small additions get trained, the rest of the model never moves. Because of that, you're training a sliver of the model's total parameters, often less than 1%, instead of all of them.
The Rank Parameter Explained
The one setting you'll run into immediately when using LoRA is called rank, usually written as r. Rank controls the size of the adjustment layers, which determines how much new information they can hold.
- r=8 or r=16 is the standard starting point for adapting a model's writing style or teaching it domain-specific vocabulary.
- r=64 or higher is worth trying for more complex tasks with larger, more varied datasets.
- Going higher doesn't automatically improve results. The original LoRA paper found that r=8 and r=64 performed similarly across many benchmark tasks, which suggests the quality of your training data matters more than cranking up the rank.
What This Means For Your GPU
Training these small adapter layers means you only need to store gradients (i.e., the signals the training process uses to figure out which direction to adjust each weight) for that small slice of parameters, not the entire model. The resulting savings show up directly in how much GPU memory, or VRAM, the job needs:
- Full fine-tuning a 7B model: 100 to 120 GB of VRAM.
- Fine-tuning the same model with LoRA: 28 GB of VRAM.
That's a meaningful drop in resources, since twenty-eight gigabytes can fit neatly on a single high-end consumer graphics card instead of a rack of data center hardware.
QLoRA: LoRA On a Memory Diet
QLoRA builds on LoRA by adding one more trick: quantization. If the term is new to you, quantization means compressing a model's stored weights from their usual 16-bit format down to a lower-precision format, like 4-bit, which roughly quarters the memory they take up. (Our quantization explainer covers the effect this has on output quality in more depth, if you want the longer version.)
QLoRA applies that compression specifically to the frozen base model, loading the original weights in a 4-bit format called NF4 (NormalFloat4) while losing as little accuracy as possible during compression. Meanwhile, the small LoRA adapter layers still train in standard 16-bit precision. That keeps the actual learning accurate even though the base model around it is heavily compressed.
QLoRA also adds something called paged optimizers, a method for shuffling temporary training data between GPU and system RAM during sudden memory spikes. This prevents a few stray operations from crashing the entire training run.
Stack all three approaches side by side and the numbers look like this:
- Full fine-tuning a 7B model: ~100 to 120 GB of VRAM.
- Fine-tuning with LoRA: ~28 GB.
- Fine-tuning with QLoRA: ~12 GB.
It wouldn't be a stretch to argue that QLoRA has become the default for fine-tuning AI at home. The quality gap between QLoRA and standard LoRA tends to be very small on most real-world tasks, a gap that only keeps shrinking as the underlying methods mature.
A Few Tools Worth Knowing
There are a number of dedicated platforms that can help you fine-tune an AI model, but not all of them support LoRA or QLoRA. Luckily, these three tools cover most of what you'll need, depending on how hands-on you want to get.
Unsloth
Unsloth is built specifically to make LoRA and QLoRA training faster and lighter on memory. It uses custom code written to talk directly to GPU hardware, rather than relying on general-purpose libraries, and the project reports roughly 2x faster training with 70% less VRAM use compared to standard methods. Moreover:
- Unsloth supports more than 500 models, including Llama, Mistral, Gemma, and Qwen.
- Unsloth Studio, the project's web interface, lets you pick a model, upload your data, and start training without writing a line of code.
- It runs on Windows, Linux, macOS (including Apple Silicon), NVIDIA, Intel, and even CPU-only setups.
Unsloth is the fastest path from "I have an idea" to "I have a trained adapter," especially on a single GPU.
LLaMA Factory
LLaMA Factory takes a similar no-code approach, but through a different interface called LlamaBoard. You select your base model, upload a dataset, set a handful of options through dropdown menus, and start training, all from a browser tab.
- Supports more than 100 models and every major fine-tuning method, including LoRA, QLoRA, and full fine-tuning.
- Also offers a command-line option if you outgrow the web interface.
- A strong choice for a first fine-tuning run, since the interface makes each setting visible instead of buried in a configuration file.
Axolotl
Axolotl trades the point-and-click interface for a configuration file, written in YAML (a plain-text format for structured settings), where you define your entire training setup in one place. It's slightly less accessible than a no-code UI, but with some incredible advantages:
- Supports multi-GPU training, useful if you have more than one card to work with.
- Includes production-grade options like DPO and GRPO, methods for teaching a model preferences and judgment calls, not just facts.
- Has a steeper learning curve than the other two tools, but more flexibility once you're past the basics.
If you want a repeatable, scriptable setup, or you're scaling past a single GPU, Axolotl is the one to learn.
What Hardware You Actually Need
GPU memory is the main constraint for fine-tuning and QLoRA has lowered that bar considerably. A 16 GB graphics card was once considered too small for serious LLM fine-tuning, but it's now a reasonable starting point for 7B-class models. If you map popular GPU models to their fine-tuning capabilities using LoRA and QLoRA, here's how it adds up:
| GPU | VRAM | LoRA (up to) | QLoRA (up to) | Best for |
|---|---|---|---|---|
| RTX 4060 Ti 16GB | 16 GB | ~7B (tight) | Up to 13B | First fine-tuning experiments |
| RTX 4070 Ti Super 16GB | 16 GB | ~7B (tight) | Up to 13B | Mid-range; faster iteration |
| RTX 4090 24GB | 24 GB | 7B–13B | Up to 30B (with care) | Enthusiast sweet spot |
| RTX 5090 32GB | 32 GB | 13B at full precision | 30B+ comfortably | Larger models, less reliance on quantization |
A few things worth keeping in mind:
- System memory matters too. Plan for at least 32 GB of system RAM, with 64 GB recommended. Your dataset gets loaded and preprocessed in main memory before training ever touches the GPU.
- These VRAM figures assume a batch size of 1 (processing one training example at a time) and a sequence length around 2,048 tokens. A token is roughly three-quarters of a word, the unit models actually process text in. Your real usage will vary.
- 70B-class models are out of reach for a single consumer card, even with QLoRA. That tier needs multiple GPUs or a cloud rental.
If you're picking one card for general-purpose fine-tuning, the RTX 4090's 24 GB remains the practical sweet spot for most home setups. The RTX 5090's 32 GB is worth the jump if you're regularly working with 13B-and-up models and don't want to lean on quantization just to make a model fit.
Other Things You'll Need Besides a GPU
Hardware solves half the problem. But the other half has to do with what you feed the model.
- Training data: Roughly 200 to 1,000 examples is typically enough for adapting a model's tone or style. Classification-style tasks usually want 500 to 5,000. A smaller, cleaner dataset will beat a sprawling, messy one almost every time.
- A base model: Start with an instruction-tuned model, one already trained to follow directions, as opposed to a raw, untrained base model. Llama 3.1 8B and Mistral 7B are both common starting points, since they respond to fine-tuning more predictably than their raw counterparts.
- A dataset format: Most tools expect your data as instruction-and-response pairs in JSON or CSV files. Both Unsloth and LLaMA Factory can build that structured dataset automatically from source documents like PDFs or spreadsheets, which removes a real barrier if you're not used to formatting training data by hand.
Why This Matters
Fine-tuning used to be the one part of local AI that genuinely required institutional resources. LoRA and QLoRA changed that equation enough that the same GPU running your models can now also train them.
But it isn't just about memory savings. These methods also improve the speed of iteration: train an adapter, test it, adjust the rank or swap in a few more examples, and train again. That loop, running entirely on your own hardware, makes fine-tuning something an individual can finish in a weekend rather than schedule around a cloud budget.
For more on getting the most out of your local setup, check out our guides on quantization and picking the right local model for your available memory.
More from MC News
- Run AI Locally: The Best LLMs for 8GB, 16GB, 32GB Memory and Beyond
- Quantization Explained: Why the Same LLM Gives Better Results on High-End Hardware
- Why Context Length, Not AI Model Size, Is Your Biggest VRAM Problem
- How to Use LM Studio to turn your PC into an AI Server
- Why VRAM and Memory Bandwidth are Key for Powering Local AI
- Keyboard 101: Intro to Computer Keyboards
- Fix It Yourself: Talking to iFixit on Why Repairable Tech Matters
- The Local LLM Your Laptop's Been Waiting For
- Gemma vs Qwen: Which Local AI is Best?
Ritoban Mukherjee is a journalist and product reviewer specializing in B2B tech, AI, and software-as-a-service platforms. He's a contributing writer at TechRadar and ZDNET, with previous bylines in Tom's Guide, Gizmodo, Mental Floss, etc.
Comment on This Post
See More Blog Categories
Recent Posts
Why Apple Shortcuts Is the Best Mac Local AI Feature You're Not Using
Shortcuts is a powerful automation tool built into Macs, iPhones, and iPads, and this year's Siri AI upgrade made it easier than ever to use.
Continue Reading About Why Apple Shortcuts Is the Best Mac Local AI Feature You're Not Using
