1. The Memory-Bandwidth Roofline of Local Autoregressive Decoding
During batch-size-1 local inference in llama.cpp or Ollama, arithmetic intensity is ~1 FLOP per byte—placing token generation deep inside the memory-bandwidth-bound regime. Sustained decode throughput follows a remarkably tight physical law:
Tokens_Per_Second ≈ (Memory_Bandwidth_GBs × η_kernel) / (Active_Params_B × Bytes_Per_Weight + KV_Read_GB)
Where η_kernel ≈ 0.70–0.75 on Metal and CUDA K-quant kernels. Two architectural consequences follow immediately:
- Quantization Doubles as a Speed Multiplier: Compressing a dense 32.5B model from
F16(65 GB) toQ4_K_M(19.5 GB) not only fits inside a 24GB GPU or 48GB Mac—it boosts decode speed by 3.3× because 3.3× fewer weight bytes cross the memory bus per token. - Sparse MoE Unlocks Frontier Quality on Workstations: A 128GB MacBook Pro M4 Max (
546 GB/s) holds all 109B parameters ofLlama 4 Scoutin unified RAM (~65 GB inQ4_K_M) while reading only 17B active parameters (~10.2 GB) per token—delivering ~38 tok/s interactively!
2. Controlling MCP Tool-Schema Bloat in Local & Cloud Agents
Connecting local or cloud coding agents to Model Context Protocol (MCP) servers introduces a hidden context tax: every enabled tool injects its JSON Schema definition into the prompt prefix. When running local models at 16K–32K context windows, 6,000 tokens of unused MCP schemas both consume precious KV-cache RAM and slow Time-To-First-Token (TTFT) prefill.
mcp.json bundles in the MCP Server Config Generator →.