Evaluating Local LLM Inference Performance and SQL Capabilities: A Practical Methodology
This article presents a layered evaluation methodology for locally deployed large language models, separating inference performance from task capability. It covers Prefill and Decode throughput, TTFT, and concurrency degradation, along with a strict evaluation of tool-calling SQL tasks. The key takeaway is that poor performance and low scores often stem from serving configuration and output-format compliance rather than the model itself. Readers will find reproducible metrics, root-cause analysis, and a checklist for consistent benchmarking.
1. Why a “General Release” Does Not Mean “Ready for Production”
Once a large language model reaches its general release stage, teams usually care less about leaderboard scores and more about two questions: does it run fast enough on our own hardware, and can it complete tasks correctly within a real business workflow? The reason an initial evaluation concluded that results were “unsatisfactory, with some metrics trailing lightweight versions” is not a single weak metric, but the combined effect of two problem classes: performance constrained by serving configuration and capability constrained by output formatting. This also suggests that evaluation must be layered, decoupling the “serving and hardware” layer from the “model and prompt” layer. Otherwise, it is easy to misclassify an engineering configuration issue as a model capability issue.
2. Performance Evaluation: Splitting Throughput into Prefill and Decode Curves
2.1 Aligning Metric Definitions First
- Prefill throughput: Tokens generated per second during the input prompt processing stage; it determines time-to-first-token for long contexts.
- Decode throughput: The generation rate during the token-by-token stage; it determines the reading experience.
- TTFT (time to first token): The most directly perceived metric by users, including both queueing time and actual computation time.
- Concurrency degradation: The relative throughput drop when concurrency increases from 1 to N.
2.2 Typical Observed Patterns
Single-concurrency Prefill peaked at roughly 757 tok/s (4k input) and stayed within 629–758 tok/s across the 2k–32k range, indicating that length itself is not the primary source of degradation. However, when concurrency rose to 2, throughput dropped by about 30%–45%; at 4 concurrency it was around 50%; and at 6 concurrency it reached about 63% (688 down to 228 at 2k input). Decode stayed stable at 23.8–28.7 tok/s under single concurrency, fell to around 18 tok/s above 8 concurrency, and hit a low of 8–11 tok/s when long prompts were combined with 4–6 concurrency. TTFT rose nearly linearly with length: at 32k input, single concurrency was about 51.5 seconds, rising to about 186 seconds at 6 concurrency.
2.3 Root Cause: A Scheduling Ceiling, Not a Compute Shortage
The patterns above strongly point to batch and concurrency limits on the inference server being set too low: when the concurrency limit is set to 2, excess requests can only queue, long Prefill operations block one another, and throughput gets averaged out while TTFT is dominated by queueing. The illustrative startup parameter logic below (expressing the idea only, not a specific product interface) is as follows:
# Increase the number of parallel sequences and the per-batch token budget, then observe throughput and GPU memory levelsserve --model <path> \--max-num-seqs 16 \--max-num-batched-tokens 8192 \--gpu-memory-utilization 0.90
Tuning requires trade-offs: when GPU memory utilization has already reached 0.91, the KV cache is near saturation, and blindly raising the concurrency limit will trigger preemption and recomputation, causing jitter instead. A viable path is to first quantify KV cache usage, then step up concurrency incrementally, combined with common techniques such as tensor parallelism, quantization precision, and paged attention to reduce the per-sequence memory footprint. If using a cloud container platform with monitoring and alerting services, GPU utilization, memory usage, and queue length should be placed on the same dashboard to avoid looking at a single throughput number alone.
3. Capability Evaluation: Strict Judging of Tool-Calling SQL Tasks
3.1 Evaluation Design
The task set contained 25 questions, divided by difficulty into trivial / easy / medium / hard. The model had to autonomously complete a multi-step loop of “generate SQL → execute it in an embedded analytical database → validate the result.” Judging used the official strict standard: a pass requires all of row count, column count, column names, and the first-row string to match.
3.2 Result Profile
A total of 9/25 passed (36%): trivial 8/8, easy 1/2, medium 0/2, hard 0/13. Notably, all 25 questions completed the tool-calling loop, and complex multi-table joins and window functions (such as lag-based retrieval, ranking, and cumulative share) were basically written correctly, showing that semantic understanding and the execution pipeline are working.
3.3 Attribution of Lost Points
- Format precision: 15 questions were “logically correct but off by one point on formatting,” because the decimal-place rounding required by the prompt was omitted, and a first-row string mismatch meant failure; if the numeric tolerance were relaxed to 1e-6, the pass rate could rise to about 22/25 (88%).
- Structural errors: A few questions returned mismatched column names or empty result rows, or showed a misunderstanding of channel definitions (calculating online channel share as distribution channel share).
- Cost: Simple questions averaged 2 steps and about 2.4k tokens; hard questions averaged 6.1 steps, with individual questions reaching 14–17 steps and on the order of 55k tokens.
3.4 Improvement Suggestions
In the system prompt, write “strictly follow the rounding and column-naming requirements in the prompt” as a hard constraint, and provide paradigm examples for window-function questions. On the evaluation side, it is recommended to run dual standards in parallel (strict matching plus numeric tolerance), separating “capability problems” from “specification-compliance problems” in the statistics.
4. A Reproducible Evaluation Checklist
- Fix the hardware, driver, inference framework version, and quantization precision, and record an environment fingerprint.
- Cover the performance matrix with four length tiers (2k/4k/16k/32k) × concurrency levels of 1/2/4/6/8, repeating each cell three times and taking the median.
- Collect four metric categories simultaneously: throughput, TTFT, queue length, and memory level.
- Retain the original SQL and execution logs for the capability evaluation to enable per-question review.
- When drawing conclusions, distinguish among three attribution categories: “serving configuration bottleneck,” “missing prompt constraints,” and “insufficient model capability.”
5. Conclusion
The real value of this evaluation lies in demonstrating layered attribution: poor performance mainly comes from concurrency scheduling configuration and memory headroom rather than the model itself; low capability scores mainly come from output-specification compliance rather than reasoning logic. Optimizing the two separately can typically yield significant gains without swapping the model.
