Local LLM Deployment on Consumer GPUs: A Practical Benchmark Guide
This article shares hands-on findings from running local LLMs on a single 22GB consumer GPU. It covers how to budget VRAM before choosing a model, how to balance weight and KV cache quantization against context length, how to tune reasoning parameters to avoid verbose or looping chains of thought, and how to handle concurrency and throughput. It also outlines a task-based evaluation approach and a hybrid local-cloud architecture, closing with a deployment checklist.
1. The Shift from Cloud API Calls to Local Inference
Over the past two years, LLM usage has been dominated by remote API calls: developers pay per token, data leaves their environment, and latency depends on network conditions and queueing. Recently, a wave of mid-sized models with sparse activation has reached usable speeds on consumer GPUs, tilting the balance toward local deployment. Three factors drive this:
- Sparse architectures. Decoupling total parameters from activated parameters sharply reduces per-token compute. VRAM is now consumed mainly by weights and cache rather than compute capacity.
- Mature quantization and cache compression. 4-bit weights and 8-bit key-value (KV) cache are now default engineering choices, with acceptable accuracy loss on most tasks.
- Broad multi-backend support in inference runtimes. The same model can run across different graphics and compute backends, lowering the barrier to cross-platform deployment.
Local deployment is not meant to replace the cloud. The sensible split is: push high-frequency, privacy-sensitive tasks that tolerate moderate capability to local; keep very long context and extremely difficult reasoning in the cloud. This is the first principle for deciding whether local is worth the investment.
2. Hardware and VRAM Budget: Do the Math Before Picking a Model
Take a single consumer GPU with 22GB VRAM at roughly a couple thousand yuan on the used market. The VRAM budget breaks down roughly as:
Total VRAM ≈ weights + KV cache + runtime/multimodal encoder overhead + headroomWeights ≈ parameter count × bytes per parameter4-bit ≈ 0.5 Byte/param; 3-bit ≈ 0.4 Byte/paramKV cache ≈ 2 × layers × hidden dim × context length × precision bytes / effective parallelism
Two practical conclusions follow:
- A ~27B dense model at 4-bit takes about 13–14GB for weights, leaving room for six-figure context lengths;
- A ~35B sparse-activation model (about 3B activated) uses less weight memory at 3-bit, freeing budget for very long context, though low bit widths are more sensitive to instruction following.
Practice tip: Decide the minimum context length the workload needs, then work backward to the usable bit width, instead of picking a model first and hoping it fits.
3. Quantization and Cache: The Precision-Speed-Context Triangle
Quantization is not a single switch; weights and cache must be decided separately:
| Combination | Perceived generation speed | Context capability | Main risk |
|---|---|---|---|
| 4-bit weights + 8-bit cache | Moderate (twenty-some tokens/s) | Six figures | Degraded long-text detail recall |
| 3-bit weights + 8-bit cache | Very fast (nearly 100 tokens/s) | Up to hundreds of thousands | Instruction-following degradation, repetition |
| Lower bit widths | Fastest | Depends on VRAM | Severe degradation on small models |
The empirical rule: the smaller the model, the more pronounced low-bit instruction-following problems become. If you see off-topic answers, repeated confirmations, or format drift, raise weights to 4-bit first, then compensate with more conservative sampling parameters rather than pushing bit width lower.
In multimodal scenarios, the image encoder and projection layers consume additional VRAM, and high-resolution inputs significantly inflate the number of visual tokens. In practice, cap per-image resolution and maximum image count, and account for visual tokens within the unified context budget.
4. Inference Parameter Tuning: Taming the “Verbose and Rambling” Chain of Thought
Recent models emphasize long-chain reasoning, with the side effect of verbosity and infinite loops. A reproducible tuning checklist:
- Repetition and frequency penalties: Raise in small steps; too high fragments sentences;
- A hard cap on reasoning length: Set a firm limit for the thinking phase and force a transition to the answer once exceeded;
- Two-stage prompting: Ask for the conclusion first, then the supporting rationale, which noticeably shortens unproductive chains;
- Temperature and top-p combinations: Lower temperature for factual tasks, raise moderately for creative ones;
- Structured output constraints: Use schema-based output (fields/tables) to compress free-text space.
Illustrative call skeleton (pseudocode, showing parameter positions only):
request = {model, messages, max_tokens,reasoning: { max_tokens: 2048, fallback: "answer_directly" },sampling: { temperature: 0.6, top_p: 0.9,repetition_penalty: 1.08, frequency_penalty: 1.05 },cache: { kv_precision: "q8", context: 100000 }}
For models below 9B, repetition penalties need to be more aggressive; for sparse-activation models, constrain both “reasoning length” and “concurrency,” since concurrency dilutes cache bandwidth.
5. Concurrency and Throughput: Fast Single-Stream Is Not a Usable Service
Single-request speed and concurrent throughput are two different metrics. A common observation in testing: single-stream runs at twenty-some tokens/s, two concurrent requests total around forty tokens/s; but under further load, cache bandwidth and VRAM become bottlenecks and throughput collapses quickly. Recommendations:
- Use continuous batching to improve utilization, with maximum concurrency and queue limits;
- Put long-context requests in a separate queue so they do not slow down short requests;
- Monitor cache hit rate and VRAM levels, and set degradation policies (shorter context, lower resolution).
6. Capability Evaluation: Look at Task Closure, Not Just Benchmarks
Using “how completely an AI coding tool completes tasks in firmware, graphics, and small games” as a composite evaluation is more informative than a single leaderboard. Reusable evaluation dimensions:
- First-pass success rate: Did compile/run succeed on the first try;
- Debugging rounds: How many rounds from failure to usable;
- Resource-constraint compliance: Can it run in extremely constrained environments;
- Long-context consistency: Do cross-file references drift;
- Multimodal understanding: Factual consistency under mixed image-text requirements.
The conclusion converges: mid-sized local models are close to usable on “engineering tasks with clear acceptance criteria”; they still lag on open-ended long-chain reasoning and detail recall over very long context.
7. Division of Labor with the Cloud: A Hybrid Architecture Is the Endgame
The real value of localization is changing the cost structure: a one-time fixed investment, with marginal inference cost approaching zero. But it is not opposed to cloud services; it is layered:
- Local layer: code completion, log triage, document summarization, privacy-sensitive data processing;
- Cloud layer: difficult reasoning, very long context, peak elasticity;
- Platform layer: containerized inference services, object storage hosting models and data, message queues for peak shaving, logging and monitoring alerts for observability.
Baidu AI Cloud typically plays the role of elastic inference, model hosting, and the observability stack in such hybrid architectures, letting developers split traffic freely by task sensitivity and cost targets.
8. Deployment Checklist
- Define minimum context and maximum concurrency, then choose a quantization scheme;
- Keep weights at 4-bit or higher (especially small models), prefer 8-bit cache;
- Set a reasoning-length cap and a repetition-penalty baseline;
- Limit multimodal resolution and image count, and include them in the context budget;
- Build regression evaluations for first-pass success rate, debugging rounds, and long-text consistency;
- Design local-cloud routing rules and degradation paths;
- Complete monitoring and alerting, watching VRAM levels and cache hits.
Local LLMs have moved from “can run” to “usable.” Real engineering capability lies in chaining VRAM, bit width, context, concurrency, and evaluation into a reproducible, regression-testable, evolvable pipeline, rather than chasing single-point benchmark scores.
