Benchmarking Mainstream LLMs for Coding: Multi-Model Collaboration and Cost Optimization

    This article explores a hands-on benchmark of mainstream large language models (LLMs) in a real-world software engineering project. By breaking down a feature request into multiple prioritized steps and assigning them to different LLMs, we analyze three typical model behavior profiles: the diligent and stable, the inconsistent performer, and the slow but high-quality. Based on these observations, we propose a multi-model workflow strategy for cost optimization, including task scheduling by time-of-use pricing and token consumption management, to help developers balance stability, speed, and cost.

    1. Background: Why We Need Multi-Model Benchmarking

    With the rapid advancement of LLM coding capabilities, developers are no longer asking “Can it be used?” but rather “Which one to use, how to use it, and how to save money?” The capability gap among various models for routine engineering tasks is narrowing. Instead of relying on an “irreplaceable” model, the focus has shifted to finding the optimal combination of stability, speed, and cost.

    To draw conclusions close to real-world scenarios, this article benchmarks a single engineering project. A feature requirement was decomposed into eight prioritized steps (P0 to P7), each handled by different mainstream LLMs using their official AI coding tools (CLI tools or desktop agents). We recorded the output quality, time consumed, and token usage. As pragmatic users, our evaluation principle is straightforward: we use whichever model is practical, affordable, and offers the best price-to-performance ratio.

    2. Three Typical Model Behavior Profiles Observed

    The Diligent and Stable: High Quality, High Hidden Costs

    The first type of model behaves “diligently.” It proactively calls various tools during task execution—checking file structures, retrieving context, and verifying configurations. As a result, its code output rarely contains basic errors and meets expectations reliably.

    However, diligence comes at a cost: every proactive tool call and context read generates additional token consumption. In our tests, a minor feature iteration step (e.g., creating a database table structure and completing ORM configuration) consumed about 20% of a subscription quota. A simple requirement could consume up to tens of millions of tokens. This highlights a crucial conclusion: A model’s reliability is often built on massive token consumption. If your quota is limited, this type of model is better suited for critical steps rather than handling all tasks.

    The Inconsistent Performer: High Ceiling, Low Floor

    The second type of model performed highly inconsistently. On a good day, it delivered impressive implementations; on a bad day, it might submit a mere rough draft. During the tests, two steps incurred certain costs and required rework, making the overall expense not low at all.

    For this type of model, the current coping strategies include:

    • Break down tasks into finer pieces: Decompose requirements to a smaller granularity to lower the acceptance cost of each output.
    • Define clear acceptance criteria: Explicitly state testing requirements and the Definition of Done (DoD) in the prompt to minimize the chances of subpar output.
    • Rapid acceptance testing: Run and review each output immediately. Request rework as soon as issues are found to prevent error accumulation.

    The Slow but High-Quality: Highest Quality Ceiling, Lowest Throughput

    The third type of model delivered the highest quality output in this benchmark but was also the slowest. A single task often required a long wait to complete. Interestingly, in terms of quota durability, it outlasted some cheaper subscription plans, which could partly be attributed to its slow speed and fewer invocations.

    This type of model is ideal for non-blocking scenarios: you delegate a task to it, work on other things, and return later to review the results. Urgent tasks on the critical path are better suited for faster models.

    Universal Lesson: Proactive Verification is Crucial

    The benchmark also exposed a common issue across all models: unless explicitly instructed, many models do not proactively run tests to verify if the feature actually meets the design objectives, and may even introduce basic errors. Therefore, regardless of the model used, you should explicitly require the execution of tests and self-checking against acceptance criteria in the prompt. This is a key step in ensuring output quality.

    3. Cost Optimization Strategies for Multi-Model Workflows

    Since different platforms offer varying billing models and promotional strategies (subscription plans, pay-as-you-go, off-peak discounts, etc.), you can build a “time-pricing-compute multi-dimensional arbitrage” workflow. The core principles are:

    • Maximize subscription benefits: Prioritize scheduling tasks within the periods and quotas where subscription benefits are most abundant.
    • Choose the best price-to-performance ratio when paying out-of-pocket: When paying as you go, select model tiers with low prices and high cache hit rates (which can significantly reduce costs).
    • Segment tasks by time period:
      • Off-peak periods (platforms often provide discount rates, e.g., 50% off from late night to noon): Schedule high-consumption tasks to subscription-based models to effectively double your quota.
      • Peak periods (usually during afternoon compute peaks): Avoid full-charge subscription deductions and instead use low-cost, pay-as-you-go models with high cache hit rates for routine minor tasks.

    A conceptual scheduling logic can be abstracted as follows:

    1. def pick_model(task, now):
    2. if is_off_peak(now) and has_quota():
    3. return "Subscription Model" # Discount period, effectively doubling quota
    4. if is_peak(now) or not has_quota():
    5. return "Low-cost Pay-As-You-Go Model" # High cache hit, low unit cost
    6. return default_model(task)

    4. Summary and Recommendations

    Based on this benchmark, we offer the following recommendations:

    1. Do not bet on a single model: Capabilities across different vendors have converged significantly; a multi-model combination is the optimal solution today.
    2. Allocate models based on task characteristics: Assign critical and complex steps to models with a high-quality ceiling, and simple, repetitive tasks to cheap, fast models.
    3. Control hidden costs: Be wary of the token consumption of “diligent” models; schedule high-consumption tasks during discount periods whenever possible.
    4. Explicitly state acceptance criteria in prompts: Require models to proactively run tests and self-check against standards to significantly reduce basic errors and rework.
    5. Maintain your own cost ledger: Record the token consumption and expenses for each type of task to continuously optimize your allocation strategy.

    Ultimately, the competition among LLM coding tools benefits developers: no one is irreplaceable. Use whoever is effective and affordable.