Sean's Blog

Making Local LLM Go Brrr

June 4, 2026
Edit on GitHub

How to run your local LLM well: fast, reliable and with good quality.

Key metrics:

  • Prefill speed: prompt/input tokens per second
  • Decode speed: generated tokens per second
  • Time to first token (latency)
  • VRAM usage at target context length
  • Quality at chosen model/quant/context settings
  • Concurrency, if serving multiple users

Software (Inference)

Choose the serving stack based on workload:

  • llama.cpp: best general local path, especially GGUF, CPU, Apple Silicon, and mixed CPU/GPU.
    • beelama.cpp: DFlash & TurboQuant in llama.cpp with up to 3x faster generation and 7.5x more KV cache in same VRAM
    • ik_llama.cpp: llama.cpp fork with additional SOTA quants and improved performance
  • vLLM: strong GPU server for batching, throughput, OpenAI-compatible APIs, and production-style serving for modern GPUs.
  • SGLang: good for structured/agentic serving and high-throughput multi-call workloads for modern GPUs.
  • ZML: Zig based model run time.
  • LuceBox: Local LLM inference server built for speed. Custom kernels, speculative prefill & decoding. (very advanced optimizations like hot MoE VRAM cache)
  • Uzu: A high-performance inference engine for AI models (optimized for Apple hardware)

Performance checklist:

  • Use the fastest supported attention kernels: FlashAttention, FlashInfer, FlashMLA, etc.
  • Try speculative decoding / MTP / EAGLE-style decoding when supported, but benchmark with your actual model and sampling settings.
  • Preserve prefix/KV cacheability:
    • keep the system prompt byte-identical
    • append new messages rather than rebuilding/changing history
    • avoid dynamic timestamps or changing tool schemas in the prompt prefix
    • use server-side prefix caching when available
  • Tune KV cache precision:
    • for long context, test q8 KV even with q4 weights
    • aggressively quantized KV can hurt long-context coherence
  • Approximate KV-cache compression for long-context or high-concurrency workloads:

Tool-calling reliability:

TODO:

  • eval dynamic model routing based on query complexity (fast vs smart model)

Open Models

Run LLM models locally for complete control and privacy. Open-source (reproducible training) vs open-weight (free model weights) models. Dense models are smart but big and slow, Mixture of Expert (MoE) models only compute a fraction of parameters per layer and thus are faster to execute than dense models.

Compare model capability: https://artificialanalysis.ai/models
Find compatible models for your hardware: https://www.canirun.ai/ or try https://github.com/AlexsJones/llmfit -> rule of thumb: plan 70% of VRAM for the model weights and 20% for the KV-Cache.
Community benchmarks for local LLM: https://localmaxxing.com

Most models are too big for consumer GPUs, so quantized versions (compressed parameters) are used. Mixture of Quants (MoQ) is a new very efficient quant variant that does not quant weights uniformly but based on importance.

Curated open model list:

Hardware (GPU)

VRAM matters more than raw TFLOPs for model & context (prompt) size, but memory bandwidth and tensor cores matter for speed. Used datacenter GPUs can be good value, but check form factor, cooling, power, driver support, and PCIe vs SXM.

Interesting used GPU options:

GPUVRAMBandwidthTDPFP32 TFLOPSFP16 TFLOPSNotes
Tesla V100 (SXM2)16/32 GB HBM2900 GB/s300W15.7125 TensorNeeds SXM board or riser, check cooling.
Tesla V100 (PCIe)16/32 GB HBM2750 GB/s250W14.1112 TensorStandard form factor, strong used option.
Tesla P4024 GB GDDR5X346 GB/s250W12.012.0Lots of VRAM for cheap, no Tensor Cores.
Tesla P100 (PCIe)16 GB HBM2732 GB/s250W9.519.1Cheap, but old — less attractive than V100/P40.
GTX 1080 Ti11 GB GDDR5X484 GB/s250W11.311.3Cheap but VRAM-limited, no Tensor Cores.
RTX 309024 GB GDDR6X936 GB/s350W35.671.2 TensorOften the practical local LLM sweet spot.
Intel Arc A77016 GB GDDR6560 GB/s225W19.739.3 XMXGood llama.cpp SYCL support; get the 16 GB variant.
Intel Arc B58012 GB GDDR6456 GB/s190W14.428.8 XMXBattlemage arch, better perf/watt than A770, solid llama.cpp support.
AMD BC-25016 GB GDDR6448 GB/s220W6.913.8Mining card based on PS5 APU, ROCm support varies.

One or two used Tesla V100 16GB cards are the best bang for the buck.

TODO:

  • Check current AMD ROCm support.
  • Compare used datacenter GPUs against RTX 3090/4090/5090-class consumer cards.
  • Benchmark watts/token, not just tokens/sec.

References

#AI #tutorial