Model Tiering for Agentic Coding: A Practical Guide to Orchestrator-Executor Workflows

    This article explains why using a single model for every coding task is becoming inefficient and how model tiering (model routing) addresses the problem. It covers an explicit orchestrator-executor design, task cards for context sharing, principles for mapping task risk and context length to model tiers, engineering requirements for the orchestration layer, common anti-patterns, and a step-by-step adoption roadmap with automated acceptance checks and cost metrics.

    1. Why a Single Model for Everything Is Failing

    As agentic coding enters everyday development workflows, a clear contradiction has emerged: task complexity is distributed, while model capability is tiered. Real engineering work includes high-difficulty decisions such as how to layer an architecture, where to draw interface boundaries, and how to stay compatible with legacy systems. It also includes large volumes of low-risk manual work such as generating boilerplate code to a fixed specification, adding tests, updating copy, and running formatters. Using the same model tier across the entire workflow creates two costs at once: high-difficulty steps are constrained by quotas and context limits, while low-difficulty steps pay for unnecessary capability redundancy.

    For this reason, the industry is widely adopting model tiering, also known as model routing: planning, review, and architecture decisions go to stronger but slower and more expensive models; execution, verification, and bulk edits go to lightweight, fast, low-consumption models; and an orchestration layer handles decomposition, dispatch, aggregation, and re-checking. This article focuses on this general engineering pattern and provides a practical implementation guide.

    2. Core Design: Making “Master and Apprentice” an Explicit Workflow

    In the traditional approach, tiering depends on developers switching manually: first write the framework and define interfaces, then switch to a lightweight model for implementation. The problems are fragmented context, high handoff cost, and unclear quality ownership. A more mature approach hard-codes the tiers into an orchestrator-executor structure:

    • Orchestrator: responsible for task decomposition, dependency ordering, acceptance criteria definition, code review, and regression gating.
    • Executor: responsible for implementing subtasks, adding tests, fixing small defects, and generating documentation fragments.
    • Parallelism control: subtasks with no dependencies run concurrently; subtasks with dependencies proceed sequentially.
    • Unified context: context is passed through task cards, constraint lists, and acceptance scripts rather than conversation memory.

    An illustrative task card structure (tool-agnostic):

    1. task_id: T-017
    2. goal: Add idempotency key validation to the order module
    3. constraints:
    4. - Do not change existing public interface signatures
    5. - Unit test coverage must not fall below the existing baseline
    6. - Do not introduce new runtime dependencies
    7. acceptance:
    8. - `make test` passes completely
    9. - Static checks report no new warnings
    10. split:
    11. - subtask: Generate validation logic and unit tests
    12. executor: light_fast
    13. - subtask: Review boundary conditions and concurrency semantics
    14. reviewer: strong_reasoning

    The key benefit of this structure is that high-capability models appear only at nodes that require judgment, the execution layer can scale out in parallel, and both quota consumption and response latency drop.

    3. Selection Principles for Capability Tiers: Don’t Judge by Tier Names

    Many platforms name models by size, such as large, medium, and small, but names only indicate positioning, not actual performance on a specific task. A more reliable approach is to build your team’s own task-to-model mapping table and continuously calibrate it with a small regression set:

    1. Tier by task risk: prioritize strong reasoning for high-risk work (data migration, permissions, billing, concurrency consistency); use lightweight and fast models for low-risk work (boilerplate code, comments, formatting).
    2. Tier by context length: use tiers with stronger long-context capability for long-repository retrieval and cross-module impact analysis; use low-latency tiers for short-context rewrites.
    3. Tier by feedback loop: for complex defects that need multiple rounds of self-correction, use a strong model for root cause analysis and a lightweight model for batch verification.
    4. Decide with metrics, not impressions: use pass rate, rework rate, average repair rounds, and consumption per task as selection criteria.

    An executable evaluation table (example fields):

    Task Type Key Metrics Preferred Tier Fallback Tier
    Architecture refactoring plan Plan pass rate, rework rate Strong reasoning Medium
    Batch test generation Coverage gain, failure rate Lightweight and fast Medium
    Difficult defect localization Root cause hit rate Strong reasoning Medium
    Documentation and comments Human adoption rate Lightweight and fast Medium

    4. Engineering Requirements for the Orchestration Layer

    Orchestration is not “throwing tasks at a model”; it is an observable, rollback-capable control plane. It should include at least the following capabilities:

    • Task graph (DAG) management: express dependencies explicitly to avoid conflicts from concurrent writes to the same file.
    • Change isolation: each executor subtask runs in an independent branch or working copy, with unified review before merging.
    • Automated acceptance: use tests, static checks, and builds as hard gates so that model output must be verifiable.
    • Failure fallback: when an executor fails consecutively and reaches a threshold, automatically escalate to a stronger tier or hand off to a human.
    • Cost and latency dashboard: track consumption and elapsed time by task type and continuously adjust routing policies.

    Pseudocode illustration:

    1. def run_task(task):
    2. plan = strong_model.plan(task) # Planning and acceptance criteria
    3. subtasks = plan.split()
    4. results = []
    5. for st in schedule_by_dependency(subtasks):
    6. model = "strong" if st.risk == "high" else "light"
    7. patch = model.generate(st)
    8. if not passes_checks(patch, st.acceptance):
    9. patch = strong_model.review_and_fix(st, patch)
    10. results.append(patch)
    11. return merge(results)

    5. Common Anti-Patterns and How to Avoid Them

    • Anti-pattern 1: Strong model everywhere. Quotas are exhausted quickly, and large amounts of low-value work occupy high-value context.
    • Anti-pattern 2: Lightweight model everywhere. Complex boundary conditions and concurrency semantics are easily missed, and rework rates rise.
    • Anti-pattern 3: Passing context only through conversation. Long-chain tasks tend to drift, so constraints should be fixed through task cards and acceptance scripts.
    • Anti-pattern 4: No hard gates. Model output must be constrained by tests and static checks; otherwise quality is uncontrollable.
    • Anti-pattern 5: No metrics review. Without data, routing cannot be optimized, and tiering degenerates into guesswork.

    6. Adoption Roadmap (Ready to Follow)

    1. Inventory tasks: classify the past two weeks of development tasks by risk and context length, and measure their proportions.
    2. Establish a baseline: record the current average repair rounds, consumption per task, and delivery latency.
    3. Run a small pilot: enable the orchestrator plus executor setup on one low-risk module for two weeks.
    4. Calibrate the mapping: adjust the task-to-model mapping table based on pass rate and rework rate.
    5. Scale and govern: incorporate automated acceptance, the cost dashboard, and failure fallback into team standards.

    7. Conclusion

    The essence of tiered model collaboration is not replacing expensive models with cheap ones, but matching each type of task to a capability tier that is just sufficient, and using engineering-based orchestration and acceptance to guarantee quality. For teams, this increases throughput under limited quotas while concentrating the judgment of high-capability models on the steps that truly require decisions. If you are evaluating how to introduce a similar mechanism into your own development workflow, you can draw on engineering practices from Baidu AI Cloud and start with two steps, task tiering and automated acceptance, to gradually build a measurable efficiency loop.