Quantization for Local Coding Agents: How 4-bit, NVFP4, and FP8 Shape Performance
This article presents a local dual-accelerator benchmark of three open-source coding agents using 4-bit, NVFP4, and FP8 quantization. Across 21 native tools, 17 real bug-fix tasks, and a 19-check web-app build scored automatically, all models passed but showed distinct work styles: a concise 4-bit model was fastest end to end, an FP8 model planned ahead with a 98% prompt-cache hit rate, and an NVFP4 model spent more time on internal reasoning and produced the most test cases. The article analyzes these trade-offs and offers a practical selection framework for speed, cost, and code quality, along with caveats.
As open-source large models improve rapidly, more developers are deploying models locally as coding agents to assist daily development. One often overlooked fact is that models of the same scale can behave very differently on real coding tasks when different quantization schemes are used. Not only do speed and cost change; even the model’s “work style” can shift. This article is based on an independent test completed in a local dual-accelerator environment. It systematically analyzes how quantization schemes affect agentic coding capability and provides actionable selection advice.
Why Quantization Matters
Local deployment of large models cannot avoid quantization. Quantization compresses model weights from high-precision floating-point numbers into lower-bit representations to reduce VRAM usage and increase inference speed. Common schemes include:
- 4-bit-level quantization (such as EXL3 4-bit and NVFP4): high compression and low VRAM usage, but potentially some loss of precision.
- 8-bit floating-point quantization (such as FP8): better precision retention and roughly twice the VRAM usage of 4-bit schemes, but highly efficient inference when supported by the hardware.
Quantization is not merely a trade-off between space and precision. Testing shows that quantization schemes also interact with a model’s own reasoning characteristics, ultimately shaping very different agent behavior patterns. Some models become extremely concise, some tend toward deep thinking, and some are good at planning and cache reuse.
Test Design: How to Objectively Evaluate a Coding Agent
This evaluation used a relatively strict automated design to exclude subjective factors as much as possible:
- Hardware environment: a local dual-accelerator workstation, simulating a typical high-performance local development scenario.
- Test subjects: three open-source models using different quantization schemes: 4-bit quantized Model A, NVFP4 quantized Model B, and FP8 quantized Model C.
- Task design:
- Act as an agent and call 21 native tools, including file read/write, command execution, and search.
- Complete 17 real bug-fix tasks based on a codebase in a functional programming language.
- Build a complete web application from scratch with 19 acceptance checks.
- Scoring method: all scoring was performed automatically by machines against predefined checks, without an LLM judge, to avoid scoring bias.
The point of this design is that it examines not whether the model can write code, but its overall performance in core agent capabilities such as multi-turn tool calls, long-task decomposition, and context management.
Results: Three Distinct Working Modes
All three models passed the full test, but their processes differed significantly and deserve a detailed breakdown.
1. 4-bit Model A: the extremely concise speed-focused approach
Model A completed the application build in only 18.4 minutes, the fastest overall. Interestingly, its underlying inference engine was not actually advantaged in per-token speed. The key to winning was extremely low output volume: it generated only about 20,000 tokens in total. It made almost no redundant explanations and directly produced the minimum viable changes, trading “less talking” for first place in overall speed.
This reveals an often ignored rule: in agent tasks, total time ≈ output tokens × per-token generation time. A concise model may win on end-to-end time even if its inference speed is average. For quickly validating ideas and generating prototypes, this type of model is an ideal choice.
2. FP8 Model C: the planning-first efficiency approach
Model C had the fewest interaction rounds, only 77. Its behavior was characterized by “making a complete plan first, then executing step by step,” with a clear and traceable process. More importantly, its prompt cache hit rate reached 98%. Because every round followed a unified plan, the prefix context was highly stable, a large amount of computation was reused from cache, and actual compute cost was reduced to the minimum.
A high cache hit rate can affect cost by orders of magnitude. This type of model is particularly suitable for long tasks that run autonomously in the background: unattended scenarios that require stable execution and process explainability, such as nightly batch fixes and automated repair pipelines in continuous integration.
3. NVFP4 Model B: the deep-thinking quality-focused approach
Model B performed extensive internal reasoning in every interaction round, similar to a “think first, answer later” mode, so it took the longest at 27.6 minutes. But the cost bought real engineering quality: the code was the most standardized, and it produced the most test cases, 18, meaning higher test coverage and better maintainability.
For production code that needs long-term maintenance, the value of test coverage often far exceeds a few minutes of waiting. This type of model is suitable for core module development and team engineering scenarios with strict code quality requirements.
Selection Decision Framework
Abstracting the results into a general decision framework, selection can be based on three dimensions:
| Priority | Recommended direction | Reason |
|---|---|---|
| Balance efficiency and cost | FP8-class approach | Clear planning and high cache hit rate; best overall |
| Code quality and test coverage | NVFP4-class approach with deep reasoning | Standardized output and sufficient test cases |
| Fastest prototype output | High-compression 4-bit approach | Minimal output and fastest end to end |
In practice, the following principles can be followed:
- Clarify the nature of the task: one-off prototypes, daily development, and production-grade code correspond to different optimal choices; there is no need to pursue a single model that handles everything.
- Focus on output behavior rather than paper speed: in agent scenarios, output token count, interaction rounds, and cache hit rate often determine actual experience more than the raw throughput of the inference engine.
- Evaluate hardware compatibility: different quantization formats have different levels of hardware support. Before deployment, confirm the local accelerator’s acceleration capability for the target format.
- Keep human review: even if all tests pass, model-generated code should still go through code review, especially for security-sensitive modules.
Caveats
It should be noted objectively that the conclusions above are based on a single run, a specific technology stack, and a specific task set, and have the following limitations:
- A single run cannot reflect randomness; multiple runs averaged would be more reliable.
- The task set is biased toward one programming language and web scenarios; conclusions may change with a different technology stack.
- The hardware environment was fixed; the optimal quantization scheme may differ under different VRAM configurations.
Therefore, developers are advised to treat these results as a reference starting point, conduct small-scale controlled experiments based on their own task characteristics, and use data to drive selection.
Conclusion
Local deployment of coding agents has entered a practical stage, and the choice of quantization scheme is becoming one of the key variables affecting the experience. Only by understanding that “quantization is not just compression; it also shapes model behavior” can developers make trade-offs among speed, cost, and quality that truly meet their own needs.
