How to fine-tune an LLM in your browser (step by step)
Published 25 November 2026
Fine-tuning used to mean renting a cloud GPU, installing PyTorch, bitsandbytes and PEFT, and uploading your data to someone else’s server. With WebGPU, a modern browser can run the same math on the graphics card you already have. This guide walks through a complete run in Tunewerk Studio.
What you need
- Chrome or Edge 113+ on a desktop or laptop (Safari 26 and Firefox with WebGPU work too).
- A GPU with roughly 4 GB of memory for models up to 1B parameters, or 8 GB for 2–4B models with QLoRA.
- A dataset: a JSONL/CSV file or any instruction or chat dataset on the Hugging Face Hub.
1. Pick a model and a method
Open the studio and choose a model, for example Qwen/Qwen3.5-0.8B or HuggingFaceTB/SmolLM2-360M-Instruct. Leave the method on QLoRA: the base weights are quantized to 4-bit NormalFloat (NF4) while loading, which cuts the memory for the frozen model by roughly 8× compared with float32. The download comes straight from huggingface.co and is cached in your browser, so the second load takes seconds.
2. Add a dataset
Search the Hub (e.g. yahma/alpaca-cleaned) or drop in your own file. Tunewerk detects Alpaca, prompt/completion, question/answer and chat formats automatically and shows a preview so you can fix the column mapping. See how to prepare a dataset for details.
3. Train
Start with the “Balanced” preset: rank 16, alpha 32, learning rate 2e-4, cosine schedule and all linear layers as LoRA targets. Add a test prompt – the model answers it every few steps so you can watch it learn. A few hundred examples with a 0.5B model usually take minutes, not hours.
4. Test and export
Compare the fine-tuned model with the base model in the playground. Then export either the LoRA adapter (a few MB, PEFT format) or the merged model. Merging uses the original full-precision weights, not the 4-bit copy, so the exported model has the same quality as a QLoRA merge in Python. You can push both directly to your Hugging Face account.
from peft import PeftModel
from transformers import AutoModelForCausalLM
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-0.8B")
model = PeftModel.from_pretrained(base, "your-name/qwen3.5-0.8b-tunewerk-lora")Try it yourself – free, in your browser.
Open the studio