Local LLM Benchmarking: Coding Tests of Three Flash Models
This article looks beyond token speed to evaluate local LLM coding performance across three quantized Flash-class models. It covers the benchmark design, machine scoring logic, and how quantization shapes model behavior, then offers a selection framework based on end-to-end time, total output tokens, interaction turns, checkpoint pass rate, and cache hit rate.
1. Why “Fast” Doesn’t Mean “Good”
When deploying large language models locally for coding tasks, many teams focus on just two metrics: time to first token and output tokens per second. But a real agentic coding task isn’t a single question-and-answer exchange. It’s a multi-turn process where the model repeatedly interacts with tools, the codebase, and test frameworks. What actually determines the end-to-end experience are three long-underestimated variables:
- Quantization scheme: It affects VRAM usage, inference throughput, and numerical stability at the same time.
- How talkative the model is: Total output tokens often determine overall time more than single-token speed does.
- Context reuse efficiency: The cache hit rate directly drives both compute cost and response cadence.
A developer ran a fully automated comparison on a local dual-accelerator-card platform, testing three lightweight (Flash-class) open-source models with different quantization schemes. The task was designed to be highly engineering-oriented: the model had to act as an agent calling 21 native tools, fix 17 code defects, and complete a full application build with 19 checkpoints. No large-model judge was involved at any point; scoring was done entirely by machine against predefined rules. This design is well worth borrowing—it removes “subjective impression” from the evaluation and leaves only reproducible facts.
2. Benchmark Design and Scoring Logic
For this kind of evaluation to be useful, the task set must cover three distinct types of capability:
- Tool orchestration: Can it pick the right tool at the right time, are the arguments valid, and can it self-recover from failures?
- Defect localization: Can it trace back from error stacks and logs to the real root cause, rather than making speculative rewrites?
- End-to-end delivery: Does the built application pass all checkpoints, including API contracts, boundary conditions, and basic security items?
The key to machine scoring is defining checkpoints upfront. In the application build task, for example, the 19 checks were broken into automatically verifiable assertions: whether the API response structure is stable, whether exception paths are handled, whether input validation is complete, and whether dependencies are correctly declared. The judgment logic can be abstracted as:
score = 0for check in checks: # 19 checkpointsif run(check) == PASS:score += 1score += tool_call_validity * w1 # tool call validity ratescore -= retry_penalty * w2 # invalid retry penalty
This assertion-driven scoring is more stable than having another model assign grades, and it’s easier to reuse within a team.
3. Differentiated Behavior Across Three Quantization Routes
All three models passed the tests, but their working styles differed dramatically—which shows that quantization isn’t just about compression ratio. It shapes how a model behaves.
1. Low-bit integer quantization: minimal output for the shortest time
The model using 4-bit-level integer quantization completed the application build in about 18.4 minutes, the fastest of the three. The reason wasn’t a faster underlying inference engine—in fact, its decoding speed was on the slower side—but that it produced only about 20,000 tokens in total. It tends to “think less, say less,” directly delivering the minimal runnable change.
This style suits prototype validation: you want a skeleton that runs, not a perfect design document. But note that extremely concise output often means missing explanatory content, so the team has to fill in context during review.
2. Low-precision floating-point quantization: planning first and a very high cache hit rate
The model using 8-bit floating-point quantization used only 77 interaction turns, the fewest of the three. Its typical behavior is to output a plan first, then execute step by step, giving it the best process readability. More importantly, its prompt cache hit rate reached about 98%, meaning most of the context didn’t need to be recomputed, pushing the per-task compute cost to the lowest level.
This kind of model is well suited to running autonomously in the background for long periods—for example, batch-fixing defects overnight or continuously inspecting code quality. The plan-first style also makes it easy for humans to step in at key points.
3. 4-bit floating-point quantization: deep reasoning for engineering quality
The model using low-bit floating-point quantization took the longest, about 27.6 minutes, because it performed extensive internal reasoning in every turn. The cost is time; the payoff is output: the cleanest code, the most test cases (18), and the best engineering quality of the three.
If the deliverable needs long-term maintenance or must go through a strict code review process, this time cost is usually acceptable.
4. Abstracting the Differences into a Selection Framework
Don’t memorize conclusions; remember the method. You can use the following decision order for local model selection:
if the goal is to validate an idea quickly:choose the minimal-output, low-bit integer quantization schemeelif the goal is unattended batch tasks:choose the plan-first scheme with a high cache hit rateelif the goal is production code with long-term maintenance:choose the deep-reasoning scheme with more complete test coverageelse:use "effective information per turn / cost per turn" as the unified comparison basis
A more rigorous approach is to fix the evaluation metrics at four: end-to-end time, total output tokens, interaction turns, and checkpoint pass rate, then add one cost proxy metric—cache hit rate. Together, these five cover the decision needs of most local coding scenarios.
5. Practical Advice and Common Pitfalls
- Pitfall 1: Only looking at decoding speed. Total output often determines overall time more than speed does.
- Pitfall 2: Ignoring the cache. A high cache hit rate not only saves money but also significantly shortens tail latency on long tasks.
- Pitfall 3: Treating machine scoring as the only standard. Automated assertions are good at judging “correct or not” but not “easy to maintain or not,” so it’s advisable to keep a manual spot-check step.
- Practical advice: When running localized evaluations on platforms such as Baidu AI Cloud, you can combine general capabilities like container platforms, object storage, log services, and monitoring alerts to orchestrate evaluation tasks into a repeatable pipeline, so that every model or quantization change has comparable historical data.
A truly mature local coding agent evaluation isn’t about picking the “strongest model,” but about building a reproducible, comparable, and continuously evolving evaluation pipeline.
