How to Evaluate the Coding Ability of Local LLMs: A Reproducible Methodology and Practice

    This article presents a reproducible methodology for evaluating the coding ability of locally hosted open-weight models. It explains why single benchmark scores or LLM-as-a-judge setups are unreliable, then outlines four requirements for an engineering-grade evaluation: real development tasks, machine-checkable scoring, controlled variables, and multi-dimensional process metrics. Through a hands-on test on a dual-GPU local inference platform, it shows how 4-bit weight, 8-bit floating-point, and 4-bit floating-point (NVFP4-class) quantization change agent behavior, end-to-end latency, cache hit rate, and code quality. It also provides a scripted scoring skeleton, a three-layer metric system, and scenario-based model selection advice.

    1. Why local coding evaluation needs a reproducible method

    Over the past two years, the coding ability of open-weight models has improved quickly, but comparisons shared in the community often contradict each other. The reason is not complicated: most evaluations either rely on a single benchmark score, bring in a large model as a judge, or draw conclusions from a single run. When model capabilities are close, these approaches can barely tell them apart, because noise drowns out the real differences.

    An evaluation with genuine engineering value should meet at least four conditions:

    1. Tasks that reflect the real development workflow: Instead of answering isolated multiple-choice questions, the model acts as an agent that reads code, modifies code, and runs tests in a real repository.
    2. Objective, machine-checkable scoring: Use test pass rates, static analysis results, and whether build artifacts are usable as criteria, avoiding subjective preference.
    3. Controlled variables: Keep the hardware platform, context length, temperature parameters, tool set, and maximum number of turns exactly the same, so that only the model and quantization scheme are variables.
    4. Multi-dimensional process metrics: Record not only whether the final result passes, but also elapsed time, number of interaction turns, output token count, and cache hit rate. These are the basis for cost estimation.

    A typical high-intensity test is designed as follows: on a dual-GPU local inference platform with high memory bandwidth, three open-weight models using different quantization schemes each complete two types of tasks. First, they fix several defects in real projects. Second, they build a complete application from scratch that includes nearly twenty acceptance checks. During the process, the models need to call more than twenty native tools as agents (reading and writing files, executing commands, running tests, retrieving dependencies, and so on). Scoring is fully automated by machine, with no model judge involved.

    2. How quantization affects agent behavior patterns

    An easily overlooked fact is that quantization affects not only VRAM usage and throughput, but also the model’s behavioral style. At the same capability level, different numeric formats combined with different inference engines produce systematic differences in “depth of thinking” and “output length.”

    2.1 Low-bit weight quantization: minimal output in exchange for end-to-end speed

    The model using 4-bit weight quantization had the shortest total time in this test, completing the build task in about eighteen minutes with only about twenty thousand output tokens in total. Its inference engine was not faster per step, but it won by being “quiet”: it gave almost no lengthy explanations and produced only the necessary changes in each turn.

    This brings an important engineering insight: end-to-end latency ≈ per-token latency × number of output tokens + tool execution and scheduling overhead. When the output volume is compressed to an extremely low level, the whole process is still the fastest even if the underlying engine is a bit slower. This type of model is well suited to scenarios where you want to see a runnable prototype first.

    2.2 Medium-low-bit floating-point quantization: plan first, cache friendly

    The model using 8-bit floating-point representation had the fewest interaction turns (about seventy-seven) and a style of making a plan first and then executing it step by step, with the best process readability. More importantly, its prompt cache hit rate was over ninety percent, which means the repeatedly passed repository context produced almost no repeated computation, giving it the lowest computation cost per task.

    For automated pipelines that need to run unattended for a long time, cache friendliness is often more important than peak throughput, because it directly determines the marginal cost of long tasks.

    2.3 Low-bit floating-point (NVFP4-class) quantization: deep reasoning in exchange for engineering quality

    The model using a 4-bit floating-point format performed a large amount of internal reasoning in every turn, so it took the longest time (about twenty-seven minutes), but the code it produced was the most standardized, it wrote the largest number of test cases (eighteen), and it had the best quality in static checks and acceptance items.

    This shows that “slow” does not equal inefficient: when the task goal is maintainability and regression safety, the test coverage gained from upfront thinking can often significantly reduce the cost of later rework.

    3. A reusable metric system and scoring script skeleton

    To make the conclusions reproducible, it is recommended to script the scoring completely. Below is an illustrative scoring framework (pseudocode):

    1. def evaluate(run_dir, checks):
    2. results = {"build": False, "lint": 0, "tests_passed": 0, "tools": 0}
    3. results["build"] = run_command(["build"], cwd=run_dir).returncode == 0
    4. results["lint"] = count_zero_severity(run_command(["lint"], cwd=run_dir))
    5. for case in checks:
    6. if run_command(["test", case.name], cwd=run_dir).returncode == 0:
    7. results["tests_passed"] += 1
    8. results["tools"] = parse_tool_calls(run_dir / "trace.jsonl")
    9. return results

    The metrics can be divided into three layers:

    • Result layer: whether the build succeeds, the number of acceptance checks passed, the test pass rate, and the number of static check items with zero warnings.
    • Process layer: total elapsed time, number of interaction turns, input/output token count, cache hit rate, and tool call success rate.
    • Quality layer: number of new tests, code duplication, and whether the change scope is focused (whether only necessary files are modified).

    Only by putting the three layers of metrics in the same table can you explain “why it is fast” and “why it is good,” instead of giving a single score that cannot be traced.

    4. Scenario-based selection recommendations

    • Daily iteration and defect fixing: Prioritize the cache-friendly, clearly planned 8-bit floating-point scheme. It offers the most balanced efficiency and cost and is suitable for integration into continuous integration for background autonomous fixes.
    • Quality first and core module refactoring: Choose the deep-reasoning 4-bit floating-point scheme, trading longer thinking for standardized implementation and high test coverage.
    • Prototype validation and demos: Choose the extremely low-output 4-bit scheme to get a runnable version as quickly as possible, then gradually replace key implementations.

    For cloud deployment, you can combine model services, a containerized runtime environment, object storage (for storing build artifacts and trace logs), logging services, and monitoring alerts into a closed-loop pipeline: each evaluation automatically archives traces, metrics, and artifacts for regression comparison.

    5. Boundaries of the conclusions and follow-up experiment design

    It must be emphasized that the confidence of these conclusions is limited by a single run and a specific technology stack. A more rigorous approach is to repeat each model at least three to five times and report the median and variance; extend to multiple languages and frameworks; record cache performance under different context lengths; and conduct sensitivity analysis on parameters such as temperature and maximum turns. When the evaluation itself is sufficiently restrained and the metrics are transparent enough, model selection is no longer “listening to hearsay” but a verifiable engineering decision.