Tiered LLM Orchestration: Separating Planning from Execution
Tiered LLM orchestration assigns high-risk planning and review to stronger models while using faster models for well-defined, parallel implementation tasks. This article explains how to structure executable work packages, limit context, prevent conflicting edits, enforce quality gates, and escalate failures to balance cost, latency, and software quality.
AI-assisted coding is shifting from having one model handle every step to allocating compute according to task difficulty. Complex refactoring, cross-module design, and difficult bug diagnosis require stronger reasoning and longer context. Batch edits, boilerplate, additional tests, and formatting depend more on speed and parallelism.
Using a flagship model throughout a task consumes more quota and can increase waiting time. Using only lightweight models risks losing architectural constraints and edge cases. To maintain engineering quality while controlling costs, the division of labor must become an explicit workflow: a stronger model plans and reviews, while faster models execute in parallel. Repeated manual switching between models is not enough.
1. Why One Model Cannot Efficiently Handle the Entire Workflow
Software tasks are not uniform. A single request may involve clarifying objectives, comparing approaches, defining interfaces, implementing changes, testing, regression checks, and updating documentation. These steps place different demands on a model.
Planning requires identifying implicit constraints: compatibility with existing interfaces, transaction boundaries, authorization rules, error-code semantics, concurrency, and idempotency. A mistake here can force rework regardless of how quickly the implementation is written.
Implementation, by contrast, can often be divided into relatively independent patches, such as data access, validation, interface-layer changes, and unit tests. Given clear contracts, examples, and prohibited changes, lightweight models can handle these local edits efficiently.
The right division of labor therefore depends on information density and the cost of failure, not simply on which model is strongest:
- Use a more capable planning model for steps that require system-wide judgment or have a high cost of failure.
- Use faster execution models for low-ambiguity tasks that can run in parallel and be verified automatically.
- After combining the results, have the planning model review the diffs rather than allowing execution models to declare their own work complete.
This is a planning–execution–verification loop, not merely the same prompt sent to models of different sizes.
2. Turn the Division of Labor into an Executable Protocol
Switching models in an interface still depends on human judgment. A more reliable approach is to define a collaboration protocol so that every assignment carries consistent constraints.
Planning Must Produce Executable Work Packages
The planning model should produce dispatchable work packages, not general advice. Each package should include at least:
- Objective
- Allowed modification scope
- Prohibited modification scope
- Input and output contracts
- Existing types or interfaces on which the task depends
- Definition of done
- Verification commands or checklist items
The definition of done must be observable. For example, “Add tests for null values and duplicate submissions while keeping existing tests passing” is actionable. “Make the code more robust” is not.
Execution Models Should Receive Only Necessary Context
Passing an entire repository indiscriminately to a lightweight model wastes context and increases the likelihood of irrelevant changes.
Instead, provide relevant file excerpts, interface signatures, error-handling conventions, one or two positive examples, and explicit non-goals. When context becomes too long, prioritize constraints and counterexamples over unrelated implementation details.
Parallel Execution Needs Conflict Boundaries
Tasks can run safely in parallel when their write sets do not overlap or when merge rules are explicit.
For example, interface-layer and data-layer changes may proceed separately, but both tasks editing the same error-code table will create conflicts. Planning should establish file ownership. If ownership overlaps, run the tasks sequentially or have the planning model settle the shared contract before dispatching them.
Review Evidence, Not Self-Assessments
An execution model may report that a task is complete. Acceptance should depend on patch diffs, test results, and static checks.
Review should focus on whether the patch:
- Modifies anything outside its assigned scope
- Breaks compatibility
- Introduces abstractions that were not requested
- Handles exceptional paths consistently with existing project conventions
- Includes tests that assert behavior rather than merely invoke functions
A product-neutral work package might look like this:
Task: Add idempotency validation to order creationAllowed changes: Order service and corresponding unit testsProhibited changes: Payment callbacks and database migrationsContract: Repeated submissions with the same idempotency key returnthe existing order without decrementing inventory againDefinition of done: New duplicate-submission tests pass; existingsuccessful-creation and insufficient-inventorytests continue to passFallback: If the existing inventory interface has unclear semantics,stop editing and return questions for clarification
3. Choose Model Tiers by Failure Cost, Not by Name
In practice, model capabilities can be grouped into three broad tiers. Their names may differ, but their roles should remain consistent.
Flagship Tier
Flagship models are suited to architectural refactoring, cross-service consistency, difficult-to-reproduce bugs, and security-sensitive changes. Their value lies in avoiding the wrong approach, not in generating a few dozen additional lines of code.
Balanced Tier
Balanced models suit routine features, moderate-length context, and most code reviews. When task boundaries are clear but some local design decisions remain, using this tier for planning can be more economical than using a flagship model.
Fast Tier
Fast models suit local edits after retrieval, test generation, renaming, boilerplate completion, and drafting alternative approaches.
Their speed translates into quality only when instructions are sufficiently complete and unambiguous. With vague instructions, a fast model may simply produce inconsistent patches more quickly.
An orchestration strategy can use two main paths:
- High-risk changes: A flagship model decomposes the task and performs final review; balanced or fast models execute.
- Medium-risk changes: A balanced model decomposes the task and performs final review; fast models execute in parallel.
“Fast” should not mean “too weak to use,” and “flagship” should not mean “must generate every character.”
Quota consumption is driven largely by long context and repeated reasoning rounds. Concentrating those rounds in a small number of planning and review steps is often more economical than using a flagship model throughout, and more reliable than using lightweight models for everything.
4. Balance Quota, Latency, and Quality Across the Whole Task
Cost control should consider the entire task, not just the price of an individual call. A failed refactoring can trigger enough rework to consume more resources than careful planning would have required in the first place.
Use three indicators for retrospective analysis rather than inventing unverifiable performance percentages:
- First-pass acceptance rate: The proportion of patches that require no structural rework after automated checks and human spot checks.
- Human intervention points: Whether intervention was caused by unclear planning, missing context, or execution outside the assigned scope.
- Where waiting occurs: Whether users are waiting for planning or for many small edits that could run in parallel.
If waiting is concentrated in parallelizable steps, execution capacity is underused. If rework is concentrated in incorrect direction, planning should not have been delegated to a lower-capability tier.
When quota is tight, first remove irrelevant context and repeated explanations rather than eliminate review. Calls saved by skipping review can be outweighed by the cost of merge conflicts and production defects.
5. Establish Quality Gates
An orchestration workflow should include at least four gates.
Scope Gate
Changed files must fall within the work package’s allowlist. Out-of-scope changes should be returned before detailed review begins.
Behavior Gate
Verify behavior through tests, type checks, or the project’s established validation commands. If automated checks are unavailable, provide explicit manual verification steps rather than accepting code because it appears to work.
Contract Gate
Public interfaces, error semantics, configuration options, and data compatibility must not change silently. If a change is necessary, the planning model should first provide a separate migration explanation.
Security Gate
Secrets, tokens, and internal addresses must not be written into code or logs. Authorization checks must not be bypassed, and external input must continue to be filtered according to existing project practices.
AI coding tools can accelerate implementation, but they do not replace these checks.
Review feedback should identify specific diff locations and the definition-of-done requirements they violate. Vague instructions such as “optimize this further” encourage execution models to expand the scope of their changes.
6. Handle Failure Modes with Clear Fallbacks
Four failure patterns are especially common.
Overengineered Planning
A small change introduces a new framework or additional architectural layers.
Include a constraint such as: “Prefer existing patterns. Do not introduce shared abstractions unless the work package explicitly requires them.”
Locally Correct but Globally Inconsistent Execution
Individual patches work, but coding conventions or error codes differ across them.
Freeze shared contracts before starting parallel execution.
Invented Interfaces Caused by Truncated Context
An execution model adds a call to a method that does not exist in the repository.
Require references to actual signatures before dispatch. During review, treat new, unexplained public symbols as defects.
Tests That Do Not Validate Behavior
Tests only verify that the function under test was called.
The definition of done should require assertions about state changes, return values, and side effects.
Keep fallback rules simple:
- If execution fails because requirements are ambiguous, stop generating and return the issue to planning.
- If the cause is a local implementation error, reassign only the affected work package and include the failure logs.
- If the work package still fails after two consecutive attempts, escalate that local task to a more capable model instead of retrying the same prompt indefinitely.
7. Integrate Orchestration into the Engineering Workflow
This approach fits developer-local assistants, code-review bots, and auxiliary continuous integration jobs. It does not replace code review or release approval.
A recommended sequence is:
- A human confirms the objective and constraints.
- The planning model produces work packages.
- Execution models submit patches.
- Automated checks run first.
- The planning model reviews the diffs.
- Humans resolve disagreements and risk-sensitive issues.
Teams can turn work-package templates, allowed and prohibited directories, definitions of done, and review checklists into project conventions. This keeps model responsibilities stable even as team members change.
When using cloud-based AI coding, logging, or monitoring capabilities, retain model-call records, failure reasons, and reasons for human rejection. Use that evidence to adjust which tasks require a higher model tier rather than switching based on intuition.
8. Conclusion
When a smaller model outperforms a larger one on a coding task, it is often because the work has been divided into well-defined subproblems that suit the smaller model, while a stronger model protects architectural consistency and acceptance quality.
The reusable principle is not a preference for a particular model label. It is a workflow built on executable planning, minimal context, conflict-free parallelism, evidence-based acceptance, and escalation when execution fails.
Choose model tiers according to the cost of failure, and accept changes based on diffs and verification rather than self-reported completion. That is how AI-assisted coding can achieve a stable balance among quota consumption, latency, and software quality.
