Multi-Model Collaboration: Improving Token Efficiency in Mobile App Development

    When teams use Large Language Models (LLMs) for mobile app development, choosing based solely on unit price often leads to mismatched expectations, as the actual output for the same token consumption varies significantly. This article explores a practical multi-model collaboration approach that improves token efficiency by focusing on task decomposition, stage-specific model selection, and graceful degradation during rate limits. It covers evaluation dimensions, role division across development stages, typical model performance, cross-review strategies, and engineering solutions for handling peak-hour traffic.

    Many teams choose Large Language Models (LLMs) to assist in mobile app development by first comparing unit prices before making a decision. However, in real-world projects, the output generated for the same token consumption can vary drastically. The main factors determining output quality are threefold: whether tasks are decomposed reasonably, whether the right models are used at each stage, and whether the system can degrade gracefully when encountering rate limits. This article provides a practical, actionable collaboration methodology.

    1. Clarify Evaluation Dimensions First

    Practicality cannot be measured solely by the number of generated lines of code. It should be evaluated across four dimensions:

    1. Solution Quality: Whether the approach is broad-minded and covers edge cases and exception paths.
    2. Execution Accuracy: Whether the generated code can compile, run directly, and pass tests.
    3. Time Cost: The time spent waiting for output and making iterative modifications.
    4. Stability: Whether the service can be continuously called during peak hours and if the failure rate is controllable.

    Under the same token volume, if a model spends a large number of tokens on repetitive deliberation but produces output that is less concise and direct than another model, its practical value in actual projects is lower.

    2. Divide Model Responsibilities by Development Stage

    1. Overall Requirement Planning

    The planning stage requires the model to step beyond single-point implementation and coordinate functional module division, data flow, page navigation, offline strategies, and future expansion. This stage is best suited for models with strong divergent capabilities that can provide multiple alternative solutions. Planning output should be structured documentation containing at least a module list, API contracts, state management methods, and a risk list. The output does not need to be lengthy, but the decision rationale must be clearly stated. Otherwise, the execution stage will require frequent confirmations, slowing down progress.

    2. Exploratory Tasks

    Exploration includes reading existing code, checking third-party library usage, validating system API behaviors across different versions, and writing small test scripts. These tasks are numerous but limited in single-value, making them suitable for lightweight, fast, and cost-effective models. Exploration results should be compressed into a few clear conclusions before being handed to subsequent stages. Passing the entire conversation history as-is will cause the context to rapidly expand, increasing token consumption at every subsequent step.

    3. Actual Coding Execution

    The execution stage focuses on strictly following the planning documents and implementing module by module. Fast models have a clear advantage here, as a single feature usually requires multiple rounds of modifications and compilation feedback. The scope of each task should be limited during execution—for example, “only implement form validation for the login page without touching the network layer.” The smaller the scope, the less likely the model is to over-engineer, and the easier it is to verify each round’s output.

    4. Review and Acceptance

    The review stage is best handled by highly stable models with low hallucination rates and sensitivity to detail. Their task is to check the implementation against the planning document item by item, identifying missing exception handling, thread safety issues, unreleased resources, and missing permission declarations. Review comments should be graded by severity and provide specific file locations and modification suggestions so developers can directly pinpoint the issues.

    3. Typical Performance of Various Models

    Below are common performance characteristics; actual effectiveness should be tested using your team’s own task samples.

    • Divergent Models: Excel in the solution design phase with many candidate ideas. In the execution phase, they easily fall into repetitive weighing,表现为表现为表现为manifesting as long reasoning times without outputting usable code.
    • Lightweight Fast Models: Quick single-response times, suitable for high-frequency calls. They also have a tendency to overthink, but because of their fast response, users are less likely to notice it subjectively.
    • Robust Models: Low hallucination rates, proactively prompt edge conditions, and have stable reasoning processes. They are highly suitable for the review role.
    • All models may experience rate limiting or timeouts during peak hours, so you cannot assume that any single service will always be available.

    4. Multi-Model Cross-Review

    Using a single model for review can easily create blind spots, as the model’s mindset may cause it to repeatedly miss the same type of issues. For critical modules like login, payment, permissions, and data storage, a safer approach is to use multiple models from different sources for independent review, followed by a single model to summarize the conclusions. The specific steps are as follows:

    1. Fixed Review Checklist: All models use the same input and set of checks to avoid conclusion deviations caused by different prompts.
    2. Independent Issue Lists: Each model’s output format is standardized into four items: “File, Issue Description, Severity, Modification Suggestion.”
    3. Summarize and Deduplicate: The summary model merges similar issues and highlights those identified by multiple models simultaneously. These issues usually have higher credibility and should be prioritized.
    4. Manual Spot Check: The summarized conclusions require developer spot-checking, especially for parts involving permissions, privacy data, and funds. These cannot be entirely left to automatic model decisions.

    Multi-model review increases the number of API calls, so it should only be applied to critical modules. Standard UI code can use a single review.

    5. Engineering Solutions for Peak Hours

    Rate limits (HTTP 429) and timeouts during peak hours can disrupt the development workflow. Three things can be done simultaneously at the call layer: exponential backoff retries, role-based fallback models, and splitting long tasks into resumable checkpoints. Below is a sample code snippet where the client wrapper and exception classes are placeholder implementations and should be replaced with your team’s actual interfaces.

    1. import time
    2. ROLE_CONFIG = {
    3. "planning": {"tier": "planner", "reasoning_budget": 8000},
    4. "exploration": {"tier": "fast", "reasoning_budget": 2000},
    5. "execution": {"tier": "fast", "reasoning_budget": 4000},
    6. "review": {"tier": "reviewer", "reasoning_budget": 6000},
    7. }
    8. FALLBACK = {
    9. "planner": ["reviewer"],
    10. "reviewer": ["planner"],
    11. "fast": ["planner"],
    12. }
    13. def call_with_fallback(role, prompt, clients, retries=3):
    14. tier = ROLE_CONFIG[role]["tier"]
    15. budget = ROLE_CONFIG[role]["reasoning_budget"]
    16. for candidate in [tier] + FALLBACK.get(tier, []):
    17. for attempt in range(retries):
    18. try:
    19. return clients[candidate].complete(prompt, budget=budget)
    20. except RateLimitError:
    21. time.sleep(2 ** attempt) # Retry after exponential backoff
    22. except TimeoutError:
    23. break # Switch to the next candidate directly on timeout
    24. raise RuntimeError(f"All candidate models for role {role} are unavailable")

    Beyond code-level handling, scheduling is also important. Batch exploration and low-priority tasks can be scheduled during off-peak hours, while peak hours should prioritize high-reasoning planning and review work.

    6. Implementation Checklist

    • Has structured planning documentation been completed before coding?
    • Have exploration conclusions been compressed before being passed to the next stage?
    • Is the execution task scope limited per modification?
    • Have critical modules undergone cross-review by at least two models?
    • Does the call layer have retry and degradation logic?
    • Are token consumption and time spent recorded for each stage to facilitate adjustments in the next round?

    Combining multiple models is generally safer than betting on a single one. Each model has its own shortcomings, and a reasonable division of labor is key to making the overall output more reliable.