Local LLM Deployment and SQL Evaluation: Throughput vs. Task Completion
A practical evaluation splits local model assessment into two independent tracks: inference performance (prefill and decode throughput, TTFT, and concurrency decay) and SQL task completion with tool-calling. Measured results show queueing—not raw compute—as the main latency bottleneck, and strict output contracts as the main reason logical SQL still fails.
1. Why “It Runs” Is Not the Same as “It Is Usable”
After a new model version is released, teams usually ask two questions: whether a local deployment can hold up under concurrency, and whether the model can actually finish real business tasks. Many evaluations return only a single score or a vague sense that the model “feels stronger.” That kind of conclusion cannot support a selection decision. A more reliable approach is to split evaluation into two tracks that do not interfere with each other: one measures system performance while holding model capability constant; the other measures task completion while holding hardware and framework constant.
This evaluation follows that approach, and the result is not encouraging: on some capability dimensions, the new version even underperforms a lighter model in the same family. That counterintuitive outcome shows that version numbers and capability are not monotonic. Selection has to rest on reproducible, quantitative evidence.
2. The Performance Track: Four Core Metrics for Local Inference
2.1 Align the Definitions First
- Prefill throughput: tokens per second while processing the input prompt. It drives time-to-first-token on long inputs.
- Decode throughput: tokens per second during autoregressive generation. It is what users perceive as “typing speed.”
- TTFT (Time To First Token): time from request submission to the first returned token. It is the most sensitive metric for interactive applications.
- Concurrency decay: how much throughput falls relative to single concurrency as concurrency rises. It reflects scheduling and GPU-memory bottlenecks.
2.2 Measured Results
| Dimension | Observation |
|---|---|
| Prefill, single concurrency peak | About 757 tok/s (4k input); stable at 629–758 tok/s from 2k to 32k, with no clear length decay |
| Prefill concurrency decay | About 30%–45% at 2-way concurrency; about 50% at 4-way; about 63% at 6-way (688 → 228 tok/s at 2k input) |
| Decode, single concurrency | 23.8–28.7 tok/s, with small variance |
| Decode under concurrency | 8–18 tok/s; drops to a trough of 8–11 tok/s when 16k/32k prompts are combined with 4–6-way concurrency |
| TTFT | Rises roughly linearly with input length; at 32k input, 51.5s at 1-way concurrency and 186.4s at 6-way |
One caveat: decode throughput recovering to 20–28 tok/s at 32k input looks like noise. The sample is too small to support a trend, and it should not be written into the conclusion.
2.3 Bottleneck: Queueing, Not Compute
The key judgment is that TTFT gets worse mainly because of queueing, not because compute is insufficient. Three pieces of evidence support that. First, single-concurrency prefill shows almost no decay from 2k to 32k, so the long-sequence compute path is healthy. Second, prefill throughput collapses roughly linearly as concurrency rises, which matches requests being serialized. Third, GPU memory utilization is already 0.91, the KV cache is nearly full, and the scheduler has no headroom for in-batch parallelism.
When the framework’s maximum number of concurrent sequences is set to 2, the third request enters the wait queue. Long prefills block each other, compute is spread across only a few sequences, and aggregate throughput is cut roughly in half. That is a configuration problem, not a model problem.
2.4 Optimization Directions and Their Cost
A workable adjustment is to raise the maximum number of concurrent sequences and the maximum tokens per batch, so the scheduler can batch short requests and chunk long ones (chunked prefill) and fill idle compute. Memory has to be traded off carefully: the KV cache is already near saturation, and raising concurrency blindly can trigger preemption and recomputation, which increases tail latency. A sensible validation order is to raise the concurrency cap in small steps and watch TTFT P99, then adjust the batch token cap, and only then consider quantization or a shorter context.
Illustrative configuration (parameter names are generic; exact names vary by framework):
scheduler:max_concurrent_sequences: 8 # raised from 2 to reduce queueingmax_batched_tokens: 8192 # cap batch size so long requests do not monopolize the batchenable_chunked_prefill: true # chunk long prompts to reduce mutual blockingmemory:kv_cache_utilization_target: 0.85 # leave headroom and avoid preemption
3. The Capability Track: SQL Generation and a Closed Tool-Calling Loop
3.1 Evaluation Design
The task set has 25 items, graded trivial / easy / medium / hard. The model must complete a multi-turn tool-calling loop on its own: generate SQL, execute it in an embedded analytical database engine, read the result, check it, and return it. Scoring is strict: a case passes only when row count, column count, column names, and the first-row string all match.
3.2 Results Overview
Overall pass rate: 9/25 (36.0%). By difficulty: trivial 8/8, easy 1/2, medium 0/2, hard 0/13. The capability curve is a cliff: full marks on easy items, then a sharp drop.
Process quality is worth noting. All 25 items completed the tool-calling loop without giving up or looping forever. Complex multi-table JOINs and window functions (lag, ranking, and cumulative share) were written correctly; only two items had structural errors.
3.3 Main Failure Mode: Precision and Format
The largest source of failure is not logic. Required precision handling such as ROUND(…, 2) was omitted even when the prompt stated it explicitly. Under strict scoring, the first row must match as a string, so 15 of 20 logically correct items were “right logic, wrong format.” If numeric comparison tolerance were relaxed to 1e-6, the pass rate would rise to about 22/25 (88%).
That exposes a general issue: how strict the scoring rule is can change the conclusion substantially. In engineering practice, numeric tolerance and structural consistency should be tracked as two separate metrics. Otherwise precision issues hide real capability gaps.
3.4 Three Patterns of Structural Failure
- Output contract mismatch: on a multi-table join with a CTE discount calculation, result column names did not match the requirement.
- Window function returns an empty set: the task required a window over the query result (quarter-over-quarter). The model returned 0 rows with incorrect column names, which points to a weak grasp of nested query scope.
- Wrong business definition: on a channel-share item, the expected answer was the distribution channel at 73.3%. The model computed the online channel instead—a semantic mapping error, not a syntax error.
3.5 Cost-Side Observations
Trivial and easy items averaged 2 steps, about 2.2k input tokens and 0.2k output tokens. Hard items averaged 6.1 steps. The two most complex items used 17 steps and 55.5k tokens, and 14 steps and 55k tokens. Step count and token use can sit on a dashboard as an “inference efficiency” signal for spotting unproductive exploration.
4. Improvement Checklist
- Prompts: fix into the system prompt a rule that precision and column names in the task must be followed strictly, with a self-check before output, plus an output-contract template.
- Examples: provide a few standard SQL examples for window functions and period-over-period questions, covering nested scope.
- Evaluation: report strict match and tolerance match separately, and show tool-call success rate, average steps, and token use alongside pass rate.
- Serving: tune scheduler settings and use chunked prefill. Run inference on a container platform, and use logging plus monitoring and alerting to collect TTFT percentiles, queue time, and GPU memory level as a capacity baseline. On Baidu AI Cloud, the same pieces can be combined from general categories: a container platform, logging, and monitoring and alerting.
5. Conclusion
The main lesson is that a model version upgrade has to be judged on both system performance and task completion. Performance problems usually come from scheduling and GPU memory configuration. Capability problems often come from the output contract and the business definition. Clear metric definitions, separate scoring rules, and optimizations ordered by cost are what make an evaluation actually support selection and launch decisions.
