Local LLM Coding Benchmark: A Practical Guide to Quantization Selection
This article presents a hands-on benchmark of three quantized small-model configurations running on a dual-GPU local inference platform, and turns the findings into a reusable evaluation framework. Instead of relying on single-turn Q&A or subjective scoring, the test measures native tool calling, bug fixing, and end-to-end application delivery with fully automated, machine-based grading. The results show that all three quantization routes can complete the tasks, but they behave very differently: a low-bit route wins on speed by producing minimal output, an FP8 route minimizes cost through a high prompt-cache hit rate and planned execution, and a deep-reasoning route delivers the best code quality and test coverage at the cost of wall-clock time. The article also defines the metrics teams should track, explains how to match each route to a task profile, and lists operational practices for running local coding agents reliably.
1. Why Local Quantized Models Need to Be Re-evaluated for Coding
Over the past two years, the main reasons for running large models locally were keeping data inside the internal network and controlling marginal cost. That motivation is now shifting. Small, low-latency “Flash-class” models are already capable of handling real engineering work, and local deployment is moving from “usable” to “genuinely good.” The problem is that evaluation practices have fallen far behind this capability curve.
Many public leaderboards still rely on single-turn question answering or static code completion as their samples. Real development work is a long-horizon agentic process: the model has to read a repository, search for symbols, invoke a terminal and test frameworks, self-correct based on failure output, and stay aligned with the goal across many turns. These tasks are far more sensitive to hardware, quantization format, and inference engine than single-turn Q&A.
This article uses a side-by-side test — a dual-GPU local inference platform running three small models with different quantization schemes — as raw material. Product-specific details are stripped out and the material is generalized into a transferable evaluation framework: how to objectively compare the agentic coding performance of different quantization routes under local compute constraints, and how to turn that into a team-level selection decision.
2. Test Design: Breaking “Coding Ability” into Four Measurable Parts
Credible evaluation starts with task design. This test used no subjective scoring. Instead, it built three categories of automatically judgeable tasks covering the full chain of tool use → defect repair → end-to-end delivery.
- Native tool-calling ability: the model acts as an agent and must call 21 native tools in a controlled environment, including file read/write, directory traversal, dependency lookup, process execution, and test running. The focus is on tool-selection accuracy and argument validity, not the final answer.
- Bug-fixing ability: 17 realistic Elixir defect samples, each with an executable reproduction path and assertions. A fix must turn the existing test suite fully green, which prevents “the symptom is fixed but the semantics are broken.”
- End-to-end build ability: one full web application build task with 19 checkpoints covering routing, data validation, error handling, logging, observability, and other engineering details.
- Scoring method: scoring is fully automated by machine, with no LLM-as-judge. This removes the systematic bias of “models preferring models” at the mechanism level.
The value of this design is that every conclusion is reproducible and auditable. Anyone who fixes the hardware, quantization format, and task set can obtain comparable numbers, rather than an experience report that depends on subjective impressions.
Illustrative evaluation driver logic (pseudocode; it expresses the flow only and is not bound to any specific tool):
def run_case(model, case, max_turns=200):env = Sandbox.from_snapshot(case.snapshot)trace = []for turn in range(max_turns):action = model.next_action(env.observe(), history=trace)if action.type == "tool_call":result = env.invoke(action.tool, action.args) # invalid arguments score as a failuretrace.append((action, result))elif action.type == "final":return score(env, case, trace) # machine scoring: test pass rate + checkpoint coveragereturn score(env, case, trace, timeout=True)
3. Reading the Results: Three Quantization Routes, Three Distinct Working Modes
All three models passed every test, but the process metrics differed dramatically. That is exactly the point: “can it get the answer right” is no longer the main dividing line — “at what cost does it get it right” is.
3.1 The Minimal-Output Route: Trading Verbosity for Time
The model using a 4-bit low-bit quantization scheme (EXL3) finished the application build stage in about 18.4 minutes, the fastest of the three. Its cost is that per-token throughput in the underlying inference engine is not competitive; the advantage comes entirely from “saying less” — the whole task produced only about 20,000 tokens.
This highlights a frequently overlooked engineering fact: total agentic task time ≈ total output tokens ÷ effective throughput + tool execution and waiting overhead. When a model prefers brief explanations and edits code directly, end-to-end latency can be the lowest even on a slower engine. But extremely terse output also means weak process explainability and higher troubleshooting cost for humans when something goes wrong.
3.2 The High-Cache-Hit Route: Trading Planning for Cost
The model using 8-bit floating-point quantization (FP8) needed the fewest interaction turns, about 77, with a clear behavioral pattern: it produces a plan first, then executes step by step, which makes the process easy to read. More importantly, its prompt-cache hit rate reached roughly 98%, meaning repeated portions of the long context avoided a large amount of recomputation and the compute cost per task was the lowest.
The implication for long-running background tasks is direct: the more standardized the stable prefix (system prompt, repository conventions, tool descriptions), the higher the cache benefit. Conversely, if volatile content is placed at the beginning of the prompt, the cache hit rate collapses and the cost advantage disappears with it.
3.3 The Deep-Reasoning Route: Trading Time for Engineering Quality
The model using 4-bit asymmetric floating-point quantization (NVFP4) performed substantial internal reasoning on every turn and took the longest overall, about 27.6 minutes, but it produced the most standardized code and the most test cases (18), with the best engineering-quality metrics.
“Slow” therefore does not mean inefficient. When acceptance criteria include maintainability, test coverage, and edge-case handling, the extra thinking budget converts into fewer rework rounds. Judging only by wall-clock time systematically undervalues this class of model.
4. Metric Definitions: Do Not Decide on a Single Dimension
Generalizing the observations above into a metric set, teams should record at least the following five categories of data; any single-metric ranking can mislead:
- End-to-end wall-clock time (including tool waiting), not model inference time alone;
- Total output tokens and average output per turn, used to explain the root cause of speed differences;
- Number of interaction turns, tool-call success rate, and invalid-argument rate;
- Prompt-cache hit rate, used to estimate real compute cost;
- Machine-scored sub-items: test pass rate, checkpoint coverage, number of test cases, and change size (fewer changed lines usually means higher trustworthiness).
A practical criterion is the “effective work ratio” = checkpoints passed ÷ total interaction turns. A low ratio means the model is spinning in place; a high ratio combined with small output indicates strong action priors.
5. Selection Advice: Match the Task Profile, Not the All-Round Champion
- Daily iteration and bug fixing: prefer the high-cache-hit, strongly planned 8-bit floating-point scheme. It offers the best balance of efficiency and cost and suits long unattended runs.
- High-quality delivery and pre-review gating: choose the deep-reasoning low-bit floating-point scheme, trading time for standardization and test coverage, well suited as a “pre-commit gatekeeper.”
- Prototyping and time-boxed demos: choose the minimal-output low-bit scheme to get a runnable result fastest, then hand it to the first two types of models for refactoring and test backfill.
Combined usage usually beats a single choice: let the minimal model produce a runnable skeleton first, then have the deep-reasoning model add tests and refactor, and finally have the planning-oriented model do batch fixes. This balances speed and quality while keeping total cost under control.
6. Implementation Practice: Keeping Local Agents Running Reliably
- Environment isolation: all tool calls must execute inside containers or sandboxes, with filesystem scope and network egress restricted and implicit privilege escalation forbidden.
- Prompt layering: put stable content first and volatile content last to maximize cache hits; describe tools with structured definitions rather than natural-language paragraphs.
- Budget guardrails: set maximum turns, maximum output tokens, and timeout thresholds; terminate and archive the trace once any limit is exceeded, preventing infinite loops from burning compute.
- Observability: write each turn’s input summary, tool arguments, return codes, and elapsed time to a logging service, and set thresholds on failure and timeout rates with monitoring alerts.
- Asset accumulation: store reusable repository conventions, checklists, and test templates in object storage or a code repository, and reuse them as a fixed prefix.
- Evaluation regression: version the task set and scoring scripts, and run a regression whenever the model or quantization scheme changes — decide with data, not with feelings.
As demand for compute elasticity grows, local inference can be combined with general-purpose capabilities such as cloud container platforms and message queues to form a layered architecture of “sensitive data processed locally + batch evaluation in the cloud.” In this kind of layered practice, Baidu AI Cloud is typically used to host standardized container and observability components, while the model and data boundaries remain under the enterprise’s own control.
7. Conclusion
The coding ability of small local models has already crossed the usability threshold. The real differences show up in the “behavioral modes” shaped jointly by quantization format and inference engine: the minimal-output route wins on speed, the clearly planned route wins on cost, and the deep-thinking route wins on quality. Building an evaluation system centered on machine scoring and supported by multi-metric definitions, then combining different routes according to task profiles, is the sustainable path to engineering practice.
