Local LLM Deployment and Evaluation: A Practical Guide to Memory Budgeting, Throughput, and Benchmarking
This guide explains how to evaluate large-scale model deployment on local infrastructure beyond simply getting the model to load. It covers static memory budgeting for trillion-parameter models, the role of KV Cache in concurrency and context length, why prefill and decode must be measured separately, how to design layered evaluations with attributable failure categories, and the hidden cost and stability overhead of long tool-calling loops. Readers will find practical formulas, typical local measurement trends, prioritized tuning steps, and a three-part conclusion for judging whether a deployment is actually usable.
1. Background: Why “It Runs” Does Not Mean “It Is Usable”
Running a model with trillions of parameters fully on local servers or owned hardware has moved past the question of whether it can load. The real question is whether it can serve traffic reliably. Many teams fall into a trap after their first successful load: because the model produces correct output, they assume performance is just a tuning detail. Real load testing usually overturns that assumption. An inference service that looks fine at a single concurrent request can see time-to-first-token degrade several times over once concurrency reaches 4 to 6, while throughput is heavily diluted.
Evaluating a local deployment therefore requires answering three questions at once: whether resources are used efficiently, whether latency meets interactive usage targets at the target concurrency, and whether the pass rate on real business tasks is acceptable with failures that can be traced and fixed. The sections below follow these three threads.
2. Resource and Memory Budgeting: Do the Math Before You Start
Even after low-precision quantization, the weights of a trillion-parameter model still require a substantial amount of VRAM or unified memory. In practice, start with a static budget:
Total budget ≈ weights + KV Cache + activations and temporary buffers + framework and communication overheadAvailable headroom = physical VRAM × safety factor (0.85~0.92 recommended) - weightsKV Cache ceiling ≈ available headroom / (layers × 2 × KV heads × head dim × bytes per element)
Two conclusions matter. First, weights are only the entry ticket; what actually determines how many requests can be served simultaneously and how long the context can be is the remaining KV Cache headroom. When memory utilization is pushed above 0.9, the cache is nearly full and the scheduler can only lower the concurrency limit, which shows up directly as queuing under high concurrency. Second, the safety factor should not sit near 1.0 for long, or fragmentation and temporary buffers will cause intermittent failures.
If a single machine lacks capacity, tensor parallelism or pipeline parallelism is needed. Communication overhead then becomes a new variable: tensor parallelism is sensitive to interconnect bandwidth, so high-speed interconnect should be prioritized for multi-node deployments; pipeline parallelism introduces bubbles that must be smoothed out with sensible layer partitioning and micro-batch scheduling.
3. Throughput and Concurrency: Measure Prefill and Decode Separately
Inference has two phases, prefill and decode, with completely different resource profiles. Mixing their metrics will inevitably lead to misjudgment.
- Prefill is compute-intensive: high throughput, but it occupies compute for a long time.
- Decode is memory-bandwidth-intensive: stable speed per request, but bandwidth contention becomes obvious as concurrency rises.
A typical set of local measurements looks like this (illustrating the trend, not a benchmark for a specific environment): single-concurrency prefill peaks at roughly 750 token/s and varies little across input lengths from 2k to 32k, indicating that long context alone brings no clear degradation. But at concurrency 2 it drops by 30% to 40%, at 4 by about half, and at 6 by more than 60%. Decode holds steady at 24 to 29 token/s with a single request, falling to 8 to 18 token/s as concurrency rises, with single-digit lows when long inputs combine with high concurrency.
Time-to-first-token rises roughly linearly with input length, and the concurrency amplification effect is more pronounced: at 32k input, single concurrency is on the order of fifty seconds, and at 6 concurrency it can approach or exceed three times that. The main cause is usually not the model slowing down, but a batch size limit set too low, which forces requests to queue and long prefill tasks to block one another.
Improvements, ordered by cost-effectiveness:
- Raise the maximum number of concurrent sequences and the maximum tokens per batch so the scheduler has a chance to merge requests.
- Set separate resource quotas for prefill and decode, or deploy them separately, so long inputs do not starve decode requests.
- Enable prefix caching to reuse fixed prefixes such as system prompts and tool definitions, directly cutting repeated prefill cost.
- Chunk prefill for very long inputs to reduce per-step occupancy time and improve tail-request latency.
4. Evaluation Design: Break “Correct Answer” Into Attributable Layers
The most common mistake in capability evaluation is reporting a single overall score. A more engineering-oriented approach is to layer the tasks and define the pass criteria explicitly. Take structured query tasks that involve tool calling: four tiers can be used, trivial, easy, medium, and hard, with a pass requiring the returned row count, column count, column names, and first row content to all match.
Under such strict criteria, a common result is that easy questions are almost all correct, medium questions partly pass, hard questions have a low pass rate, and the overall pass rate may be only in the mid-thirties percent. But after relaxing floating-point precision to a negligible error margin, the pass rate can jump above 80%. This large gap reveals the real bottleneck: most model failures are not logic errors but a failure to follow the rounding and formatting constraints stated in the task.
Further attribution puts the lost points in three categories:
- Format: omitting a precision-handling function explicitly required by the task, causing the first-row string to mismatch.
- Structure: returning mismatched column names when combining multi-table joins with common table expressions, or returning empty results for window function queries.
- Interpretation: misreading a business dimension (such as channel type) and computing the share of a different subset.
The corresponding fixes are clear: write format constraints as a hard checklist in the system prompt; provide a few examples for error-prone patterns such as window functions and cumulative shares; add a self-check at the application layer so the model compares column names and precision requirements before execution.
5. Cost and Stability: The Hidden Overhead of Long-Chain Tasks
The step distribution of tool-calling loops is often extremely uneven. Simple tasks finish within two steps and consume only a few thousand tokens; hard tasks may iterate a dozen or more times, consuming on the order of 50,000 tokens each. Cost estimation therefore cannot rely on an average per-token price; capacity planning should be based on the tail consumption of hard tasks, with a maximum step count and timeout circuit breaker on the loop so individual tasks do not occupy the service indefinitely.
For stability, three things should be in place: make memory utilization, batch size, queue length, and time-to-first-token into monitoring and alerting metrics; fix the random seed and input set in load test scripts so results are reproducible; and retain the full trace of failed requests to distinguish scheduling problems from model capability problems.
6. Conclusion
Evaluating the local deployment of a model at extreme scale should produce a three-part conclusion: whether resources retain a safety margin, whether latency is acceptable at the target concurrency, and whether lost points on structured tasks are attributable. The general pattern in practice is that performance bottlenecks mostly come from batching and cache configuration rather than the model itself, and capability bottlenecks mostly come from format and interpretation constraints rather than reasoning logic. To further lower the barrier to self-hosting and tuning, it is worth looking at the general capabilities of Baidu AI Cloud in container platforms, object storage, logging services, and monitoring and alerting, so effort can focus on the evaluation system and business adaptation.
