How to bake a fine-tune into a local AI model
A new guide shows how to merge a LoRA adapter into a model in GGUF format so it can run locally. According to the guide, it takes about 80 minutes on a laptop with 16 GB of RAM.

If you have fine-tuned a language model with a so-called LoRA adapter, the fine-tuning lives in a small extra file alongside the large model. To use it all as a single file in a local tool such as Ollama, the two must be merged. A guide on shattered.io, written by Tom Vance and updated Nov. 18, 2026, walks through the process in 12 steps.
Time and prerequisites
According to the guide, the process takes about 80 minutes on a laptop with 16 GB of RAM, and the example uses a model with 1.5 billion parameters. You need Python 3.12, llama.cpp v1.0.0, PEFT, Transformers, PyTorch, CMake 3.28 or newer, and about 15 GB of disk space. The timings and the version come only from the guide.
The process in broad strokes
First you create a Python virtual environment, install the packages and download the base model and adapter. Then you read the adapter's configuration and run a check meant to catch conditions that can block the merge, such as DoRA vectors (a variant of LoRA) or modified embedding tensors.
Next, the adapter is merged into a 16-bit base model. The guide suggests comparing the logits of the last tokens for three test prompts between the base plus adapter and the merged model. Differences below 1.0 count as a successful merge. According to the guide, larger differences point to the wrong base model or a missing tokenizer.
After that, llama.cpp is built, and the model is converted to GGUF in bf16 format and quantized to Q4_K_M. Quantization means the model is made smaller by using fewer digits per number. For a model with 1.5 billion parameters, the bf16 file is about 3.0 GB and the Q4_K_M file about 1.0 GB. Finally, the model is tested with llama-server and imported into Ollama with a chat template that must match the training format.
Pitfalls
According to Tom Vance, with QLoRA adapters you should merge into the original 16-bit weights, because merging in 4-bit adds rounding noise that later quantization amplifies. You should also always quantize from the bf16 master and never quantize an already quantized file again.
The guide also warns that an adapter trained on an Instruct variant and merged into a base variant produces plausible but wrong answers. If the tokenizer is missing or the chat template is wrong, the model behaves as if it had no fine-tuning. It also reminds readers that a merged model inherits the base model's license terms.
Alternative: Keep the adapter separate
In step 12, the adapter alone is converted to GGUF and loaded at runtime. It takes up megabytes instead of gigabytes, but adds extra computation when the model responds. According to the guide, the method is only safe for plain LoRA/QLoRA without DoRA, modules_to_save or embeddings.
llama.cpp also has its own tool, llama-export-lora, which merges one or more GGUF adapters into a GGUF base model. With --lora-scaled you can blend several adapters in specific ratios, such as 0.5 and 0.5. A discussion from July 2024 also shows that convert_lora_to_gguf.py can turn a PEFT adapter into GGUF; one user confirmed that it worked. The discussion is old and does not necessarily reflect current tools.
Read also



