Local Quantized LLMs for Coding Agents: Comparing 4-Bit Integer, FP8, and FP4
How do quantized local LLMs perform as coding agents? This article examines a single-run evaluation covering 17 Elixir bug fixes and a web application with 19 feature checkpoints. It compares completion time, tool-use patterns, caching, and engineering quality across three model configurations, then outlines a practical framework for choosing and evaluating local coding agents.
1. Why Run Coding Agents on Local Hardware?
As open-source models become more capable, more developers are moving code generation and bug-fixing tasks from cloud APIs to local hardware. Three considerations typically drive this shift:
- Data privacy and compliance: Keeping internal code within the organization’s environment reduces the risk of exposing sensitive information.
- Cost control: After the initial hardware investment, marginal inference costs can be substantially lower than those of token-billed cloud services.
- Low latency and offline availability: Agents make frequent, repeated model calls. Local deployment reduces network round-trip overhead and can support offline workflows.
However, local deployment introduces a central decision: which quantization configuration to use.
Compressing model weights from FP16 or BF16 to lower-bit representations makes models fit within limited GPU memory or unified memory. It can also affect inference speed, output quality, and context handling. No quantization format is universally best; its value depends on the workload and deployment constraints.
2. Evaluation Design: Testing a Coding Agent Objectively
A useful model evaluation depends on a rigorous test design. The evaluation described here has several features worth adopting.
Two Complementary Task Categories
The test covered both targeted maintenance and open-ended development:
- Targeted bug fixes: Seventeen real Elixir bugs tested the models’ ability to understand existing code, locate defects, and make minimal corrective changes.
- An application built from scratch: A complete web application with 19 feature checkpoints tested planning, coordination across multiple files, and end-to-end delivery.
Together, these tasks assess more than isolated code generation. They examine whether an agent can navigate a codebase and complete a development workflow.
Native Tool Calling
The models operated as agents with access to 21 native tools, including file reading and writing, code search, command execution, and test execution.
This setup is closer to real software development than code completion alone. Each model had to decide when to inspect files, run tests, and modify code.
Automated Scoring Without an LLM Judge
The evaluation used programmatically verifiable criteria rather than another LLM’s judgment:
- Did the fix pass the relevant tests?
- Were the required application checkpoints completed?
- Did the test cases pass?
LLM-based judging can introduce preference bias and inconsistent scoring. Automated checks make outcomes easier to reproduce and compare, although they remain bounded by what the checks actually measure.
3. How the Three Quantized Configurations Behaved
All three tested models passed the full evaluation. Their working patterns, however, differed substantially.
These results illustrate trade-offs among quantization, model characteristics, and agent behavior. They should not be read as proof that a quantization format alone determines a model’s planning style or code quality.
4-Bit Integer Quantization: Speed Through Concise Output
The model using 4-bit integer quantization, such as an EXL3-style configuration, completed the application build fastest: approximately 18 minutes.
Its advantage was not the highest underlying token-generation speed. Instead, it generated the fewest tokens—approximately 20,000 across the task.
This highlights an often-overlooked distinction: token throughput is not the same as task completion speed. For the generation portion of a workload:
Generation time ≈ total output tokens ÷ tokens generated per second
End-to-end completion time also includes the rest of the agent workflow. Nevertheless, output length can strongly influence the result. A concise model may finish sooner even if its per-token generation speed is unremarkable.
Teams that focus only on throughput can miss the effect of output verbosity and prompt design on total runtime.
Best-fit use cases: Rapid prototyping, exploratory development, and workflows that prioritize fast iteration.
FP8: Planning-First Execution and Effective Caching
FP8 can preserve quality close to that of the original model with relatively little precision loss. In this evaluation, the FP8 configuration stood out in two ways.
- Fewest interaction rounds: 77. The model tended to establish a complete plan before executing it step by step, reducing unnecessary back-and-forth. This planning-first approach also made the workflow easier to trace and audit.
- A reported prompt-cache hit rate of 98%. Agent conversations repeatedly include long histories. When the inference service supports prefix caching through KV-cache reuse, it can avoid recomputing unchanged portions of the context.
A planning-oriented workflow can work well with prefix caching because system instructions and earlier context remain stable across many interactions. The observed cache hit rate, however, belongs to this particular configuration and run—not to FP8 as a format in isolation.
Best-fit use cases: Long-running autonomous background tasks and automated coding work in CI/CD pipelines.
FP4: More Reasoning Time, Stronger Engineering Results
At a fixed memory budget, FP4 can accommodate models with more parameters than higher-precision representations.
The tested FP4 configuration generated substantial internal reasoning during each interaction. In this run, that behavior coincided with two outcomes:
- Longest completion time: approximately 27.6 minutes. More reasoning consumed additional computation time.
- Strongest reported engineering quality. The output had the most structured code, the largest number of tests—18—and the strongest overall engineering-quality indicators in the evaluation.
The result illustrates a possible trade-off between time spent reasoning and the quality of the delivered implementation. It does not establish that FP4 inherently produces better code.
Best-fit use cases: Production-oriented development where maintainability, code structure, and testing matter more than the shortest possible runtime.
4. A Practical Selection Framework
The observed results suggest the following starting point for selecting a configuration:
| Priority | Configuration to Consider | Typical Workloads |
|---|---|---|
| Speed first | 4-bit integer quantization | Prototyping and rapid validation |
| Balanced efficiency | FP8 | Everyday development and background automation |
| Quality first | FP4 | Production code and testing-intensive tasks |
This table summarizes the tested configurations, not a universal ranking of quantization formats. A practical decision should also account for three factors.
Memory Budget
Lower bit widths reduce weight memory requirements for the same parameter count, but can increase the risk of quality loss. The available GPU or unified memory determines which model-and-precision combinations are feasible.
Inference-Engine Caching
In multi-turn agent workflows, prefix caching can substantially affect actual inference costs and runtime. Evaluate the serving engine’s cache behavior alongside the model.
Task Fit
Targeted repairs may benefit from concise, efficient execution. Building an application from scratch may benefit more from planning and extended reasoning.
The relevant question is therefore not simply “Which quantization format is best?” but “Which configuration works best for this task under these resource constraints?”
5. Important Limits of a Single-Run Evaluation
The reported findings come from a single run on a specific technology stack: Elixir and a web application.
Model behavior can vary between runs. Programming language, task complexity, and prompt design may all change the outcome. The fact that all three models passed also means that completion success alone does not distinguish their operational trade-offs.
For a serious deployment decision:
- Run each configuration multiple times and compare aggregate results.
- Use a benchmark task set that reflects your own codebase and business requirements.
- Track completion time, token consumption, code quality, and test pass rates together.
These measurements help separate repeatable advantages from one-off outcomes.
6. Conclusion
The most useful takeaway is not a claim that one quantized model is universally superior. It is an evaluation method built around real tasks, native tool calling, automated scoring, and multiple performance metrics.
For teams deploying coding agents locally, public rankings are only a starting point. A workload-specific evaluation pipeline provides a better basis for choosing among configurations.
Match the quantization approach, task type, and agent working style to your own constraints—and judge the result by completed work, not token throughput alone.
