Tiered Orchestration for Agentic Coding: A Practical Guide to Model Routing

    This article explains how engineering teams can make agentic coding more cost-effective by moving model selection from a fixed global choice to a runtime decision based on task profiles. It covers capability tiers, an orchestrator-worker architecture, task decomposition granularity, parallel execution with file leases, evaluation by task distribution, quota and cost governance, and a practical adoption checklist. Readers will learn how to route work across model tiers while keeping quality gates consistent.

    1. Why “One Model for Everything” No Longer Makes Economic Sense

    Once agentic coding became part of everyday development workflows, teams ran into a structural mismatch: task difficulty follows a long-tail distribution, but resource consumption is roughly uniform. Most changes are low-risk, repetitive work—adding tests, renaming fields, standardizing names, migrating configuration in bulk. Only a few steps demand deep reasoning, such as architecture trade-offs, root-cause analysis of difficult defects, or planning cross-module refactors.

    If every step calls the same top-tier model, two things happen. First, quota and budget get consumed quickly by low-value tasks. Second, repeatedly injecting long context increases latency, and failed retries amplify cost. Conversely, using a lightweight model throughout lowers the engineering ceiling, and complex defects easily fall into a cycle of “fix one place, break another.”

    The industry has gradually converged on a shared idea: turn model selection from a global constant into a runtime decision tiered by task, and let the orchestration layer handle decomposition, dispatch, and review. This is the core idea of tiered orchestration.

    2. Capability Tiers: Treat Models as Execution Units of Different Specs

    The more robust engineering approach is to avoid depending on specific model names and instead abstract three tiers based on capability profiles:

    • Large (flagship tier): long-chain reasoning, cross-file refactoring, root-cause analysis of difficult defects, solution review.
    • Medium (general tier): routine feature development, medium-complexity context understanding, documentation and test case generation.
    • Small (high-speed tier): format conversion, local patches, batch renaming, unit test filling, log categorization.

    The point of tiering is not “who is stronger” but establishing measurable routing criteria. It is better to attach explicit labels to tasks rather than rely on the caller’s on-the-spot judgment:

    1. task_profile:
    2. complexity: low | medium | high # decision tree depth, number of cross-file changes
    3. risk: low | medium | high # whether core paths/data are touched
    4. context_window: short | long # scale of context to inject
    5. parallelism: 1..N # number of independent subtasks that can be split
    6. verification: none | unit | integration

    The routing policy can be reduced to one priority rule: high risk or high complexity goes to the large tier; medium goes to the medium tier; low risk with automatic verification goes to the small tier with a mandatory verification gate.

    3. Orchestrator-Worker Architecture: Turning “Master and Apprentice” into a Platform Capability

    The early approach was to act as a human supervisor: switch to the top-tier model when writing the skeleton by hand, and switch to a lightweight model for manual labor. This depends on individual experience, is hard to replicate, and does not stay stable at team scale. A more engineering-oriented approach is to build this pattern in as an orchestration mode, where the Orchestrator handles planning and review, and Workers handle implementation and self-testing.

    The orchestrator loop usually has five steps:

    1. Goal clarification: turn vague requirements into verifiable acceptance criteria.
    2. Task decomposition: split into minimal work units that do not conflict, and annotate dependencies.
    3. Dispatch and execution: route to the corresponding tier based on task_profile, allowing parallelism.
    4. Integration and review: the orchestrator reviews diffs centrally, handling conflicts and regressions.
    5. Convergence and archiving: capture change notes, test evidence, and failure patterns.

    Illustrative pseudocode:

    1. def orchestrate(goal):
    2. plan = planner.profile_and_split(goal) # Large tier: decomposition + acceptance criteria
    3. results = parallel_map(
    4. plan.tasks,
    5. dispatch, # route by tier
    6. max_workers=plan.parallelism
    7. )
    8. merged = integrator.merge(results) # conflict resolution
    9. report = reviewer.review(merged, plan.criteria) # Large/medium tier review
    10. return report if report.passed else orchestrate(goal, feedback=report)

    The most important design constraint here is that Workers must not expand the scope of changes on their own. All out-of-bounds modifications should be rejected at the integration stage, rather than “hoped not to happen” during execution.

    4. Task Decomposition Granularity: The Invisible Parameter That Decides Success

    If decomposition is too coarse, the small tier lacks enough context and tends to produce patches that “look reasonable but do not compile.” If decomposition is too fine, orchestration overhead and integration conflicts rise instead. The practical range is one to three files per work unit, with one independently verifiable behavior change.

    A workable test: if a subtask cannot describe its result with one executable assertion, it has not been decomposed enough. For example, “optimize the auth module” is not acceptable; “add two boundary cases for the token expiration path and make them pass” is.

    5. Parallelism and Conflict Governance

    Parallelism is the biggest benefit of the small tier and also the biggest source of risk. A “file lease” mechanism is recommended: at any given moment, only one Worker may write to the same file, while other tasks are read-only.

    1. lease = acquire(path) # request a lease before writing
    2. if not lease: return defer(task)
    3. apply_patch(task); run_checks(task); release(lease)

    Combined with three types of gates, this can significantly reduce rework: static and type checks, unit tests, and a change-size threshold (for example, reject and re-decompose when a single diff exceeds a line limit).

    6. Evaluation Perspective: Look at Task Distribution, Not Just the Overall Score

    Many teams are misled by leaderboards and assume nominal tiers must correspond to a capability order. In practice, you often see the small tier outperform the medium tier on specific tasks, because the evaluation set differs from your business distribution. Therefore, build your own evaluation set and bucket statistics by task type:

    • Coding agent tasks: first-pass patch rate, regression introduction rate.
    • Knowledge work automation: process completion rate, number of human takeovers.
    • Long-horizon autonomy: output per unit of budget, correctness of termination conditions.

    The main metric should be “number of effective tasks completed per unit of quota,” not absolute scores. Only this reflects real cost-effectiveness.

    7. Quota and Cost Governance

    The benefits of tiered orchestration must be observable; otherwise they cannot be continuously optimized. The minimum viable practice is to record for each call: task labels, tier, input/output size, number of retries, and whether it passed the gates. At the weekly report level, track three ratios: the share handled by the small tier, first-pass rate, and cost per task.

    If the small-tier share rises while the regression rate stays flat, routing is correct. If the regression rate rises, tighten the risk criteria or strengthen the gates, rather than simply reverting to the full flagship tier.

    8. Adoption Checklist

    1. Build the evaluation set first, then discuss routing; avoid tiering by intuition.
    2. The orchestrator only plans and reviews; it does not write business patches itself.
    3. Workers must follow “minimal changes + self-test evidence.”
    4. Add leases for write operations, and resolve conflicts centrally at the integration stage.
    5. All tiers share the same quality gates; standards are not lowered.
    6. Put the cost dashboard and the quality dashboard side by side; deterioration on either side triggers a review.

    9. Conclusion

    The essence of model tiering and orchestration scheduling is to decouple “judgment” from “execution” in the development process: scarce resources are used for decisions and review, while cheap resources are used for verifiable repetitive labor. When this mechanism is built into the platform, constrained by metrics, and protected by gates, teams can continuously raise their delivery ceiling while keeping budgets under control.