Local LLM Deployment: Quantization Choices and Inference Speed Tuning
This article explains why a model that loads successfully can still be unusable in practice, and how to plan local LLM deployment around memory capacity. It covers the three common shapes of local inference tooling, how to estimate weight and KV Cache memory usage, quantization selection by VRAM tier, troubleshooting when layers spill to host memory, a reproducible benchmarking method, and a hybrid local-cloud split, ending with a deployment checklist.
1. Why “It Runs” Is Not the Same as “It’s Usable”
Over the past year, both the parameter counts and release cadence of open-source LLMs have climbed quickly. A 27B-class model is no longer exclusive to data centers. Yet the first experience many developers have when running one locally is the same: the model loads fine, but generation speed is hard to accept, and the interaction feels clearly worse than a cloud API.
Two basic facts explain that gap. First, the bottleneck in local inference is usually not peak compute but data movement. During autoregressive generation, every output token requires reading the full set of model weights, so inference speed is in most cases determined by memory bandwidth rather than floating-point throughput. This is why a GPU with a high advertised compute figure can still generate slowly.
Second, whether a model “fits in VRAM” is a binary switch. When all weights and the KV Cache stay resident in VRAM, speed is generally usable. Once they overflow into host memory, data has to be moved repeatedly across the PCIe bus, and speed can drop by several times. Local deployment is therefore fundamentally an exercise in capacity planning.
2. What Local Inference Toolchains Generally Look Like
Desktop tooling for local LLMs is now fairly mature, and mainstream options fall into three categories:
- CLI inference frameworks: built around a low-level inference engine, with the finest-grained resource control, suited to scripted integration and automated load testing;
- Desktop GUI clients: combine model discovery, download, loading, chat, and parameter tuning in one interface, lowering the barrier to entry;
- Service wrapper layers: expose a local HTTP interface that follows the conventions common in the industry, making it easy for other applications to call.
These categories are not mutually exclusive. A more complete GUI client typically offers the following, which are also the main dimensions for judging whether a local tool is worth using long term:
- Built-in model repository: search and download weights of different parameter sizes and quantization levels from within the UI, with estimated resource usage shown;
- Visual parameter controls: context length, batch size, number of GPU offloaded layers, and other key settings exposed as sliders or input fields, taking effect immediately;
- Switchable inference backends: support for multiple backends to accommodate accelerator cards from different vendors and architectures;
- Local API service: one-click startup of a local service with a calling convention compatible with mainstream SDKs, so model capabilities can be reused by higher-level applications;
- Cross-platform consistency: the same interaction and configuration semantics across mainstream desktop operating systems.
Point 4 deserves particular emphasis. When a model exists as a local service, it becomes a replaceable component in the toolchain: applications such as knowledge base Q&A, code assistance, and text processing only need to program against a standard interface, and the backend can point to either a local model or a cloud service without changing business code. This decoupling is the dividing line between local deployment as a toy and local deployment as something usable.
A minimal call example (pseudocode, showing the shape of the interface rather than a specific implementation):
from openai import OpenAI# Point to the local inference service instead of a remote oneclient = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="local")resp = client.chat.completions.create(model="local-model",messages=[{"role": "user", "content": "Explain what a KV Cache is"}],temperature=0.7,max_tokens=512,)print(resp.choices[0].message.content)
3. Choosing a Quantization Level: Start With a Size Estimate
The same model is usually published in several quantized variants, commonly labeled Q4, Q5, Q6, Q8, and so on. A higher number means more bits retained per parameter, less precision loss, and a larger file. Quantization is the most important lever in local deployment because it affects both whether the model fits and how fast it runs once it does.
A rough formula is enough for a capacity estimate:
Weight VRAM usage (GB) ≈ parameter count (B) × bytes per parameterwhere Q4 ≈ 0.5–0.6 bytes, Q8 ≈ 1.0–1.1 bytes
For a 27B model, Q4 puts the weights at roughly 14–16 GB, while Q8 approaches 28–30 GB. That figure does not include the KV Cache, which grows linearly with context length and concurrency; several extra GB in long-context scenarios is not unusual. So “a 16 GB GPU can run 27B” is an overly optimistic assumption.
Selection guidance by hardware tier:
- 8 GB VRAM or less: prefer Q4/Q5 variants of 3B–8B class models, and spend the remaining budget on longer context;
- 12–16 GB VRAM: 14B class at Q4/Q5 is feasible, or 27B class at Q3/Q4 with context length limited;
- 24 GB VRAM or more: 27B class at Q4/Q5 can stay fully resident, with an experience close to usable;
- Insufficient VRAM but ample system memory (32 GB or more): accept partial layer offloading, understanding this is a “functional but speed-limited” compromise.
Keep in mind that quantization is not lossless. Degradation from low-bit quantization is usually more visible on long-text inference, structured output, and code generation than in casual chat. If your workload is sensitive to output stability, prioritize the quantization level over chasing a larger parameter count.
4. What Happens When the Model Does Not Fit in VRAM
When the weights cannot all fit in VRAM, the inference engine keeps some Transformer layers in VRAM and the rest in host memory, computing them alternately layer by layer. Now every generated token has to wait on a cross-bus transfer, and latency degrades from “bandwidth-bound” to “link-bound.”
Recommended troubleshooting order:
- Confirm the actual number of offloaded layers: most GUI tools display offloaded/total layers, and if not all layers are offloaded, that is where the speed loss comes from;
- Reduce context length: KV Cache usage is proportional to context, and going from 32K to 4K often frees a meaningful amount of VRAM;
- Lower batch size and concurrency: single-user local use does not need a large concurrency budget;
- Drop the quantization level: going from Q6 to Q4 typically cuts weight usage by about a third;
- Close unnecessary display and browser workloads: in a desktop environment, VRAM is a shared resource;
- Switch to a smaller parameter size: the most effective step, and the one most often skipped.
5. A Method for Measuring Quantization
Benchmark numbers without a method have limited value. Fix the following variables before comparing horizontally: the same model and quantization level, the same prompt set (several entries each covering short Q&A, long-document summarization, and code generation), the same temperature and maximum output length, and the same context settings. Three metrics are enough for most decisions: time to first token, output tokens per second, and peak VRAM usage.
If you need to evaluate for a production system, you can go further and load test the local service interface, observing how throughput changes as concurrency rises. Most local deployments see throughput saturate quickly once concurrency exceeds 2–4, which is directly related to the server’s batching strategy and remaining VRAM headroom, and is also the key evidence for deciding whether local can replace cloud.
6. Cloud and Local: Split by Scenario, Not Either/Or
The value of local deployment concentrates in three areas: compliance benefits from data never leaving the internal network, availability in offline environments, and marginal cost advantages under high-frequency calls. Its weaknesses are equally clear: fixed hardware ceilings, high cost for large models and high-concurrency scenarios, and manual effort to keep models up to date.
A more pragmatic architecture is therefore hybrid: sensitive data and high-frequency simple tasks run locally, while complex reasoning and peak traffic are handled by cloud services, with both scheduled through a unified interface layer. On the cloud side, this kind of architecture typically relies on a container platform to host inference services, object storage to hold model weights, and logging plus monitoring and alerting to track latency and error rates, which together give a smooth handoff between local and cloud capabilities.
7. Deployment Checklist
- Estimate total weight and KV Cache usage first, then decide model size and quantization level;
- Prioritize keeping all weights resident in VRAM, and only then consider higher quantization precision;
- Use a fixed prompt set and fixed parameters for reproducible comparisons instead of drawing conclusions from a single session;
- Wrap the model as a local standard-interface service to keep business code decoupled from the inference backend;
- Establish baselines for latency, throughput, and peak VRAM as the basis for later hardware upgrades or model swaps;
- Define the boundary between local and cloud: sensitive and high-frequency locally, complex and peak loads in the cloud.
Following this path, even on an ordinary consumer-grade GPU, you can build a local LLM environment that is stable, measurable, and able to evolve, rather than staying stuck at the “loads successfully but cannot be used” stage.
