Benchmarking Local LLMs for Coding: Quantization Schemes and Agent Performance Analyzed
This article reviews an independent benchmark of three open-source models with different quantization schemes running on local dual-GPU hardware, covering bug-fixing and full web application builds. It explains how output verbosity, prompt cache hit rates, and reasoning depth—not just raw inference speed—determine end-to-end agent performance, and offers scenario-based selection guidance for developers running coding agents locally.
1. Background: Why Benchmark Models on Local Hardware
As LLM inference hardware becomes more accessible, a growing number of developers are running quantized open-source models on local or edge environments for tasks such as code completion, bug fixing, and agentic coding. Compared with calling cloud APIs directly, local deployment offers inherent advantages in data privacy, latency control, and long-term cost. But it also raises new questions: the choice of quantization scheme significantly affects inference speed, output quality, and token consumption—and these factors ultimately determine how efficiently an agent completes tasks and whether it is viable for real engineering work.
Recently, an overseas developer published an independent evaluation that horizontally compared three open-source models using different quantization schemes, running on an all-in-one dual-GPU inference device. The value of this report lies not in declaring “which model is best,” but in revealing several often-overlooked patterns: model speed is not determined by the inference engine alone—output conciseness, cache hit rates, and interaction strategy matter just as much. This article restructures and expands on the report’s core findings to distill a reusable evaluation methodology.
2. Evaluation Design: A Maximally Objective Automated Scoring Framework
2.1 Test Task Design
The evaluation included two categories of tasks:
- Bug-fixing tasks: 17 typical language-level bugs, testing the model’s grasp of language features, runtime errors, and debugging toolchains;
- A complete application build task: a web application with 19 functional checkpoints, testing the model’s planning and execution capabilities across multi-file, multi-dependency, long-chain tasks.
2.2 Tool Calling and Automated Scoring
The test required models to work as agents, with access to 21 native tools including file read/write, command execution, dependency management, and test running. This design simulates real development scenarios: rather than simple Q&A, the model must autonomously decide the order of tool calls, handle errors, and iterate on fixes.
To ensure objectivity, all results were scored automatically by scripts, with no LLM-as-judge involved. Scoring dimensions included:
- Task completion (whether all checkpoints passed)
- Total time (end-to-end)
- Number of interaction turns
- Total tokens generated
- Number of test cases and code quality/conventions
The core idea of this framework is worth adopting: break “is the model good to use” down into quantifiable engineering metrics, and replace subjective judgment with deterministic scripts.
3. Performance Differences Across the Three Models and Root-Cause Analysis
3.1 Low-Bit Quantization: Trading Conciseness for Speed
Model A, using 4-bit-class low-bit quantization, finished the application build task in the shortest time—about 18.4 minutes. Notably, its underlying inference engine was not the fastest per step; the real speedup came from extremely low output volume, generating only about 20K tokens in total.
This illustrates an important pattern: in agentic scenarios, end-to-end time ≈ per-step inference speed × total token count. Models with low-bit quantization tend to be more “economical” in expression—omitting redundant explanations and outputting key code directly—making them faster overall. Of course, this conciseness may come at the cost of some readability and comment completeness.
3.2 High-Precision Quantization: Winning Through Planning and Caching
Model B, using FP8 high-precision quantization, required the fewest interaction turns—only 77. Its working style showed a clear “plan first, then execute” pattern: it produced a task decomposition plan upfront, then implemented step by step, in a clear and traceable process.
More critically, it achieved a 98% prompt cache hit rate. In multi-turn agent interactions, every turn carries the full conversation history; if the cache hit rate is low, massive repeated computation significantly inflates latency and resource consumption. A high hit rate means incremental computation cost is minimized, making this model especially suitable for long-running autonomous background tasks, such as overnight batch refactoring or automated fixes in CI pipelines.
3.3 Deep-Reasoning Model: Trading Time for Engineering Quality
Model C, using a 4-bit floating-point-class quantization scheme, performed extensive internal reasoning in each interaction—extended thinking before generating answers. This made its total runtime the longest (about 27.6 minutes), but its output quality was also the most outstanding:
- The cleanest code structure, with clear module separation;
- The most automatically generated test cases (18), with the broadest coverage;
- The highest overall engineering quality.
This confirms a widely observed pattern in the industry: there is a positive correlation between the “thinking budget” at inference time and output quality. For projects that demand high test coverage and long-term maintainability, the extra time is a worthwhile investment.
4. Selection Recommendations and Engineering Takeaways
4.1 Scenario-Based Selection
| Scenario | Recommended Direction | Rationale |
|---|---|---|
| Daily development, cost-sensitive | FP8 high-precision quantized model | Balanced efficiency and cost, high cache hit rate |
| Code quality and test coverage first | Quantized model with deep reasoning | More test cases, better engineering quality |
| Rapid prototyping | 4-bit low-bit quantized model | Concise output, fastest end-to-end |
4.2 Three Universal Takeaways
- Don’t judge by per-step inference speed alone. End-to-end time is determined jointly by output volume, interaction turns, and cache efficiency. Selection should be based on benchmarks with real tasks.
- Prompt caching is the core optimization point for agentic scenarios. When designing context structure, separate stable prefixes (system prompts, tool definitions) from dynamic content to maximize cache reuse.
- Quantization is a three-way trade-off among precision, speed, and cost. Low-bit quantization suits fast iteration with higher tolerance for quality variance; high-precision quantization suits quality-sensitive, long-chain tasks.
4.3 Boundaries of the Conclusions
It should be emphasized that the report’s conclusions are based on a single run and a specific technology stack (a functional programming language and a web framework), so sample size is limited. Model performance may differ noticeably across language ecosystems and task complexities. Before adopting any selection conclusion, readers are advised to build small-scale benchmarks against their own actual workloads and make data-driven decisions.
5. Conclusion
The greatest value of this benchmark is that it provides a “task design + automated scoring + multi-dimensional metrics” evaluation paradigm for local models. In an era of rapid model iteration, debating which model is better in the abstract is meaningless. Only by placing models into real engineering pipelines and measuring them with quantifiable metrics can teams choose the technical solution that truly fits their needs.
