Evaluating Large Language Model Local Deployment and SQL Generation Capabilities

    This article evaluates the local deployment performance and SQL generation capabilities of a formal release of a Large Language Model (LLM). It analyzes deployment metrics including throughput, latency, and concurrency stability, alongside structured SQL generation tasks under strict evaluation criteria. The findings reveal stable single-concurrency performance but significant degradation under high concurrency due to scheduling limits and memory constraints. While the model demonstrates strong SQL reasoning and tool-calling loops, strict pass rates are hindered by formatting and precision issues. The article concludes with engineering recommendations for capacity planning, scheduling optimization, and prompt engineering.

    1. Background and Evaluation Methodology

    When evaluating the engineering readiness of a formal LLM release, the focus extends beyond whether the model can answer isolated questions correctly. Key concerns include local deployment throughput, latency, concurrency stability, and the ability to consistently produce executable, verifiable, and format-compliant results in structured tasks. This article is based on an anonymized local test, analyzing deployment performance and SQL generation capabilities. It should be noted that test results are heavily influenced by hardware environment, quantization methods, inference framework scheduling configurations, batch processing strategies, and evaluation script criteria. The following conclusions serve as a reference for problem identification and methodology rather than absolute performance benchmarks across all environments.

    The evaluation is divided into two parts. The first part focuses on local deployment speed testing, covering single-concurrency and concurrency degradation in Prefill and Decode phases, Time To First Token (TTFT) variations with length and concurrency, and scheduling bottleneck analysis. The second part involves model capability testing, specifically examining tool-calling loops, complex multi-table JOINs, window functions, cumulative share calculations, and column name and precision formats in SQL generation tasks. The evaluation employs strict criteria: a test is considered passed only if the row count, column count, column names, and the first row results all match exactly. This standard aligns with production environment requirements where results must be directly consumable by downstream systems, exposing hidden issues where logic is correct but format is non-compliant.

    2. Deployment Performance: Stable at Low Concurrency, Bottlenecked by Scheduling at High Concurrency

    From the Prefill perspective, the peak speed for single concurrency is approximately 757.7 tok/s (4k context), maintaining around 629 to 758 tok/s in the 2k to 32k range, with no significant throughput degradation as length increases. This indicates that under single or low concurrency pressure, the Prefill phase’s sensitivity to context length is relatively manageable. However, degradation becomes significant as concurrency increases: 2 concurrent requests drop by about 30% to 45%, 4 concurrent requests drop by about 50%, and 6 concurrent requests drop by about 63%. For instance, in the 2k scenario, throughput drops from 688 to 228. This phenomenon is not purely a lack of computing power but is more likely related to the scheduling concurrency limit being set to 2. When concurrent requests exceed 2, requests enter a queue, and long Prefills block each other, resulting in averaged throughput and worsened tail latency.

    On the Decode side, single concurrency ranges from 23.8 to 28.7 tok/s, performing relatively stably. Under concurrency, it drops to around 8 to 18 tok/s, further declining to 8 to 11 tok/s when long prompts (16k/32k) are combined with 4 to 6 concurrent requests. A rebound to 20 to 28 tok/s in the 32k scenario is likely data noise and requires repeated experiments for confirmation. TTFT increases almost linearly with length, rising from 51.5s at 1 concurrency to 186.4s at 6 concurrency in the 32k scenario, primarily due to queuing. Overall, the current configuration’s bottlenecks lie in scheduling and GPU memory: the low concurrency limit causes queuing, while a memory utilization of about 0.91 and KV cache nearing its upper limit restrict the room for increasing concurrency.

    Improvement directions should be phased. First, moderately increase the concurrency limit and batch processing token limit, observing the trade-off between high-concurrency throughput and TTFT. Second, implement admission control, separate pool scheduling, or priority queues for long-context requests to prevent long Prefills from blocking short requests. Third, record hardware, quantization, batch processing, memory usage, and KV cache levels to establish a reproducible stress testing baseline. Fourth, if memory is nearly full, mitigate issues through more refined KV cache management, request length bucketing, and capacity planning. It must be emphasized that high-concurrency optimization is not simply about increasing parameters but finding a balance among throughput, latency, memory, and stability.

    3. SQL Generation Capabilities: Complete Loop but Formatting Issues Under Strict Criteria

    The capability test achieved an overall score of 9/25 PASS (36.0%): 8/8 for simple questions, 1/2 for easy questions, 0/2 for medium questions, and 0/13 for difficult questions. In terms of SQL generation, all 25 questions successfully completed the tool-calling loop autonomously: “Generate SQL -> Execute in local analytical database -> Verify result -> Mark result pass.” Complex multi-table JOINs and window functions (e.g., LAG, ROW_NUMBER, cumulative share) were mostly written correctly, with structural errors appearing only in a few complex questions. This demonstrates the model’s strong SQL structured reasoning and execution loop capabilities, though the pass rate under strict criteria was significantly dragged down by formatting and column naming issues.

    The primary point of failure was ROUND precision: the model often omitted the ROUND(...,2) required by the prompt. Since the evaluation required strict string matching for the first row, 15 out of 25 questions failed due to “correct logic, wrong format.” Structural failures included: returning mismatched column names in a multi-table CTE scenario with discounts; a quarter-over-quarter window function returning 0 rows with mismatched column names; and a channel scope discrepancy where the expected distribution channel share was 73.3%, but the model calculated it for the online channel. Regarding token consumption, simple questions averaged about 2 steps (approx. 2.2k+0.2k tokens), while difficult questions averaged 6.1 steps, with some high-consumption questions taking up to 17 steps (55.5k tokens) and 14 steps (55k tokens). If precision is relaxed to 1e-6, the pass rate reaches approximately 22/25 (88%), indicating that most failures are not complete calculation logic errors but failures to meet strict output contracts.

    In production, SQL results often feed directly into reports, APIs, or downstream systems. Column names, row counts, precision, and first-row formats are all part of the contract. Optimization recommendations include: reinforcing “must strictly execute ROUND and alias specifications as required by the prompt” in the system prompt; providing example SQL for window functions, CTEs, and multi-table scope questions; incorporating automated format validation and a single repair retry into the tool-calling loop; and tracking both strict and relaxed pass rates during evaluation to distinguish between logical capability and contract compliance. The example validation logic can be abstracted as follows:

    1. SELECT ROUND(SUM(amount), 2) AS total_amount
    2. FROM fact_table
    3. WHERE dt BETWEEN :start_dt AND :end_dt;
    1. for task in tasks:
    2. sql = model.generate(task.prompt)
    3. result = db.execute(sql)
    4. ok = judge(result, expected, strict=True)
    5. if not ok:
    6. repair_prompt = build_format_feedback(result, expected)

    4. Conclusion and Engineering Recommendations

    Overall, this formal release possesses a usable baseline for single-concurrency Prefill and Decode, a complete SQL tool-calling loop, and certain reasoning capabilities for complex queries. However, under high concurrency, TTFT and throughput are notably constrained by scheduling limits and memory levels, and strict evaluation reveals insufficient adherence to formatting contracts. For enterprise users, selection and deployment should not solely focus on average pass rates but should also consider: tail latency under long-context high concurrency, matching scheduling parameters with memory capacity, output contracts like SQL column names and precision, and automated repair capabilities after failures. It is recommended to establish a combined evaluation system comprising a “performance stress test baseline + tiered capability evaluation + strict format validation,” combined with business SLAs for capacity planning and prompt engineering optimization.