Tiered Scheduling for Multimodal LLMs: An Agent Engineering Playbook

    This article presents a vendor-neutral methodology for tiered LLM scheduling in enterprise AI and agent systems. It explains why a single top-tier model cannot cover heterogeneous workloads, how to divide model capabilities into fast execution, balanced general-purpose, and deep reasoning tiers, and how context-window pricing, prefix caching, and thinking-token budgets shape the economics. It also covers reasoning-effort levels with a low-first, escalate-on-failure strategy, in-session dynamic orchestration between tiers, and a private evaluation and regression pipeline. A practical rollout checklist is included.

    1. The Problem: Why a Single Model Tier Cannot Cover Every Workload

    In enterprise AI applications and agent systems, workloads are highly heterogeneous. One class is “small steps, high frequency”: rewriting a function, adding a unit test, extracting fields against a fixed schema, making a single tool call, or deciding whether a log entry is anomalous. These tasks have short contexts, clear pass/fail criteria, and high sensitivity to time-to-first-token. A single failure is cheap and retryable.

    The other class is “long-horizon, high-dependency”: refactoring across a dozen files, tracking down a defect that only reproduces under specific inputs, making architectural trade-offs, or writing a design that requires multiple rounds of self-verification. These tasks need the model to hold a goal steady over a long stretch, demand deeper reasoning, and carry a high cost of failure.

    Running all traffic on the highest-tier model means paying three costs at once:

    • Money: small steps add up under per-token billing.
    • Time: the thinking overhead of a large model is spread across every trivial request.
    • Stability: peak-period quota gets consumed by low-value requests.

    The common industry response is to turn model capability into a tiered resource pool with a scheduling layer that routes by task characteristics. This article abstracts a vendor-neutral tiered scheduling methodology.

    2. Drawing Capability Boundaries Across Tiers

    A workable tiered system usually has three “slots”:

    • Fast execution slot: low latency, low unit price; handles high-frequency small steps and tool-call-heavy loops.
    • Balanced general-purpose slot: a compromise between capability, cost, and latency; handles everyday code changes, routine Q&A, and medium-complexity analysis.
    • Deep reasoning slot: high unit price, large thinking budget; invoked only at key moments for planning, hard debugging, and final adjudication.

    The point of the split is not “which model is smarter” but effective output per unit cost. To judge whether a slot is adequate, look at task completion rate, average number of rounds, and first-pass yield on your own repositories and business corpora—not just public leaderboard scores. Leaderboards reflect average performance on a general distribution, which drifts from private code style, internal frameworks, and domain terminology.

    3. Cost Structure: Do the Math on the Context Window

    The economics of tiered scheduling depend heavily on pricing granularity. Two models are common in the industry: a flat unit price for the whole request, and tiered pricing by context length. Flat pricing is more predictable—long-context tasks do not see a price jump just because “everything was stuffed in”—which suits repository-level Q&A and long-document understanding. Length-based pricing instead rewards a lean context.

    Either way, three things actually need engineering control:

    1. Cache hit rate. Prefix caching for stable system prompts, tool definitions, and project conventions can substantially cut repeated input cost. Callers must keep the prefix byte-for-byte stable.
    2. Where thinking tokens are billed. If the output price includes thinking tokens, the “thinking level” is effectively a cost switch and must be set per task tier.
    3. Wasted rounds. The most expensive thing in an agent loop is not a single call but going in circles: re-reading the same file, repeating failed tool calls, reflections that never converge.

    Illustrative cost estimation logic (pseudocode):

    1. def estimate_cost(tokens_in, tokens_out, cached_in, price):
    2. # price: per-million-token unit prices, maintained separately per tier
    3. fresh_in = max(0, tokens_in - cached_in)
    4. return (fresh_in * price.inp
    5. + cached_in * price.cache
    6. + tokens_out * price.out) / 1_000_000

    4. Reasoning Effort: Turning “How Long to Think” into a Tunable Parameter

    The mainstream approach exposes the reasoning budget as discrete levels (for example low / medium / high / one step higher). The engineering recommendation is to treat it as a circuit-breaker and budget knob, not a global constant:

    • Extraction, formatting, classification, small single-file edits: low, optimizing for throughput.
    • Routine coding and review: medium or default.
    • Hard defects, cross-module refactors, design reviews: high, with short bursts higher when necessary.

    Note that raising the level does not monotonically increase value. It adds latency and token consumption, and on simple tasks it can introduce over-thinking that turns a correct answer wrong. The safer strategy is “start low, escalate on failure”: run at a low level first, and if verification fails or two consecutive rounds make no progress, escalate and retry—recording the escalation rate as tuning input.

    1. def run_with_escalation(task, levels=("low", "medium", "high")):
    2. for i, lv in enumerate(levels):
    3. r = call_model(task, thinking=lv)
    4. if verify(r) or i == len(levels) - 1:
    5. return r, lv
    6. return r, levels[-1]

    5. In-Session Dynamic Orchestration: Two Slots Working in One Context

    The most mature form of tiered scheduling is not “pick a model, then make one call,” but dynamic orchestration within a single session: the planning phase uses the deep reasoning slot to produce a structured plan, the execution phase switches to the fast execution slot to land it step by step, and on a blockage it switches back to the deep slot to replan. Four points matter:

    1. A shared context carrier. The plan, completed steps, and failure reasons must be written into session state so switching models loses no context.
    2. An explicit handoff protocol. Output from the deep slot must be a machine-verifiable structure (steps, preconditions, acceptance criteria), not natural-language impressions.
    3. Budget guardrails. Set caps on total tokens, total rounds, and wall-clock time per session; exceeding them triggers degradation or convergence.
    4. Observability. Record the trigger reason and payoff of every switch, forming a scheduling policy that can be improved continuously.
    1. {
    2. "plan_id": "p-1024",
    3. "steps": [
    4. {"id": 1, "goal": "Locate the entry function", "accept": "file path + line number"},
    5. {"id": 2, "goal": "Add a minimal reproduction", "accept": "unit test fails and reproduces"},
    6. {"id": 3, "goal": "Submit the fix", "accept": "all checks pass"}
    7. ],
    8. "budget": {"max_rounds": 40, "max_tokens": 800000}
    9. }

    The orchestration layer can be built on general-purpose infrastructure: a task queue for peak shaving and prioritization, object storage for intermediate artifacts, logging plus monitoring and alerting for full-chain tracing, and a container platform for parallel sandbox execution. Baidu AI Cloud offers standard-category components for these general capabilities, composable as needed and not tightly coupled to the model layer.

    6. Evaluation: Do Not Trust a Single Score

    A self-built evaluation set is the foundation for whether a tiered system holds up over time. Cover at least four sample classes: small single-file edits, cross-file refactors, terminal/command tasks, and long-document understanding. Metrics should go beyond success rate to include average rounds, cache hit rate, escalation rate, and “fabrication rate” (citing interfaces or files that do not exist). Freeze a baseline before launch, then run a regression on every change to levels or prompts, to avoid silent regressions like “we edited the prompt and the success rate dropped.”

    7. Rollout Checklist

    • Profile traffic first: measure the request-length distribution and task-type mix to set the tier ratios.
    • Stabilize the prefix: manage system prompts, tool definitions, and project conventions centrally so caching works.
    • Default to low with escalation on failure, and record the distribution of escalation reasons.
    • Set total budget and convergence conditions in the orchestration layer to rule out infinite reflection.
    • Build a private evaluation set and regression pipeline; let metrics drive tuning.
    • Make the full chain observable: every model switch and every tool call must be traceable.

    8. Conclusion

    Tiering and orchestration are, in essence, about operating “model capability” as a schedulable resource: use the cheap fast execution slot to absorb high-frequency small steps, use the deep reasoning slot to hold the key decision points, use caching and budget guardrails to flatten the cost curve, and use a private evaluation set to lock in quality. The method depends on no specific product, applies to enterprise applications and agent systems built on multimodal foundation models, and can evolve smoothly as models iterate.