← AI Engineering

Running Open-Weight Models Locally: Fit the Model to the Hardware You Have

How to size an open-weight LLM for the machine in front of you: the memory arithmetic, what quantization costs you, why published tokens-per-second figures are often ceilings rather than measurements, and which runtime to pick.

·9 min read·
#Local AI#Open Weights#Quantization#AI Hardware#Ollama#llama.cpp#Apple Silicon#AI Engineering

TL;DR

Start from the machine, not the model. The 2026 round-ups agree on one rule and it is the only one that matters at the beginning: do not start with the biggest model, start with the best model your hardware can comfortably run.

Three numbers decide what fits. Weight size at your chosen quantization, the KV cache for the context length you actually use, and memory bandwidth, which sets your ceiling on generation speed. Compute throughput is rarely the binding constraint for single-user local inference.

And be sceptical of the speed tables. One of the most detailed guides in circulation states plainly that its tokens-per-second figures are bandwidth ceilings, not measurements.


How much memory does a model actually need?

Roughly, weights in gigabytes equal parameters in billions multiplied by bytes per parameter, plus the KV cache, plus runtime overhead.

At FP16 that is 2 bytes per parameter. At 4-bit quantization it is closer to 0.5, plus some unquantized layers, which is why a 14B model lands somewhere near 8-10GB rather than exactly 7GB.

The published tiers line up reasonably well across sources. Local AI Master's table, with the recommended GPU column:

Model sizeFP164-bitSuggested GPU
1-2B2-4GB1-2GBAny 4GB+ GPU
3-4B6-8GB2-4GBRTX 3060
7B14-16GB3.5-5GBRTX 3060 12GB
13-14B26-28GB8-10GBRTX 4090

The Hugging Face guide tiers by whole machine instead, which is often the more useful framing:

MachineWhat the guide suggests running
8GB RAM, CPU onlyPhi-4-mini, Gemma 3 1B, Qwen3 1.7B — "slow but usable"
16GB RAM laptopPhi-4-mini, Gemma 3 4B, Qwen3 4B or 8B
32GB Mac or PCGemma 3 12B, Devstral, Qwen3 14B
24GB VRAM (RTX 3090/4090)Gemma 3 27B, Qwen3 30B, Devstral
48GB VRAM workstationQwen3 32B, Mistral Small 3.1, larger quantized models
80GB GPU, H100 classgpt-oss-120b, Llama 4 Scout
Multi-GPU or private GPU cloudDeepSeek-V4, Qwen3 235B, Llama 4 Maverick

Do not forget the context window in this arithmetic. The Qwen guide gives worked totals at 4-bit: an 8B model with 8K context at roughly 6GB total, a 14B at 8K context around 12GB, a 32B at only 4K context already around 21GB. The KV cache is what turns a comfortable fit into an out-of-memory error when someone pastes a long document.

What does quantization actually cost?

Quantization is the lever that makes any of this work on consumer hardware. The trade is quality for memory, and it is not linear.

LevelQuality loss as describedSize reductionWhen to use
Q8Minimal~2xQuality-critical work
Q5_K_MLow~3xBest general balance
Q4_K_MLow to moderate~4xLimited VRAM, the common default
Q3_K_MModerate~5xMemory-critical
Q2_KNoticeable~8xLast resort

Q4 is the standard starting point and what Ollama mostly ships by default. Q5_K_M is the recommendation when you have the headroom.

Two refinements worth knowing. Importance-matrix quantization uses a calibration pass to decide which weights tolerate more aggressive compression, and generally produces a better model at the same file size. And quantization-aware training goes further by training the model for the target precision rather than compressing afterwards. Google shipped QAT checkpoints for Gemma 4, and a 4-bit QAT Gemma is the pick in KDnuggets' coding list partly for that reason.

One trap: the download size and the memory footprint are not the same number, and the sources disagree with themselves about it. Local AI Master lists Phi-4-mini as a 2.2GB download but about 3GB of VRAM, and the Gemma 4 E-series downloads at 7.2GB and 9.6GB because Ollama's default tags for those models are higher precision than 4-bit. Check the tag you are pulling, not the family name.

Why is memory bandwidth the number that decides speed?

For single-stream generation, each token requires reading the active weights out of memory. That makes bandwidth, not compute, the ceiling. The rough estimate is memory bandwidth divided by the size of the weights you must read per token.

This is exactly how most published throughput figures are produced, and it is why they should be read as ceilings. Local AI Master is admirably explicit that its numbers come from dividing bandwidth by file size rather than from running anything, with a single measured data point to anchor them: an M3 Pro producing 55.6 tokens per second on a 3B model against a calculated ceiling near 74. About three quarters of theory.

Its Apple Silicon ceilings, on that basis:

MachineBandwidthComfortable sizeCalculated ceiling
M1, 8GB68 GB/s3B-7B~34 tok/s at 3B
M2 Max, 32-64GB400 GB/s14B-32B~43 tok/s at 14B
M4 Max, 128GB546 GB/s70B+~13 tok/s at 70B

The same reasoning explains why CPU-only inference is viable at small sizes and painful above them. Dual-channel DDR5-5600 at roughly 90 GB/s supports an interactive experience at 3B and a slow one at 8B. DDR4-3200 at about 51 GB/s is batch-processing territory.

Measured figures, where they exist, are more useful. The Qwen guide publishes timings from the author's own machines: a 27B dense model at 4-bit on an RTX 3090 at 41.77 tok/s using 18.5GB of VRAM, and a 35B mixture-of-experts model with 3B active at 157.66 tok/s using 22.7GB on the same card. That gap is the whole argument for sparse architectures on consumer hardware — the memory cost of the full weights, the generation speed of a small one.

For the broader picture of how CPU, GPU and NPU differ for inference, see GenAI hardware: CPU, GPU, NPU and model serving.

Which runtime should you use?

The honest answer for most people is Ollama until you have a specific reason to move. The Hugging Face guide's framing — start here unless you have a reason not to — matches what actually happens in practice.

RuntimeBest forWatch out for
OllamaGetting started, local OpenAI-compatible API, quick comparisonsDefault tags vary in precision between model families
LM StudioDesktop GUI, non-coders, GGUF browsing, local serverLess scriptable than a CLI
llama.cppGGUF control, CPU inference, Apple Silicon, offload flagsLeast beginner-friendly
vLLMProduction serving, multiple concurrent users, throughputNot aimed at single-user laptops
SGLangHigh-performance and distributed serving, multimodal and agent workloadsWrong starting point for beginners
Open WebUIA chat interface over Ollama or another backend, internal teamsIt is a frontend, not an inference engine
MLXApple Silicon specificallyMac-only; benchmark it against llama.cpp rather than assuming

On Macs that last row matters more than its position suggests. MLX is often faster than llama.cpp on the same machine, and the only way to know for your model is to run both. We have written up that path in Getting started with Apple MLX for local AI.

One flag worth knowing for mixture-of-experts models on a small GPU: llama.cpp can keep expert layers in system RAM while the rest runs on the card. The Qwen guide reports a 35B MoE model at 38.9 tok/s using only 9.8GB of VRAM on an RTX 3060 12GB with 24 expert layers offloaded. That is a 30B-class model running usefully on a mid-range card.

Where do the published numbers disagree?

This is the part the round-ups do not tell you, and it is the reason to anchor your decision in your own measurements.

ClaimSource ASource B
What counts as a small modelUnder ~10B parameters (Local AI Master's own definition)The same page's title says 1B-14B and ranks a 14B model first
Llama 3.2 3B MMLU63.4% in one table61.8% in another section of the same page
Phi-4 14B memory~10GB in the benchmark table~9GB download, needs 12GB VRAM, in the Ollama section
Qwen 35B-A3B on an RTX 3090112 tok/s157.66 tok/s for the next generation of the same size class
Qwen licensing"Everything is Apache 2.0"The same guide later describes an API-only generation and a flagship under a custom licence
Publication datePublished March 2026Same page, "last updated November 2026", body text referencing August

None of this makes the sources useless. It makes them shortlisting tools. Internal contradictions inside a single page are a good signal of how much of this material is assembled rather than measured, and at least two of these sites disclose that their content is partly AI-assisted.

A practical sequence

  1. Measure your ceiling. Find your memory bandwidth and usable memory. On a Mac that is unified memory; on a PC, VRAM first and system RAM as the fallback tier.
  2. Pick the size band, not the model. Use the tier tables above to decide whether you are shopping at 4B, 9B, 14B or 30B-class.
  3. Start at Q4_K_M. Move to Q5_K_M if you have headroom, Q8 only if quality is failing.
  4. Add your real context length to the memory estimate before you commit. Test with your longest realistic prompt, not a one-liner.
  5. Run two or three candidates on your own tasks. Coding fix, retrieval over your own document, a tool call, and a long-context recall check.
  6. Record tokens per second and resident memory yourself. A published ceiling is not a result.
  7. Check the licence before anything reaches a product.

Key takeaways

  • Fit the model to the machine. The best local model is the largest one that runs comfortably, not the largest one that technically loads.
  • Weights plus KV cache plus overhead is the memory budget. The context window is the part people forget until it crashes.
  • Q4_K_M is the sensible default; Q5_K_M when you have room. QAT and importance-matrix quants give you more quality at the same size.
  • Download size is not memory footprint, and default precision varies by model family.
  • Memory bandwidth sets your speed ceiling. Most published tokens-per-second figures are that calculation, not a measurement.
  • Mixture-of-experts models give you small-model speed at large-model memory cost, and expert offload makes them viable on mid-range GPUs.
  • Start with Ollama. Move to llama.cpp for control, vLLM for serving, MLX on a Mac if it benchmarks faster.

References

  1. Hugging Face — The Best Open Source and Open-Weight LLM Models to Run Locally in 2026
  2. Local AI Master — Best Small Language Models 2026: Top SLMs Ranked (1B-14B)
  3. InsiderLLM — Best Qwen Models Ranked: Which to Run Locally
  4. Turing Post — Small Language Models in 2026: 10 to Know, Compared
  5. llama.cpp
  6. Ollama

Public profile lookup

Ask AI About the Author

Open this query in ChatGPT, Claude, or Perplexity.

Comments

Comments are open to confirmed email subscribers. Use the email you subscribed with. To edit a comment, delete it and post a new one.

0/2000
Verify:

    Subscribe to get the new blogs.

    Field notes from someone who ships before they write about it. Sovereign AI, AI-SDLC, DevOps, and what 59 production deployments teach you. No spam. Unsubscribe anytime.

    Related field notes