Model files, adapters and conversion
GGUF, safetensors, ONNX and LoRA adapters — converting between them, checking what you downloaded, and which conversions do not exist.
A model on disk is a container format wrapped around a particular way of storing numbers, and almost every frustrating hour in local inference comes from confusing the two. GGUF, safetensors and ONNX are containers: they say where a tensor starts, what shape it is and what it is called. Q4_K, GPTQ, AWQ and bf16 are storage schemes: they say what the bytes in that tensor mean. A conversion that only changes the container is mechanical and lossless. A conversion that has to change the storage scheme is a re-quantization, and it can only be done well from weights that have not been quantized yet.
These pages work from that distinction outward. They cover loading and switching LoRA adapters in the runtimes that accept them, the arithmetic that decides how a checkpoint gets split into shards, the two exports most people need — safetensors and ONNX — and the conversions that look reasonable and do not exist, with the reason stated rather than the error repeated. Where a command line is given it is the documented one at the time of writing, and the mechanism underneath it is given too, because the flags move and the mechanism does not.
Loading a LoRA Adapter in llama.cpp on Top of a GGUF
Convert a PEFT adapter to GGUF, apply it to a quantized base at load time, and prove the output changed.
9 min read
Switching LoRA Adapters in Ollama
Two Modelfiles over one base with different ADAPTER weights, and what Ollama actually does with them at create time.
8 min read
Applying a LoRA at Inference Time Without Merging It
What the extra low-rank matmul costs in arithmetic and memory, derived from rank and layer dimensions.
9 min read
LoRA Adapter Compatibility Across Quantization Formats
Which adapter file each local runtime accepts, and why the adapter's format is bound to the loader rather than to the base's quantization.
9 min read
Testing Whether a LoRA Adapter Is Actually Doing Anything
A differential test that separates a loaded adapter from an applied one, for the failure that prints no error.
9 min read
Why GPTQ Weights Usually Cannot Be Converted Directly to GGUF
The tensor-layout mismatch behind the conversion error, and why the fix is to start from the original fp16 weights.
9 min read
Converting a PyTorch Checkpoint to Safetensors
Turning a .bin checkpoint into .safetensors, verifying every tensor matches, and handling the shared-memory error.
9 min read
Splitting and Merging Multi-Part GGUF Files
Using llama.cpp's gguf-split to shard a large GGUF and put it back, and why cat does not work.
8 min read
The Math Behind Splitting a Model Checkpoint Into Shards
Deriving shard count and per-shard size from parameter bytes and a size cap, and why the answer is a lower bound.
9 min read
Converting a Hugging Face Model to ONNX
Exporting a transformers model with optimum-cli, reading the validation output, and handling models over 2 GB.
9 min read
Extracting a LoRA Adapter's Weights From an Already-Merged Model
Why recovering an adapter needs the original base to subtract, and why the result is an approximation rather than the original.
9 min read
Checking a GGUF File's Metadata Before You Trust It
Read a GGUF's architecture, training context length, quantization mixture and tokenizer straight out of its header, without loading a single tensor.
9 min read
Why a Model's File Size Never Exactly Matches Its Parameter Count
Where the gap between bytes-per-parameter arithmetic and the number your file manager reports actually comes from, worked through with published figures.
10 min read
Verifying a Local LLM Setup Makes Zero Network Calls
Four ways to demonstrate that a local model stack is not talking to anything, from weakest to strongest, ending in a test that cannot give a false pass.
10 min read
Local Inference as Part of a HIPAA Compliance Strategy
Running the model on your own hardware removes one disclosure and none of the Security Rule; here is which obligations it touches and which it leaves entirely intact.
11 min read
What Local Inference Cannot Guarantee About Privacy
Local inference is a claim about one network hop, not about the life of your data; here is everything that hop leaves untouched.
10 min read
Setting Up a Home Lab for Local LLMs
Which hardware tier you actually need, derived from weight size and KV cache arithmetic rather than from a shopping list.
11 min read
Running a Local LLM on a NAS
Get a small quantized model serving from a Synology or Unraid box, with the memory-bandwidth ceiling worked out before you start so the result is not a surprise.
10 min read
Local LLMs for a Small Business Without a Cloud Budget
The break-even arithmetic for buying hardware instead of paying per token, including the two costs that usually decide it and never appear in the comparison.
11 min read
Getting New Model Weights Onto an Air-Gapped Machine
The checksum-verified physical-media workflow for updating a model that is already deployed behind an air gap, including the rollback you will need.
10 min read
Does Running a Model Locally Actually Stop It Training on Your Data
No gradient step happens during inference wherever it runs, which makes the local/hosted distinction irrelevant to this particular fear — and relevant to a different one.
9 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Local inference errors, string by string
- Running local models day to day
- Testing code that calls an LLM
- Snapshot and property testing for model output
- Regression suites for prompts
- Eval gates in CI
- Flaky tests against a model
- Determinism and the cost of testing
- Contract and streaming tests
- Testing tool calls and retrieval
- Inference, serving & latency
- Rolling out a prompt change
- Testing AI systems in practice
- Forecasting a time series
- Machine learning on tabular data
- Geospatial data and models
- Understanding audio that is not speech
- Understanding video
- Core computer vision tasks
- Machine learning on graphs
- Point clouds and 3D
- Evaluation, benchmarks & LLM-as-judge
- Sensor and IoT data
- Logs and event streams
- Models over biological sequences
- Machine learning on molecules
- Embedding and searching code
- Extracting invoices and purchase orders
- Receipts, statements and tax forms
- Insurance policies and contracts
- Deeds, court filings and patents
- Extracting from medical records
- Observability & LLMOps
- CVs, certificates and identity documents
- Shipping, customs and technical documents
- Meetings, email, chat and filled-in forms
- Building an extraction pipeline
- Business, property and inspection documents
- Contract clauses and insurance claims
- Regulated and compliance documents
- Consumer, travel and closing documents
- Mapping one chat API onto another
- SDK and framework migrations
- Hallucination & failure modes
- Re-embedding and model deprecation
- Cutting over between providers
- Parity gaps, shims and legacy endpoints
- Moving between model versions
- Migrating vector stores and caches
- Mapping capabilities and parameters
- Migrating pipelines and agents
- Contracts, runbooks and rollback
- Auditing a codebase before a cutover
- Compliance and fine-tune migration
- LLM cost engineering
- Routing, cost tracking and multi-tenancy
- What a migration does to your prompts
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns
- Build it: end-to-end AI tutorials
- Python for AI: hands-on recipes
- TypeScript, React and the web
- Frameworks and SDKs
- Errors and troubleshooting
- AI facts, numbers and statistics
- The history of AI
- The maths behind AI
- Architectures beyond the transformer
- Reinforcement learning
- Diffusion and generative media
- Speech, audio and voice engineering
- Benchmarks, one at a time
- AI search visibility
- Infrastructure and operations
- Databases and storage for AI
- Knowledge graphs and structured knowledge
- Classical ML in production
- Regulation, jurisdiction by jurisdiction
- Prompt recipes and pattern library
- AI for people who do not write code
- Writing, media and creative work
- Edge and on-device AI
- Interpretability and model internals
- Field notes
- OpenAI model behaviour
- Claude model behaviour
- Gemini model behaviour
- Llama model behaviour
- Mistral model behaviour
- Qwen model behaviour
- DeepSeek model behaviour
- Cohere model behaviour
- Grok model behaviour
- Small model behaviour
- Hybrid model architectures
- Token cost by language and script
- Transliteration, romanization and script handling
- Locale-correct output
- Multilingual generation quality
- Multilingual pipelines
- The EU AI Act, article by article
- AI under the GDPR and EU data law
- US AI regulation, state and sector
- International AI governance and standards
- AI litigation and enforcement
- Running AI workloads on AWS
- Running AI workloads on Google Cloud
- Running AI workloads on Azure
- AI at the edge: Workers, Vercel and Netlify
- Serving models on Kubernetes
- Operating AI infrastructure
- Quantization formats and what they cost
- llama.cpp, flag by flag
- Ollama and the desktop local-model runtimes
- Local models on Apple Silicon
- Hardware for local inference
- Running speech and embedding models locally
- VRAM arithmetic for local models