Testing a New-Generation Multimodal Model: Building a Stable Coding Agent at Low Cost

    This article evaluates a new-generation multimodal model for real software development work, including code understanding, defect localization, and code modification. It explains how to estimate API costs, reduce wasted tokens through context filtering and caching, and design a coding agent with tool permissions, output checks, and security controls.

    1. Why Re-evaluate Model APIs

    Over the past period, many teams have tried connecting large language models to code generation, test writing, log analysis, and project maintenance. In production, model capability is only one part of the picture. Whether the system runs reliably over time also depends on cost, context management, output reliability, call latency, and exception handling.

    For individual developers, two questions usually matter most.

    First, can the model understand a real project, rather than only complete isolated code snippets?

    Second, are the call costs manageable enough to support continuous iteration, instead of becoming too expensive after a few demos?

    These are the main reasons I re-evaluated the new-generation multimodal model. Rather than focusing on parameter scale, it is more useful to look at how the model performs in actual development workflows. The key questions are whether it can read multiple files, understand dependencies between modules, locate problems from error logs, modify code while following existing conventions, and maintain a reasonable cost structure under frequent calls.

    2. Cost First: Low Prices Do Not Mean Production-Ready

    Consider a public pricing example for a new-generation high-speed model. The input price may be 0.4 yuan per million tokens, the output price 1.4 yuan per million tokens, and the cache read price as low as 0.115 yuan per million tokens. Prices can change with promotion periods, billing rules, model versions, and account settings, so the service console’s published information should be used before any real integration.

    For a simple estimate, consider a code repository analysis task that requires:

    • Input context: 500,000 tokens
    • Output: 20,000 tokens
    • No other additional fees

    At 0.4 yuan per million input tokens and 1.4 yuan per million output tokens:

    Input cost:

    0.5 × 0.4 = 0.2 yuan

    Output cost:

    0.02 × 1.4 = 0.028 yuan

    Total cost for one task:

    0.228 yuan

    At the original prices of 0.8 yuan per million input tokens and 2.8 yuan per million output tokens, the cost for one task would be:

    0.5 × 0.8 + 0.02 × 2.8 = 0.456 yuan

    The discounted cost is about half the original price. For occasional calls, the savings may be small. However, if a team runs hundreds of code analysis, test generation, or documentation tasks each day, the difference grows quickly.

    Unit price alone is not enough. Actual cost also depends on the following factors.

    1. Waste from irrelevant context

    If every request sends the entire code repository, the model may incur large amounts of repeated input, even when it supports long context. A better approach is to build a file index and send only the code, interfaces, configuration, and error information relevant to the current task.

    2. Extra cost from long outputs

    The more content a model generates, the higher the cost usually is. For code modification tasks, ask the model to first provide a modification plan, then output only the necessary patches or key file contents. This avoids reprinting unchanged code.

    3. Cost amplification from retries

    Network timeouts, format errors, and tool execution failures can all trigger retries. Without a limit on maximum retries, a single failing task can keep consuming quota in the background. Set timeouts, retry limits, and a budget for each task.

    3. Practical Experience: Evaluate the Model Within a Complete Workflow

    Asking a model a few isolated questions makes it hard to judge whether it suits development work. A more useful test is a set of tasks that resemble a real production environment.

    The first category is code comprehension.

    Provide the project directory structure, core modules, configuration files, and part of the call chain, then ask the model to explain:

    • What the current module is responsible for
    • Where key data enters the system and what processing it goes through
    • Which areas show obvious coupling
    • Which files may be affected if a certain interface is changed

    This category mainly tests long-context understanding. Strong performance means more than restating the code. The model should establish relationships between modules and distinguish confirmed facts, reasonable inferences, and information that cannot be verified.

    The second category is defect localization.

    Provide error logs, exception stack traces, related code, and reproduction conditions together, then ask the model to give:

    • Likely root causes
    • Investigation priorities
    • A minimal fix
    • A way to verify whether the fix works

    In this step, it is critical whether the model “confidently fabricates a cause.” In practice, require it to label the source of its evidence and prioritize testable hypotheses rather than drawing direct conclusions.

    The third category is code modification.

    A safer process is not to have the model rewrite an entire file directly, but to follow these steps:

    1. Analyze the requirements and the existing implementation.
    2. List the files to be changed.
    3. Explain the purpose of each change.
    4. Output a structured patch.
    5. Run tests or static checks.
    6. Make a second round of corrections based on the results.

    This “plan, modify, verify” pattern is usually more reliable than single-pass generation, and it is easier to review.

    A practical coding agent can be divided into five parts.

    Part one: the task entry point.

    Users can submit requirements through a web interface, a command-line interface, or internal systems. The entry layer should record the task description, project version, operator, and time, which supports later auditing.

    Part two: the context builder.

    This component selects the content related to a task from the codebase, including:

    • Directory structure
    • Symbol definitions
    • Interface descriptions
    • Configuration items
    • Test files
    • Recent error logs
    • Relevant commit history

    The context builder should not simply send all files. It should use keyword matching, dependency analysis, and file priority ranking to remove as much irrelevant content as possible.

    Part three: the model call layer.

    This layer handles request formatting, timeouts, rate limiting, retries, token tracking, and error logging in one place. Business code should not call the model directly. Instead, use an internal adapter layer to isolate differences in the underlying models. This way, switching models later does not require extensive changes to business logic.

    Part four: the tool execution layer.

    The model can request actions such as running tests, viewing files, or executing static checks, but every tool must pass through an allowlist. Operations that delete files, change permissions, access external networks, or read sensitive configuration should be blocked by default or require manual confirmation.

    Part five: the result evaluation layer.

    After the model produces output, the system should automatically check:

    • Whether the output matches the required format
    • Whether only files within the allowed scope were changed
    • Whether there are obvious syntax errors
    • Whether the tests pass
    • Whether sensitive information has been introduced
    • Whether any changes go beyond the task scope

    Only results that pass these checks should be submitted to developers for review.

    5. Caching Is Key to Lowering Costs

    In code assistance scenarios, basic project information is often reused. For example, directory structure, shared interfaces, coding standards, and core data models may appear in many tasks.

    Sending this information every time creates a large amount of repeated input. A better approach is to divide stable content into two types:

    • Long-term context: project standards, shared interfaces, and architecture documentation
    • Temporary context: the current requirement, error logs, changed files, and test results

    Long-term context is suitable for caching, while temporary context should be generated dynamically for each task. This reduces input costs and limits how much irrelevant information the model has to process.

    Caching also needs an invalidation mechanism. When code versions, interface definitions, or configuration change, outdated cache entries can mislead the model. Use version numbers, file digests, or update timestamps as cache keys, and rebuild the cache only when related content changes.

    6. Stability Matters More Than the Quality of a Single Answer

    A model that gives one excellent answer is not necessarily suitable for production. What matters is stability across consecutive tasks.

    Evaluate the following metrics:

    • Task success rate
    • First-output usability rate
    • Average response time
    • Retry rate
    • Test pass rate after automatic fixes
    • Average cost per task
    • Manual rework time

    For example, a model may respond quickly but often produce code that does not run. In that case, it reduces waiting time while increasing the manual review workload. Conversely, a model that responds more slowly but edits more accurately may deliver better overall efficiency.

    For this reason, evaluation should consider model fees and total engineering cost together:

    Total cost = model call fees + retry fees + runtime environment costs + manual review costs + error repair costs

    7. Security Boundaries Cannot Be Ignored

    Code agents often access source code, configuration files, logs, and business data. These may contain keys, user information, or internal addresses. Sanitize this data before it reaches the model.

    Common measures include:

    • Removing keys, tokens, and passwords before sending data
    • Irreversibly replacing user identifiers
    • Restricting the directories the model can access
    • Blocking default reads of production configuration
    • Scanning outputs for sensitive information
    • Keeping call logs and manual approval records

    In addition, avoid giving the model excessive execution privileges. The model can suggest actions, but high-risk operations should be carried out by a separate executor under permission controls.

    8. Final Conclusion

    Whether a new-generation multimodal model is worth using should not be judged by its advertised parameter scale or by whether a single answer reads smoothly. For developers, the more important question is whether the model can consistently complete tasks in real codebases while keeping cost, stability, and security under control.

    From a low-cost perspective, a sound solution usually has these characteristics:

    • Context filtering reduces unnecessary input.
    • Caching lowers the cost of repeated calls.
    • A multi-stage plan, modify, and verify process is used.
    • Tool calls are governed by permission controls.
    • Results are verified through tests and static checks.
    • Cost, latency, failure rate, and manual rework are recorded.
    • The model is used as part of a complete engineering workflow, not in isolation.

    For simple question answering, differences between models may be small. Once the work moves to codebase analysis, automated fixes, test generation, and continuous integration, however, system design largely determines the final experience.

    Therefore, the most valuable investment is not simply finding the “strongest model.” It is building an observable, reversible, auditable workflow with controlled costs around specific tasks. The model is only a core component. The combination of model capability and engineering mechanisms determines whether the system works in practice.