Engineers buying a MacBook Pro, Mac mini, or Mac Studio for local LLM inference routinely get burned by misleading rules of thumb. "Just divide parameters by two for 4-bit" or "an M3 Pro is always faster than an M2 Pro" sounds convenient—until a 32B model swaps to SSD or decodes 35% slower than expected. Four hardware and math traps explain almost every sizing surprise on Apple Silicon:
150 GB/s), making single-stream token decode slower than the older M2 Pro (200 GB/s). Similarly, binned M3 Max (14c/30c GPU) runs at 300 GB/s (384-bit) while the full M3 Max (16c/40c GPU) runs at 400 GB/s (512-bit), and binned M4 Max (14c/32c GPU) runs at 410 GB/s vs 546 GB/s on the full 16c/40c die.4.0 bpw underestimates real GGUF weights by ~20%llama.cpp / MLX GGUF quantizations, embedding layers, output projection heads, and quantization block scales push effective Q4_K_M storage closer to 4.85 bpw (not Qwen2.5-32B, that difference is 3.4 GB of unexpected RAM.64 GB Mac does not give Metal 67% on <= 24 GB machines and 75% on >= 32 GB machines (48 GB usable on a sysctl iogpu.wired_limit_mb. Qwen2.5-7B uses 4 KV heads, Phi-4-14B uses 10 KV heads, and Gemma-2-9B uses head_dim=256 with alternating 50% global / 50% sliding-window-4096 attention layers. Ignoring hybrid sliding-window attention overstates Gemma-2 KV memory by up to 2× at long context.
Autoregressive token generation (batch size 1) is strictly memory-bandwidth bound: for every single token emitted, the GPU streams all active model weights plus the active KV cache across unified memory. You can compute an exact, zero-guesswork roofline in pure Python:
QUANT_BPW = {"Q4_K_M": 4.85, "Q5_K_M": 5.70, "Q6_K": 6.56, "Q8_0": 8.50, "FP16": 16.0}
def roofline_estimate(bandwidth_gbs: float, params_b: float, layers: int,
kv_heads: int, head_dim: int, ctx: int,
quant: str = "Q4_K_M", kv_bytes: float = 2.0,
hybrid_swa_4096: bool = False) -> dict:
weights_gb = params_b * (QUANT_BPW[quant] / 8.0)
if hybrid_swa_4096:
g_layers = layers // 2
s_layers = layers - g_layers
kv_gb = (2 * kv_heads * head_dim * kv_bytes * (g_layers * ctx + s_layers * min(ctx, 4096))) / 1e9
else:
kv_gb = (2 * layers * kv_heads * head_dim * kv_bytes * ctx) / 1e9
active_gb = weights_gb + kv_gb
ceiling = bandwidth_gbs / active_gb
return {
"weights_gb": round(weights_gb, 2),
"kv_cache_gb": round(kv_gb, 2),
"roofline_tok_s": round(ceiling, 1),
"typical_range_tok_s": (round(ceiling * 0.65, 1), round(ceiling * 0.80, 1)),
}
Before down a 40 GB GGUF file, verify both OS headroom and the Metal wired-memory ceiling:
def usable_gpu_gb(ram_gb: int, os_reserve_gb: float = 4.0) -> float:
wired_ratio = 0.67 if ram_gb <= 24 else 0.75
return max(0.0, min(ram_gb - os_reserve_gb, ram_gb * wired_ratio))
GB/s (10^9 B/s). Computing weights_gb and kv_cache_gb in matching decimal GB (10^9 B) keeps the dimensional ratio GB/s / GB = tok/s exact.65%–80% of theoretical memory bandwidth during single-stream decode due to dequantization compute, attention overhead, and cache misses. Always plan around the realized band, not the 100% ceiling.M4 Max 14c/32c is 36 GB only; M3 Ultra ships in 96 / 256 / 512 GB; there is no M4 Ultra).
Use the Interactive Apple Silicon LLM Sizing Calculator to explore all 17 verified Apple Silicon SKUs and 14 published open-weight LLM profiles, toggle FP16 vs Q8_0 KV-cache precision, and inspect FITS / TIGHT / OOM status instantly in your browser.
You can download the complete $0.00 Free Open Dataset & Python CLI Kit (Gumroad, GitHub Release, and Kaggle Datasets), including identical canonical apple_silicon_specs.csv/.json and llm_arch_profiles.csv/.json files, llm_sizing_cli.py (estimate, matrix --format md|csv|json, validate), METHODOLOGY.md, and test_llm_sizing.py.