Fine-Tune Qwen3.8-27B on One RTX 4090 with Unsloth (2026): The Real VRAM Floor, the Full QLoRA Recipe, and the 17GB Fine Print
TL;DR: Unsloth had Qwen3.8-27B training support running the day the weights landed, and a single 24GB card really can QLoRA-tune a 27B — the working set is 17–19GB in the best case. But the “17GB RAM/VRAM” number making the rounds is Unsloth’s inference figure, not a training budget, and a 16GB card is out entirely. On 24GB, the recipe below works tonight.
What you’ll be able to do:
- QLoRA-tune Qwen3.8-27B on a 24GB card with a LoRA config that fits — rank, alpha, target modules, and the two flags that buy back the most VRAM
- Export the merged result to a Q4_K_M GGUF and serve it in Ollama like any other local model
- Price a training run honestly: about 8¢/hour of electricity on your own RTX 4090 versus $0.34/hour renting the same card
Honest take: if you already own a 24GB card, this is the cheapest capability upgrade of the year — pennies per run for a model tuned to your corpus. If you own 16GB, do not buy a card for one experiment: rent a cloud 4090 for an evening, and only start shopping if fine-tuning becomes a habit.
Qwen3.8-27B’s weights went live on August 14, 2026, and Unsloth’s support was effectively day-zero: their Qwen3.8 docs and 4-bit uploads appeared within a day, and the same-day v0.1.800 release of their desktop app already listed Qwen3.8-27B training support. The pitch that made the rounds on r/LocalLLaMA — a 27B you can fine-tune on hardware you already own — is real. The numbers attached to it in reshares mostly are not, so before the recipe, the corrections.
This is the Python/notebook path. If you want a GUI that hides all of it, that’s Unsloth Desktop; if you want the three-year ownership math instead of one run’s worth, that’s the QLoRA 4090-vs-RunPod cost breakdown.
The 17GB claim, decoded
Three different numbers are circulating, and they answer three different questions:
“Runs locally on 17GB RAM/VRAM” — true, for inference. That figure comes from Unsloth’s own announcement and describes running the model on their 4-bit Dynamic quants. It matches the Q4_K_M file’s 16.8GB plus minimal cache. It says nothing about training.
“2× faster with 70% less VRAM” — that’s the generic banner, not the Qwen3.8 measurement. Unsloth’s marketing has carried a version of that line for years (their PyPI summary still says “2-5X faster”). For Qwen3.8 specifically, their docs claim ~1.5× faster training with ~50% less VRAM than Flash Attention 2 setups, with no accuracy loss. Still a real advantage — it’s the reason a 27B fits a consumer card at all — just smaller than the reshared number.
What QLoRA training actually needs: 17–19GB, on a card with more than that. Yotta Labs’ setup guide puts a 4-bit Qwen3.8-27B fine-tune at 17–19GB and calls a 24GB card the realistic floor for a comfortable run — and Unsloth’s own requirements table brackets it the same way: QLoRA on a 14B wants ~8.5GB, a 32B wants ~26GB, and a 27B lands between. Note what that bracket means: a 32B fine-tune already exceeds 24GB. The 27B is close to the largest model this card class can train.
So the tier verdict, one line per card:
| Card | QLoRA Qwen3.8-27B? | Why |
|---|---|---|
| RTX 4090 / RTX 3090 (24GB) | Yes | 17–19GB working set leaves real headroom at short context |
| RTX 5090 (32GB) | Yes, comfortably | Room for longer sequences or bigger batches |
| RTX 4080 / 5070 Ti (16GB) | No | The 4-bit weights alone are ~16GB before a single gradient exists |
| Anything at 12GB | No — but a 14B fine-tune fits in 8.5GB | See the 24GB tier guide for what to run instead |
16-bit LoRA (no quantization) is not on this menu at any consumer tier: Unsloth’s requirements sheet puts a 32B at 76GB for 16-bit LoRA, and a 27B is not meaningfully different. That’s rented-A100 territory.
One honesty note before the recipe: Unsloth has not published an official notebook or measured training-VRAM table for the 27B specifically as of August 29 — the fine-tuning docs for this exact checkpoint are thin, and the numbers above are the best independently corroborated figures available. Treat 17–19GB as planning guidance, watch nvidia-smi on your first run, and expect the flags in the OOM section below to matter.
Setup: versions that are current this week
Unsloth moves fast — the current PyPI release is unsloth 2026.8.22, published August 27, 2026 (PyPI), and it supports Python 3.9–3.14. On a machine with a working CUDA PyTorch install:
pip install unsloth
# pulls unsloth 2026.8.22 + trl, peft, bitsandbytes, accelerate
python -c "import unsloth; print(unsloth.__version__)"
# 2026.8.22
You also want roughly 60GB of free disk: ~16GB for the 4-bit base download, the same again for the merged model, plus the GGUF export.
The base checkpoint to load is Unsloth’s pre-quantized 4-bit upload, unsloth/Qwen3.8-27B-unsloth-bnb-4bit — loading their bnb-4bit repo directly skips quantizing the full-precision weights yourself and saves you a 56GB download. Qwen3.8 registers as the qwen3_5 architecture under the hood; you don’t need to care, but it explains why the loader works on a model newer than your transformers version.
The recipe
Because there’s no official 27B notebook yet, this follows Unsloth’s standard QLoRA pattern (the same shape as their Qwen3 tutorials), with hyperparameters from their LoRA guide. If a cell disagrees with Unsloth’s Qwen3.8 page when you read this, trust their page — it’s the living document.
Load the model:
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "unsloth/Qwen3.8-27B-unsloth-bnb-4bit",
max_seq_length = 2048, # raise later; every token of context costs VRAM
load_in_4bit = True,
)
Attach the LoRA adapter:
model = FastLanguageModel.get_peft_model(
model,
r = 16, # 16 is plenty for style/format tuning;
lora_alpha = 32, # go 32-64 only for hard domain shift + 10k+ examples
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj"],
use_gradient_checkpointing = "unsloth", # ~30% less VRAM vs standard
)
The two decisions that matter, per Unsloth’s hyperparameter guidance: keep lora_alpha at 1–2× the rank, and target all seven linear projection layers rather than just attention — full-linear coverage consistently trains better for minimal extra VRAM. Rank 16 trains only ~0.1–0.5% of the model’s weights; that’s the whole reason this fits.
Your dataset goes in as instruction/conversation pairs — Alpaca format (instruction/input/output columns) or ShareGPT-style conversations both work, applied through the tokenizer’s chat template. A few hundred high-quality examples of your docs, code style, or house Q&A format beat ten thousand scraped ones. Then train:
from trl import SFTTrainer, SFTConfig
trainer = SFTTrainer(
model = model,
tokenizer = tokenizer,
train_dataset = dataset,
args = SFTConfig(
per_device_train_batch_size = 1, # on 24GB, batch 1 is not a suggestion
gradient_accumulation_steps = 8, # effective batch 8
num_train_epochs = 1, # 1-3; more usually just memorizes
learning_rate = 2e-4,
output_dir = "outputs",
),
)
trainer.train()
While this runs, nvidia-smi on a 4090 should show memory usage in the 17–19GB band at 2048 context and the card pulling near its power limit — measured LoRA fine-tuning loads on a 4090 sit around 410–420W against the 450W spec.
The error you’ll actually hit: CUDA out of memory
The 27B leaves maybe 5GB of slack on a 24GB card, and three things eat it: sequence length, batch size, and whatever else is using your GPU. When training dies with torch.OutOfMemoryError: CUDA out of memory, work this list in order:
- Check what else holds VRAM. A desktop session, a browser with hardware acceleration, and an idle Ollama model can pin 2–3GB combined.
nvidia-smibefore training;ollama stopthe loaded model; on a dual-GPU box,CUDA_VISIBLE_DEVICESthe training onto the empty card. - Drop
max_seq_length. VRAM cost scales with context. 2048 is the safe starting point on 24GB; 4096 may fit with everything else trimmed; 8192 mostly won’t. - Confirm
use_gradient_checkpointing = "unsloth"made it into your config — it’s the single biggest lever, ~30% of training VRAM. - Offload the embeddings. Qwen3.8’s untied input embedding is large, and passing
offload_embedding = Trueat load keeps it in system RAM instead of VRAM — the difference between fitting and not on a card that’s also driving a monitor. - Batch stays at 1. Raise
gradient_accumulation_stepsinstead; it costs time, not memory.
If it still doesn’t fit, you’re on a 16GB card and the honest fix is a different plan, not a different flag — see the cost table below, or tune a 14B instead (8.5GB floor) and keep your evening.
Export to GGUF and serve it in Ollama
Unsloth merges the adapter and converts to GGUF in one call:
model.save_pretrained_gguf("qwen38-27b-mytune", tokenizer,
quantization_method = "q4_k_m")
Then point an Ollama Modelfile at the .gguf file the export wrote:
FROM ./qwen38-27b-mytune/<exported-file>.Q4_K_M.gguf
ollama create qwen38-mytune -f Modelfile
ollama run qwen38-mytune
The result behaves exactly like the stock Qwen3.8-27B at the same quant — ~41 tok/s on an RTX 3090, ~17GB to serve — because it is the same architecture with your deltas baked in. It also slots straight into Cline or Cursor as a local backend; the coding-stack side of that lives at aicoderscope.com.
What a training run costs, everywhere you could run it
How long a run takes depends on your dataset, but the reference points are consistent: a clean 13B QLoRA fine-tune on a small instruction set is a 3–4 hour job on a 4090, and a 27B at the same task is roughly a doubling — call it an evening, 6–8 hours, as an estimate rather than a measurement. Price that evening three ways:
| Where | Rate | 8-hour run | The catch |
|---|---|---|---|
| Your RTX 4090, at the wall | ~420W × 18.44¢/kWh ≈ 7.7¢/hr | ~$0.62 | You bought a ~$2,268 used card first |
| RunPod, rented RTX 4090 | $0.34/hr Community, $0.69 Secure | $2.72–$5.52 | Data upload, pod setup, nothing owned |
| RunPod, A100 80GB | $1.39/hr PCIe | ~$11 (finishes faster) | Overkill unless you need 16-bit or long context |
Electricity math uses the 18.44¢/kWh US average and the measured 410–420W training draw; your state will move it a few cents either way, and the full 24/7 power-bill math is its own article. One trick worth knowing on hot days: power-limiting a 4090 to 240W keeps 89.2% of fine-tuning throughput at 55% of the power — fine-tuning is not bandwidth-starved the way inference is. Your own electricity rate and run frequency move the first row of that table a long way, and the local vs cloud cost calculator will redo the whole comparison with your numbers.
The pattern is the one our 100-run cost analysis found: per-run electricity is pocket change, so if you already own the card, experiments are effectively free and you should run many. If you’d have to buy the card, used 4090s average $2,268 — around 6,600 rented 4090-hours at Community rates — so occasional tuning rents (RunPod) and habitual tuning buys (the buying guide ranks the 24GB options). Unsloth’s docs also point at free Kaggle notebooks (30 GPU-hours/week on 2× Tesla T4) — fine for testing your dataset pipeline on a smaller model, but 2×16GB of 2018 silicon is no place to train a 27B.
Should you fine-tune at all? (vs RAG)
The uncomfortable question first: most people reaching for fine-tuning want RAG. If the goal is the model should know my documents, retrieval wins — it updates instantly when documents change, cites its sources, and costs nothing to iterate. Fine-tuning wins when the goal is the model should behave differently: house code style, a rigid output format, domain vocabulary it keeps fumbling, a persona, tool-call patterns. Adapters teach behavior; they’re a lossy, expensive way to store facts.
The good news is that at 7.7¢/hour on owned hardware, being wrong is cheap. Tune on 500 examples, A/B it against the base model plus a good system prompt, and let the eval decide. The broader FOSS fine-tuning ecosystem — datasets, eval harnesses, the Llama-side equivalents of this recipe — is aifoss.dev’s beat.
FAQ
Can I fine-tune Qwen3.8-27B on an RTX 3090 instead of a 4090? Same 24GB, same fit — the 3090 trains the same config, just slower (older silicon, lower sustained clocks). If you’re buying for this, the 3090 remains the cheapest 24GB ticket.
Does the 17GB figure mean my 16GB card almost works? No. 17–19GB is the best-case training working set, and the 4-bit weights alone are ~16GB before optimizer state, gradients, or activations exist. 16GB cards are out for the 27B; they’re solid 14B fine-tuning machines (8.5GB floor).
Can I fine-tune the vision side of Qwen3.8-27B with this recipe? This recipe is text SFT. Multimodal training support exists in Unsloth’s stack but the 27B-specific documentation is thin as of late August 2026 — if vision tuning is the goal, start from their current Qwen3.8 docs rather than adapting this.
How much data do I need? Hundreds of good examples, not thousands of mediocre ones. Rank 16, 1 epoch, 500–2,000 curated pairs is the sane first run. Save rank 32–64 and multi-epoch training for a real domain shift with 10k+ examples, per Unsloth’s own hyperparameter guidance.
Is the fine-tuned model slower to run? No — after the GGUF merge it’s byte-for-byte the same architecture and quant as stock, so all the stock speed numbers carry over.
Recommended Gear
- RTX 4090 — the fastest single consumer card that trains this model
- RTX 3090 — same 24GB fit at less than half the used price, slower per step
Sources
- Qwen3.8 model docs — Unsloth Documentation
- Qwen3.8 fine-tuning guide — Unsloth Documentation
- LoRA hyperparameters guide — Unsloth Documentation
- Unsloth system requirements (QLoRA/LoRA VRAM floors) — Unsloth Documentation
- unsloth 2026.8.22 — PyPI
- Qwen3.8-27B “runs locally on 17GB RAM/VRAM” — Unsloth AI on X
- How to fine-tune Qwen3.8-27B with Unsloth: hardware, setup, export — Yotta Labs
- Qwen3.8-27B with Unsloth: run, quantize, or fine-tune — OrcaRouter
- RTX 4090 fine-tuning guide (QLoRA, LoRA, full SFT) — GigaGPU
- LLM fine-tuning on RTX 4090: 90% performance at 55% power — Maxim Saplin, DEV Community
- A100 GPU price comparison 2026 — RunPod
- RunPod pricing vs Thunder Compute (H100, A100, RTX 4090) — Thunder Compute
- Used RTX 4090 price tracker — ResalePrices
- Electricity rates by state — ChooseEnergy
Last updated August 29, 2026. Prices, VRAM figures, and library versions change quickly; verify current rates and Unsloth’s live docs before committing to hardware.
Was this article helpful?
Thanks for the feedback — it helps improve future articles.
Need hands-on help?
I offer 1-on-1 technical consulting for local AI setup, GPU selection, and AI coding tool configuration — same topics covered on this site.
Book a session — $49 / hour →