Local LLM Selection and Quantized Deployment: A Practical Guide

    A practical guide to running large language models locally, covering a reusable model selection decision chain, real-world throughput comparisons across dense and MoE models, quantization trade-offs between 4-bit and 6-bit, and the hidden cost of long context windows. Learn how to pick models that stay usable on limited VRAM by treating tokens per second as a hard constraint.

    1. Why “It Runs” Is Not the Same as “It Works Well”

    Running large language models locally has moved from a hobbyist experiment to an everyday developer requirement. Three motivations drive local inference most directly: data never leaves your internal network, the setup keeps working without internet access, and inference costs stay predictable.

    Yet many developers hit the same disappointment on their first attempt. The model loads successfully, but output arrives at only a few tokens per second, and the interactive experience falls far short of a cloud API. The conclusion they reach is that local LLM inference is impractical.

    The real cause is usually not that the model is too large. It is a mismatch in resource structure. Local inference performance is determined by three factors working together:

    1. Where the weights are loaded: whether the weights fit entirely in VRAM decides if computation happens on the GPU or falls back to CPU and system memory.
    2. VRAM and memory bandwidth: decoding generates one token at a time, which is a classic bandwidth-bound workload. Insufficient bandwidth shows up directly as lower speed.
    3. Context size: the KV cache grows linearly with context length and continuously consumes available VRAM.

    Understanding these three points is more valuable than memorizing the benchmark score of any single model.

    2. The Core Conclusion First: A Reusable Selection Decision Chain

    Based on hands-on testing, local model selection can be reduced to a clear order of checks:

    • Step 1, check the capability ceiling: prefer larger models with a dense architecture, since they are generally stronger at reasoning, long-document comprehension, and instruction following.
    • Step 2, check the speed floor: if the target model cannot reach roughly 10 tokens per second on your hardware, the interactive experience degrades noticeably. Step down to a smaller model instead of forcing it.
    • Step 3, weigh a medium-sized sparse model against a small dense model: the former has a clear speed advantage with mid-range overall capability, while the latter is actually more stable in very long context scenarios.

    The key insight in this chain: the most capable model is not necessarily the right one for local use. Local selection is essentially about maximizing capability under an acceptable speed constraint.

    3. Measured Performance and Practical Limits of Three Model Classes

    1. Large Dense Models: The Capability Ceiling, but a High Hardware Bar

    On a machine with 12GB of VRAM, an i5-class CPU, and 32GB of high-frequency memory, a 27B-class dense model reached only about 3.6 tokens/s even with 4-bit quantization, which is not practically usable for interaction. The empirical takeaway: 16GB of VRAM is still a stretch and often forces a lower quantization tier; 24GB of VRAM, or a unified-memory architecture with a large memory pool, is the relatively safe starting point.

    Its value lies in capability. It trades wins with larger sparse models, and it is clearly better at long-form logical consistency, narrative coherence, and complex instruction following. The conclusion: use it if your hardware can drive it, and do not force it if it cannot.

    2. Medium-Sized Sparse (MoE) Models: The Middle Ground of Speed and Size

    A sparse architecture with 35B total parameters and roughly 3B active parameters is the sweet spot for local deployment. In testing, 4-bit and 6-bit quantization reached about 55 tokens/s and 42 tokens/s respectively; stretching the context from 4K to 20K dropped those figures to about 50 and 37 tokens/s.

    The weaknesses are equally clear. It underperforms small dense models on long-text summarization and analysis of large blocks of material, and its instruction following is less consistent. It fits everyday question answering, code snippet generation, and structured rewriting tasks with short to medium contexts.

    3. Small Dense Models: More Stable at Long Context, but Average Value for Money

    A 9B-class model ran at roughly 56 and 70 tokens/s with 6-bit and 4-bit quantization. The absolute speed is solid, and degradation is smaller with better stability under long context. However, its overall capability is only slightly better than, or close to, the 35B sparse model, and the speed advantage is not enough to be decisive. When the 35B model already meets the speed requirement, the small model offers no standout value for money. It is better treated as a supplementary option for long-context scenarios.

    4. Quantization Precision: The Underrated Performance Lever

    Quantization is not only about saving VRAM. It shifts both the speed and quality curves. Dropping the same model from 6-bit to 4-bit improved speed by about 30% in testing, while quality differences on most everyday tasks were not significant. Practical guidance:

    • Interactive chat and code completion: prefer 4-bit and put speed first.
    • Long-document analysis and tasks requiring rigorous reasoning: prefer 6-bit or higher.
    • When VRAM is insufficient, do not blindly lower quantization. First consider reducing context length or offloading only some layers.

    An illustrative logic for choosing a quantization tier:

    1. if VRAM >= model weights (target precision) + estimated KV cache + safety margin:
    2. use the target precision
    3. elif generation speed < 10 tokens/s:
    4. lower quantization precision or shorten the context
    5. else:
    6. keep the current setup

    5. The Hidden Cost of Context Length

    Context is not free. KV cache usage grows with length, directly compressing available VRAM and triggering offloading and slower speeds. In testing, going from 4K to 20K reduced speed by about 10% to 15%, which is acceptable; but combined with insufficient VRAM, the degradation rises sharply.

    Three engineering practices:

    1. Reserve a VRAM budget for the KV cache instead of assigning all of it to weights.
    2. For long-document tasks, split the material and apply summary-style compression first, then let the model do a second pass of synthesis.
    3. For scenarios with a fixed output style, use templates to explicitly disable unnecessary thinking or reasoning output, which saves tokens and lowers latency.

    6. A Practical Checklist

    • Measure speed before discussing capability: use 10 tokens per second as the empirical threshold for interactive usability.
    • Compare candidate models with the same prompts and the same context length, so a single session does not mislead you.
    • Pay attention to the long-context degradation curve rather than only peak speed on short text.
    • Memory capacity and frequency affect the experience too; insufficient capacity causes frequent paging.
    • Local inference suits privacy-sensitive, offline-capable, cost-controlled scenarios. For very large context requirements and extreme capability needs, a general-purpose cloud compute service or a containerized inference platform can serve as a complement, forming a hybrid architecture.

    7. Summary

    Selecting a local LLM is not about finding the strongest model. It is about building a decision framework that matches your hardware: use the capability ceiling to form a candidate list, use the speed floor as a hard filter, then fine-tune with quantization precision and context strategy. With this method, even 12GB of VRAM can deliver a stable and usable local inference experience.