# Benchmarking Local LLM Deployments: Inference Performance and SQL Evaluation Guide
Deploying a large language model locally is only the first step. This guide walks through how to evaluate a locally deployed LLM across two independent dimensions: inference performance under realistic workloads, and output quality for structured tasks like SQL generation. It covers how to separate prefill, decode, and queueing effects when interpreting latency numbers, how to design load tests and tune based on evidence, how to diagnose SQL failures across execution, semantic, and delivery layers, and how to build validation and retry budgets into your pipeline before going live.
1. Local Benchmarking Answers Two Different Questions
After deploying a model locally, teams typically run a single request to confirm it generates output, then a batch of tasks to check quality. But between “it runs” and “it’s ready for production” lie two questions that must be answered independently:
- Performance: Under your target input lengths and concurrency, how long do users wait, and how many requests can the service handle stably?
- Quality: Can the model’s output be consumed directly by downstream systems without manual correction?
A single composite score cannot answer both. Interactive Q&A cares about whether the first token returns promptly and streaming stays smooth; batch SQL jobs can tolerate longer waits but not wrong statistical definitions or inconsistent column structures. The right order is to define your use case and acceptance criteria first, then select the load profile and task suites. The numbers cited below come from a single round of local testing and are used to illustrate the analysis method—they do not represent results you’ll see on other hardware, models, or scheduling configurations.
2. Inference Performance: Look at Prefill, Decode, and Queueing Separately
Prefill processes the input sequence and builds the key-value cache needed for generation; decode generates output token by token based on existing context. Time to first token (TTFT) measures from when a request is sent to when the first output token arrives. In end-to-end testing, TTFT reflects not only prefill but also request queueing, processing, and result transmission overhead. Prefill throughput, decode throughput, and TTFT therefore answer different questions and cannot substitute for one another.
In this test run, at a concurrency of one, as input length grew from roughly 2K to about 32K tokens, prefill throughput stayed at approximately 629–758 tokens/second, peaking around 4K tokens, with no sustained degradation observed. Single-request decode throughput was roughly 23.8–28.7 tokens/second. One common misconception arises here: stable processing throughput does not mean TTFT stays flat as input grows. Even if tokens processed per second don’t change, longer inputs mean more prefill work to complete.
The picture changes noticeably as concurrency rises. With ~2K-token inputs, single-request prefill throughput dropped from about 688 tokens/second at one concurrent request to about 228 tokens/second at six. With ~32K-token inputs, TTFT climbed from 51.5 seconds at single concurrency to 186.4 seconds at six. In some long-input, higher-concurrency combinations, single-request decode throughput fell to roughly 8–11 tokens/second; a few long-input data points even rebounded. Without repeated multi-run testing, those rebounds shouldn’t be interpreted as a performance advantage from longer inputs.
Also distinguish per-request throughput from total service throughput. When more requests run simultaneously, individual requests may slow down, yet the total tokens completed per unit of time may still increase. For interactive scenarios, focus on tail behavior of TTFT and inter-token latency; for batch scenarios, combine tasks completed per unit of time, request failure rate, and total token throughput. Reporting only an average rate tends to hide the issues that actually hurt user experience.
3. Designing Load Tests and Tuning on Evidence
3.1 Control Input Length, Output Length, and Arrival Patterns Independently
Start with a small test matrix: fix the output length range and vary input length to observe prefill and TTFT; then fix input length and vary output length to observe decode and task completion time; finally, mix short and long requests to check whether short requests get dragged down by long ones. For each run, record actual input and output token counts, requests completed, failures, and test duration. If output lengths vary widely, comparing task completion times directly is often meaningless.
Arrival patterns should match your workload. Fixed concurrency suits comparing how a system serves several simultaneous requests, but it may not reflect queue growth under sustained traffic. If production requests arrive at relatively independent intervals, also test under a fixed request arrival rate—watch whether completion rate keeps up with arrival rate and whether backlogs drain after traffic subsides. Run each group after warm-up and repeat it, reporting median and high-percentile latencies. With too few samples, always list the sample size; don’t treat high-percentile figures as stable conclusions.
3.2 Verify the Queue Bottleneck Before Raising Parallelism Limits
In this test, the service’s upper limit was 2 concurrently processed sequences; submitting more concurrent requests caused queueing. Longer inputs hold a processing slot longer, so queueing is the first hypothesis to explain the sharp TTFT increase on long inputs. However, TTFT observed from the client alone cannot precisely quantify the queueing contribution. The more reliable approach: record timestamps for request arrival, execution start, first token, and request completion, while monitoring queue depth and cache usage in parallel. Only then can you distinguish “never started executing” from “started but processing slowly.”
If the evidence shows the queue growing while GPU memory and cache headroom remain, you can incrementally raise the concurrent-sequence limit or adjust the per-batch token budget. Change one variable at a time and re-compare total throughput, TTFT, and failure rate. In this test, memory was already tight and the key-value cache was near capacity, so pushing parallelism higher was unlikely to help. If the bottleneck is mainly long requests hogging resources, more practical options include capping input length, using separate queues for long and short requests, or delivering tasks that exceed the real-time budget asynchronously. The goal of tuning isn’t to maximize concurrency parameters—it’s to complete more tasks stably within acceptable tail latency and failure rates.
4. SQL Capability: Separate Execution Success, Semantic Correctness, and Format Compliance
In a 25-question test suite, the model completed the full pipeline—generating SQL, executing the query, and checking results—for every question, but only 9 passed under strict acceptance rules, a 36% pass rate. It passed 8 of 8 basic questions, 2 of 4 simple ones, and none at medium or hard difficulty. During execution, the model could write multi-table joins and various window computations; in final delivery, those abilities didn’t reliably translate into results that met the interface requirements.
This kind of evaluation should keep at least three diagnostic layers:
- Execution layer: Does the query parse and run? Does it fail due to missing columns, type mismatches, or resource limits? A query returning zero rows isn’t necessarily an execution error—only when the expected result is non-empty does a zero-row return warrant further investigation.
- Semantic layer: Do aggregation granularity, grouping dimensions, filter ranges, and metric denominators match the question’s intent? For example, computing dealer channel revenue as online channel revenue may run cleanly and round to two decimal places, yet answers a different business question.
- Delivery layer: Do column names, column order, row counts, and numeric representation meet downstream contracts? If the question requires rounding to two decimals, verify the final expression actually performs that operation; if the interface also requires fixed two-decimal display, check result serialization separately—numeric rounding and string formatting are not the same thing.
The original test used strict matching on row count, column count, column names, and first-row content. Several results failed only because a required rounding step was skipped. The test log also provided an estimate: with numeric comparison relaxed to a tolerance of about 10⁻⁶, the pass rate would be roughly 88%. That estimate is useful for gauging how sensitive automated scoring is to precision requirements—it cannot replace the strict 36% result, nor prove that all queries failing strict checks are semantically correct. For multi-row results in particular, matching the first row says nothing about the whole table. Business acceptance should compare complete results per the interface contract: validate ordering when required, ignore it when not—but always check for duplicate rows.
5. Bake Prompt Constraints, Result Validation, and Retry Budgets into the Pipeline
Prompts can explicitly instruct the model to check four things before submitting a query: whether the statistical definition matches the question, whether output column names and order are correct, whether rounding happens at the required computation stage, and whether sorting is deterministic. For window computations like quarter-over-quarter comparisons, add a generic example showing aggregation at the target time granularity first, then computing the prior-period value, and specify how to handle the first period, missing periods, and zero denominators. Examples exist to clarify rules—not to have the model copy a fixed query.
Whenever a constraint can be checked programmatically, delegate it to code rather than relying on model self-review. For instance, on column-name mismatch, return the diff between expected and actual columns; on empty results, prompt the model to check join keys, filters, and time ranges instead of blindly regenerating the whole query without diagnostic information. For requests with ambiguous business dimensions, ask for the channel scope, revenue definition, or reporting period rather than defaulting to one interpretation. The execution environment for automated queries should use read-only privileges, with query time limits and result-size caps, so a long-running query in evaluation doesn’t become a system-level resource problem.
Finally, factor inference cost into quality evaluation. In this test, some easy tasks finished in about two steps, hard questions averaged around six, a few exceeded ten, and the recorded token consumption reached about 55K. More retries did not get hard questions past strict rules, so you cannot assume “keep retrying” improves outcomes. A more robust approach: set budgets on retry rounds, cumulative tokens, and wall-clock time. When there’s a clear error signal, perform targeted fixes; when the same error repeats, or the information needed to determine the statistical definition is missing, stop retrying and return a diagnosable failure state. When comparing optimizations, report first-attempt pass rate, final pass rate within budget, and average cost per passed task separately.
6. Final Acceptance Before Launch: Target Workloads, Real Interfaces
On the performance side, use your production input length distribution, arrival rate, and long/short request mix; check TTFT at high percentiles, completion throughput, queue backlog, and failure rate. On the quality side, report semantic correctness and strict delivery pass rate by task difficulty, and trace whether typical failures stem from rounding, field contracts, or business definitions. After every change to scheduling configuration, prompts, or validation rules, re-run the same regression workload, then judge whether the gains outweigh the added latency and resource costs.
Whether a local deployment is production-ready ultimately comes down to two things holding simultaneously: the service delivers stably under the target workload, and the results meet downstream contracts within the target cost. Peak throughput helps locate performance ceilings; lenient scoring helps explain failures—but launch decisions should rest on reproducible end-to-end results.
