How to Evaluate Local LLM Performance: From Inference Speed to Deployment Cost
A practical framework for evaluating local large language models across task quality, inference efficiency, memory usage, stability, quantization trade-offs, reproducible benchmarking, and total cost per successful task. The goal is to determine which model and deployment configuration can reliably complete real workloads within a defined resource budget.
1. Separate Model Capability from Deployment Quality
When a new large language model is released, developers usually care about three questions: Is its task quality high enough? Can existing hardware run it? And is the operating cost reasonable? None of these questions can be answered by a single benchmark score or a short generation demo.
A model’s practical performance includes at least four related dimensions:
- Task capability: Whether it can correctly follow instructions and perform programming, question answering, document analysis, image understanding, and other tasks.
- Inference efficiency: Time to first token, sustained generation speed, request completion time, and concurrent throughput.
- Resource requirements: How much memory and VRAM are required for model weights, context caches, and runtime buffers.
- Operational stability: Whether long-running service is prone to out-of-memory errors, repetitive generation, uncontrolled tool calls, or invalid output formats.
Reports about speed, long-context support, or low-cost deployment can help identify questions for evaluation, but they should not be treated as universal performance conclusions. Without complete information about hardware, input length, quantization, and test procedures, results are difficult to reproduce across environments. They also cannot prove that one category of model has broadly reached the capability level of another.
A more useful evaluation question is:
Given a defined resource budget, can the model complete the target task reliably and within the required response time?
2. Parameter Count Does Not Directly Determine Speed or Capability
Dense Models and Mixture-of-Experts Models
A dense model generally uses most of its main network parameters to process each token. A mixture-of-experts (MoE) model uses a routing mechanism so that each token activates only a subset of the expert networks.
MoE models therefore require attention to two different concepts:
- Total parameter count: Affects the storage and loading size of the model weights.
- Active parameter count: Affects the amount of model computation performed for each token.
A smaller active parameter count usually reduces computation, but it does not mean that the deployment only needs to store those parameters. Many deployment methods still need to load all or most expert weights. Actual performance is also affected by expert distribution, memory-access efficiency, routing overhead, and hardware support.
This explains why some models appear to be large while generating relatively quickly, yet may still be unsuitable for devices with limited VRAM. Compute requirements and storage requirements are separate issues and should not be conflated.
Evaluate the Architecture and Inference Implementation Together
The same model can run at different speeds with different inference implementations. The causes include not only operator optimization, but also quantization format support, cache layout, task scheduling, and data transfers between devices.
Performance testing therefore evaluates a combination of:
Model weights + quantization scheme + inference implementation + hardware configuration + request workload
Reporting only the model name and tokens per second is incomplete. The runtime environment should be treated as part of the test result rather than as a secondary note.
3. VRAM Budgeting: Loading the Weights Does Not Mean Stable Serving
Model Weights Are Only the First Cost
A theoretical estimate for weight storage can be expressed as:
Weight storage is approximately equal to the number of parameters multiplied by the number of bits per parameter, divided by eight.
For example, a hypothetical 30-billion-parameter model using an average of four bits per parameter would require roughly 15 billion bytes for the main weight data alone. This is only a theoretical estimate, not deployment data for any specific product.
Actual usage also includes quantization metadata, unquantized tensors, memory alignment, and implementation-specific overhead. The fact that a weight file fits into VRAM only indicates that deployment may be possible. It does not guarantee that long-context, concurrent, or multimodal requests will run successfully.
Context Caches Can Become the Main Bottleneck
In common autoregressive attention architectures, inference typically stores the keys and values associated with previous tokens to avoid repeated computation. This cache grows with context length and the number of concurrent requests.
For a common full-attention structure, cache usage can be roughly understood as depending on:
The number of layers, number of cache heads, head dimension, token count, numerical precision, and concurrency.
However, cache mechanisms differ across architectures. Models using local attention, hybrid structures, or other state representations cannot always be evaluated with the same formula.
Before deployment, measure peak VRAM usage separately for short contexts, long contexts, and concurrent workloads. It is unreliable to assume that a device can efficiently use a long context merely because the model or inference system claims to support it.
Multimodal Inputs Need a Separate Budget
Image understanding is not a free addition to text-only inference. Image encoding, visual representations, input preprocessing, and cross-modal fusion can all increase resource usage.
When a request contains multiple images or high-resolution images, time to first token and peak VRAM usage may change significantly. Text-only benchmarks cannot directly represent multimodal performance, so these workloads must be tested separately.
4. Quantization Balances Quality, Speed, and Resources
Quantization reduces the numerical precision of model weights or selected runtime data. This can reduce storage requirements and, when hardware and implementation support are good, improve execution efficiency.
However, lower precision does not necessarily mean higher speed. Some quantization formats require additional decoding or lack efficient computation paths. Low-bit configurations may also cause greater quality degradation on complex tasks.
At minimum, compare the following three task categories:
- Basic tasks: Information extraction, format conversion, and short-text summarization.
- Business tasks: Code modification, long-document question answering, and structured report generation.
- High-constraint tasks: Multi-condition instruction following, complex reasoning, and strict field-based output.
Keep the input, sampling settings, and output-length constraints consistent. Record accuracy, format pass rate, task completion time, and peak resource usage.
Weight quantization and context-cache quantization should also be evaluated separately. The former primarily affects the representation of model parameters, while the latter affects the representation of historical states. Their effects on quality are different. A configuration that works well when each is used separately may not remain reliable when both are applied together.
For high-cost-of-error scenarios such as financial data extraction and code security checks, quality degradation should be identified before prioritizing speed improvements.
5. How to Design Reproducible Performance Tests
Do Not Call Every Speed Metric “Generation Speed”
At least the following metrics should be reported:
- Time to first token: The time from request arrival until the first output token is produced.
- Prompt processing speed: The efficiency of processing the prompt and historical context.
- Decode speed: The number of tokens generated per second after output begins.
- End-to-end latency: The total time from request submission to completion.
- Aggregate throughput: The overall processing capacity when multiple requests run concurrently.
As concurrency increases, total throughput may rise while the waiting time for an individual user also becomes longer. Higher total speed under two concurrent requests does not necessarily mean a better experience for each request.
Fix the Test Conditions
Test records should include at least:
- Device memory and VRAM capacity;
- Whether all weights remain on the accelerator;
- Model precision and cache precision;
- Input length, output length, and concurrency;
- Whether image input is enabled;
- Whether speculative decoding or other acceleration mechanisms are enabled;
- Whether the test measures cold-start or warmed-up performance;
- The inference implementation version and key configuration settings.
Speculative decoding proposes candidate tokens and then verifies them. It may reduce the cost of serial generation, but its benefits depend on candidate acceptance rate, additional computation, and hardware conditions. Tests should retain a baseline with acceleration disabled to avoid treating configuration-specific gains as universal improvements.
Use Real Workloads Instead of a Single Demo
A practical test matrix can include short interactive requests, long-document analysis, code editing, image question answering, and concurrent requests.
Each task should be executed repeatedly. Report the median, higher-percentile latency, and failure rate rather than only the fastest result. If prefix caching is enabled, state whether the inputs are repeated; otherwise, processing efficiency for new requests may be overstated.
Token counts also cannot be directly equated with the number of Chinese characters or other visible characters. Different text structures produce different tokenization results, so cross-task comparisons require caution.
6. Capability Evaluation Should Measure Verifiable Outcomes
Programming Capability Requires Execution Results
Code-generation quality should not be judged only by whether the output looks syntactically fluent. More reliable indicators include:
- Whether tests pass;
- Whether edge cases are handled correctly;
- Whether new defects are introduced;
- Whether the changes comply with existing interface constraints;
- Whether security risks are introduced;
- Whether the necessary verification is completed.
For agents with tool-calling capabilities, also record invalid tool calls, repeated modifications, task completion rate, and the proportion of tasks requiring human intervention.
Producing a correct explanation does not prove that a model can reliably complete a coding task. Passing one demonstration does not prove that it provides reusable engineering capability.
Long Context Must Be Evaluated for Information Use
Support for a large context window only shows that the model or inference system can accept input of that length. It does not show that the model can reliably use all the information.
Place key evidence at different locations in a document and add similar but irrelevant distractors. Then test whether the model can locate the relevant evidence, combine it correctly, and maintain consistent references.
For knowledge-base question answering, retrieving relevant passages is often more effective than inserting an entire document without filtering. The larger the context window, the more important it becomes to control information noise.
Break Image Understanding into Specific Tasks
General image description, text recognition, table understanding, chart reasoning, and spatial-relation judgment represent different capabilities. Strong performance on one task does not prove reliability on the others.
Evaluation should check whether the model misses small text, misjudges coordinates, or confuses visual facts with speculation. Confidence in the wording should never be treated as evidence of recognition accuracy.
7. Managing Verbose Reasoning and Repetitive Loops
Longer reasoning output can sometimes help with complex tasks, but it may also contain repeated confirmation and redundant derivations that increase latency and cost.
This behavior alone is not enough to prove that a model uses a particular training strategy. At runtime, focus on observable outcomes: Does the additional generation improve accuracy, reduce errors, or merely extend request time?
Possible controls include:
- Set output and execution budgets according to task difficulty;
- Use concise response modes for simple tasks;
- Limit tool calls and retries for agents;
- Detect repeated text and repeated actions;
- Provide cancellation and fallback mechanisms for timed-out requests.
Repetition penalties are not a universal solution. Excessive penalties can damage code, field names, and necessary technical terms that legitimately need to be repeated. Adjust them gradually against a validation set.
The ultimate optimization target is the total time required to obtain a usable answer, not simply longer reasoning or higher instantaneous generation speed.
8. Local Deployment Cost Is More Than Hardware Price
Local deployment may reduce external inference spending, but its real cost also includes electricity, cooling, maintenance, hardware depreciation, failure recovery, and engineering labor.
A business-oriented metric is:
Cost per successful task = Total relevant cost during the evaluation period ÷ Number of tasks that meet the quality standard
A successful task must meet predefined requirements for accuracy, response time, and human-review effort. High output volume with frequent rework does not necessarily indicate better economics.
Local and remote inference are not mutually exclusive. Workloads with stable resource requirements, sensitive data, and relatively fixed tasks may be good candidates for local deployment. Workloads with large demand fluctuations, higher capability requirements, or a preference for centralized operations can also be evaluated against remote services.
The decision should be based on data-governance requirements, service reliability, workload variation, and total cost rather than the assumption that every user should adopt the same deployment model.
9. Conclusion: Replace Single-Point Judgments with a Complete Evidence Chain
The most useful conclusion when evaluating a new generation of large language models is not that one model is “universally better.” It is to specify what results the model can achieve for particular tasks, configurations, and budgets.
Developers can validate a model in the following order:
- Define business tasks, quality thresholds, and response-time requirements;
- Establish a reproducible baseline configuration;
- Measure weight, cache, and runtime resource usage;
- Compare actual task quality before and after quantization;
- Test long-context, multimodal, and concurrent workloads;
- Verify error handling and long-running stability;
- Calculate total cost based on successful tasks.
Only after these areas have been validated do generation speed and deployment price become meaningful for decision-making. The value of local LLM deployment lies in giving developers more controllable engineering options. Its practical scope should ultimately be determined by reproducible tests and real business outcomes.
