Blog • • written with human intelligence

Tinkering with Local LLMs: Notes on Quantization and Latency

Practical observations from running open weights locally: GGUF vs EXL2, memory bandwidth limits, and prompt eval caching.

Running large language models locally on consumer hardware used to feel like a gimmick. Today, with modern quantizations and optimized runtimes, it’s a daily part of my developer workflow.

Here are a few practical insights and architectural observations I’ve collected along the way.

Memory Bandwidth Is King for Token Generation

During autoregressive generation (decoding phase), an LLM generates tokens one by one. For each token, the model must read all its active weights from memory into compute cores.

This means token generation speed is almost entirely bound by memory bandwidth:

Tokens per second≈Memory Bandwidth (GB/s)Model Size (GB)\text{Tokens per second} \approx \frac{\text{Memory Bandwidth (GB/s)}}{\text{Model Size (GB)}}

For example, on unified memory architectures (like Apple Silicon with ~400 GB/s bandwidth) or an RTX 4090 (~1,008 GB/s bandwidth), keeping the model weights compact directly multiplies generation speed.

Quantization: Where to Draw the Line?

  • 4-bit (Q4_K_M / AWQ): Generally the sweet spot for consumer GPUs. Minimal perplexity degradation on 7B–70B models with nearly 60% memory savings.
  • 8-bit (Q8_0): Almost indistinguishable from FP16, but requires double the memory of 4-bit.
  • K-quants: Variable quantization where sensitive attention layers retain higher precision while feed-forward layers are more aggressively compressed.

Prefix Caching & Context Re-use

If you build agentic workflows or code completion engines, repeatedly processing system prompts kills latency.

Enabling KV cache re-use (prefix caching in engines like vLLM, llama.cpp, or Ollama) drops the TTFT (Time To First Token) for subsequent turns from seconds to single-digit milliseconds.

Looking Forward

The gap between proprietary frontier models and small open models running on local hardware continues to compress. For daily coding assistance and structured data extraction, localized models with low-latency tool calling are becoming hard to beat.

Notice: This post was written and synthesized with human intelligence and genuine understanding — not generated by AI.
Tags: #LLMs #Inference #OpenSource