Local Deployment and Evaluation of Large Language Models: A Practical Guide
This guide walks through the practical engineering work of deploying and evaluating large-scale sparse language models locally. It covers VRAM capacity planning with KV Cache as a hard constraint, a four-metric performance baseline for locating bottlenecks, layered scoring criteria for capability evaluation, and stability tips for tool-calling and long-chain tasks. Readers will learn how to separate scheduling, memory bandwidth, and scoring issues instead of blaming the model, along with a deployment checklist for reliable local delivery.
1. Background: Why “It Runs” Does Not Mean “It Is Usable”
When models with extremely large parameter counts (trillions of total parameters, sparse activation architectures) are brought into a local environment, the first problems a team encounters are usually not about model capability but about engineering usability. A complete local deployment typically involves three stages: weight loading and VRAM planning, concurrent scheduling of the inference service, and an evaluation loop oriented to business scenarios. The core conflicts exposed in the original practice are representative: prefill throughput is acceptable at a single concurrency but degrades noticeably as concurrency rises; decode throughput is stable but low; and the end-to-end evaluation pass rate is far below what manual review would predict. These three issues map to scheduling configuration, memory bandwidth constraints, and scoring criteria respectively. They need to be attributed separately rather than lumped together under a vague conclusion that “the model is not good enough.”
2. Resource Estimation Before Deployment: Treat VRAM as a Hard Constraint
The first step in local deployment is capacity planning. For a sparse model with trillions of total parameters, the number of activated parameters per token is far smaller than the total, but the weights themselves must still reside in memory in full, which makes quantization the only realistic option. When estimating capacity, split VRAM into three parts:
Total VRAM ≈ weight footprint + KV Cache + runtime overhead (activations/temporary buffers/communication domains)KV Cache ≈ 2 × num_layers × num_kv_heads × head_dim × sequence_length × concurrency × bytes_per_value
A typical mistake in practice is planning only around the weight footprint while ignoring that KV Cache grows linearly with “sequence length × concurrency.” Once VRAM utilization is pushed above 0.9, the batching space available to the scheduler is compressed, and any increase in concurrency turns into queuing rather than throughput.
3. Performance Baseline and Bottleneck Isolation: Look at Four Metrics Together
Performance evaluation should not rely on a single number. It is better to fix four metrics as a baseline:
- Prefill throughput (4k context, single concurrency): reflects compute and operator efficiency;
- Prefill degradation curve as concurrency rises: reflects scheduling and batching strategy;
- Decode throughput (single and multiple concurrency): reflects VRAM bandwidth and memory access efficiency;
- Time to first token (TTFT) growth with context length and concurrency: reflects queuing behavior.
The signals in the original data are clear: single-concurrency prefill is about 757 tok/s, staying in the 629–758 tok/s range from 2k to 32k with almost no length degradation, which shows compute is not the bottleneck. However, throughput drops 30%–45% at 2 concurrency, about -50% at 4 concurrency, and reaches -63% at 6 concurrency (688→228 at 2k). Decode is 23.8–28.7 tok/s at single concurrency and falls to 8–18 tok/s under multiple concurrency. At 32k context and 6 concurrency, TTFT worsens from 51.5s to 186.4s.
This data points to a server-side batching limit: when the maximum number of concurrent sequences is set to 2, anything beyond that can only queue, long prefill tasks block one another, throughput is averaged out, and TTFT is dominated by queuing. The improvement direction is to raise the maximum number of concurrent sequences and the maximum tokens per batch, but this must be premised on available VRAM headroom. If the KV Cache is nearly full, the correct approach is to shorten per-request context, enable prefix reuse, or add nodes for horizontal scaling, rather than simply enlarging batching parameters.
4. Capability Evaluation: Treat Scoring Criteria as a First-Class Concern
The most noteworthy part of capability evaluation is the judgment standard. In the original practice, only 9 of 25 SQL generation tasks passed (trivial 8/8, easy 1/2, medium 0/2, hard 0/13), but after relaxing numeric precision to 1e-6, the number of passes rose to about 22. The gap did not come from reasoning errors but from output that was not rounded to two decimal places as required by the prompt, causing strict string matching on the first line to fail.
This shows that evaluation must first clarify three things: whether matching is strict string comparison or numeric tolerance; whether format constraints count toward correctness; and whether the intermediate steps of multi-step tool calls are scored. Layered scoring is recommended:
Final score = 0.6 × result correctness (numeric tolerance) + 0.25 × structural correctness (row count/column count/column names)+ 0.15 × constraint compliance (rounding/sorting/naming and other explicit requirements)
At the same time, keep a “strict mode” score for external comparability to avoid drift in the scoring criteria.
5. Stability of Tool Calling and Long-Chain Tasks
All 25 tasks completed the autonomous loop of “generate statement → engine execution → validation → judgment,” and complex multi-table joins and window functions (such as lag-based retrieval, ranking, and cumulative share) were also written correctly, showing that long-chain tool calling is reliable. Lost points concentrated in two categories: first, structural errors such as mismatched final column names and empty result sets; second, deviations in understanding the criteria, such as computing the channel dimension incorrectly. Token consumption is also worth attention: simple tasks averaged about 2 steps and 2.4k tokens; hard tasks averaged 6.1 steps, with individual tasks reaching 14–17 steps and 55k tokens.
Improvements include: elevating “explicit format constraints” to a hard requirement in the system prompt with positive and negative examples; providing a few examples for window-function tasks; introducing a post-execution self-check step (validating column names, row counts, and units); and setting limits on steps and tokens to prevent long-chain divergence.
6. Deployment Checklist
- Do capacity estimation first, include KV Cache and concurrency in the formula, and leave 10%–15% headroom in VRAM utilization;
- Establish a four-metric baseline and judge service health by the concurrency degradation curve rather than single-point throughput;
- Relieve queuing by choosing among prefix reuse, context trimming, and horizontal scaling;
- Freeze the evaluation criteria in advance and output two sets of scores, strict mode and tolerance mode;
- Write format and structural constraints into the prompt and self-check flow to recover points lost by small margins;
- Solidify load testing and regression on the container platform and the monitoring and alerting system, and retain complete call chains in the logging service for later review.
In conclusion, the local performance of this kind of extremely large sparse model is more of a systems engineering problem: compute is usually not the weak point, while scheduling parameters, VRAM headroom, and scoring criteria are the dividing line between “looks usable” and “can actually be delivered.”
