Local Dual-GPU Benchmark: Comparing the Coding Ability of Three Quantized Models
This article presents a local dual-GPU benchmark comparing three quantized model configurations as coding agents. It explains the evaluation setup—layered tasks, real tool calls, script-based scoring, and fully quantified metrics—and shows how each configuration trades output length, interaction turns, and reasoning depth differently. Readers will find a transferable selection framework, practical guidance for quantization deployment, and the boundaries of the findings.
1. Why Quantization and Coding Agent Performance Belong Together
When deploying large models locally, VRAM capacity and memory bandwidth often become bottlenecks before compute does. Quantization is the most common way to ease this tension: by lowering the bit width of weights and some activations, it compresses models that would not otherwise fit into a runnable range. But quantization is not lossless. It changes three things at once—the compute cost of a single forward pass, the distribution of output tokens (especially verbosity), and the model’s stability across multi-turn tool calls.
So evaluating a local coding agent cannot be reduced to “how many tokens per second it generates.” The end-to-end experience is really the product of four variables:
Total time ≈ interaction turns × average latency per turnLatency per turn ≈ prefill (long context) + decode (output tokens) × time per tokenTotal cost ≈ uncached input tokens × unit price + output tokens × unit price
Any conclusion that optimizes only one of these is likely one-sided. The benchmark below is built around all four.
2. Benchmark Design: Replacing “Subjective Feel” with Machine-Verifiable Judgments
A credible agentic coding evaluation has to be reproducible across four dimensions:
- Layered task set. Tasks fall into two groups: 17 smaller bug-fix cases that test localization and minimal-change ability, and one end-to-end build task that requires a complete web app with 19 checkpoints, testing planning, layering, and self-verification.
- Realistic tool calls. The model must act as an agent and call 21 native tools (reading and writing files, running commands, executing tests, looking up dependencies, and so on) rather than just emitting code snippets. This exposes differences in when a model chooses to verify and when it chooses to roll back.
- De-subjectivized scoring. A script judges every checkpoint automatically, with no LLM-as-judge, so the evaluator model’s own preferences cannot contaminate the results.
- Fully quantified metrics. Wall-clock time, interaction turns, input/output token counts, cache hit rate, number of test cases, and code quality are all recorded into a table that can be compared horizontally.
3. Three “Working Personalities” Under Three Quantization Routes
All three models passed every checkpoint, but their paths differed sharply and fall into three typical modes.
3.1 Concise Output: Trading “Write Less” for “Finish Faster”
This configuration’s inference engine was not the fastest per token, but its output was extremely restrained—only about 20,000 tokens in total—and it finished building the app in 18.4 minutes, the fastest of the three. It highlights a frequently overlooked fact: decode time is roughly linear in output length, so compressing output beats switching to a faster engine. The trade-off is thinner readability notes and test coverage, making it suitable for prototype validation.
3.2 Plan First: Trading “Fewer Turns” for “Lower Cost”
This configuration used the fewest interaction turns (77), tended to present a plan before executing step by step, and kept the process transparent with few rollbacks. More importantly, its prompt cache hit rate reached about 98%—when long context is passed repeatedly, cache hits sharply cut prefill cost and bring compute cost to the lowest level. It is well suited to unattended, long-running background tasks.
Cache hit rate ↑ → prefill cost of repeated context ↓ → latency per turn ↓ → total cost ↓
3.3 Deep Reasoning: Trading “More Thinking” for “Higher Quality”
This configuration performed extensive internal reasoning every turn and took the longest (27.6 minutes), but produced the cleanest code and the most test cases (18), with the best engineering quality. The extra reasoning budget was converted into edge-case handling and self-verification, which lowered the rework rate.
4. Abstracting the Findings into a Transferable Selection Framework
Don’t memorize conclusions; memorize the criteria. The decision logic below can replace a one-off benchmark result:
def choose_mode(task, budget, unattended):if unattended or budget == "cost_first":return "plan_first" # high cache hit + few turns, lowest costif task == "prototype":return "concise" # shortest output, fastest prototypeif task in ("refactor", "library", "release"):return "deep_reasoning" # quality and test coverage firstreturn "balanced"
The corresponding engineering recommendations:
- Daily iteration: prefer plan-first, paired with a high cache hit rate, balancing efficiency and cost;
- Quality- and coverage-sensitive delivery: choose deep reasoning and spend the budget on thinking rather than rework;
- Time-boxed idea validation: choose concise output, get it running first and fill in tests later.
5. Four Practical Points for Quantization in Production
- Measure VRAM and bandwidth before bit width. A lower bit width is not automatically more cost-effective; if throughput is bandwidth-bound, the low-bit advantage is offset by long outputs.
- Design prompts to be cache-friendly. Put stable system instructions and project conventions in the prefix and variable content later to raise prefix reuse.
- Replace human review with checkpoints. Turning “is the code good?” into executable assertions is what makes different configurations horizontally comparable.
- Control variables per experiment. Change either the quantization scheme or the task set, not both, or the results cannot be attributed.
When reproducing this kind of experiment in the cloud, you can use a container platform to spin up isolated environments, object storage to hold datasets and artifacts, and logging and monitoring/alerting services to collect latency and token metrics. Baidu AI Cloud’s general-purpose capabilities can serve as one infrastructure option for hosting such an evaluation pipeline.
6. Conclusion and Boundaries
None of the three quantization routes is absolutely better; the differences are essentially different ways of allocating three resources—output length, interaction turns, and reasoning depth. The data here comes from a single run on a specific tech stack, so the findings should be treated as hypotheses rather than conclusions. It is advisable to build on the metric framework in this article, run repeated experiments across multiple rounds and tech stacks, and only then lock in a selection strategy.
