TL;DR
Orchestrating multi-step LLM workflows across different models is usually done reactively—picking models one call at a time and backing off when you hit an API rate limit. By treating LLM orchestration as a formal constraint-satisfaction scheduling problem, the authors slash workflow completion times by nearly half and cut costs compared to strong greedy heuristics. Surprisingly, they also uncover a counterintuitive trap: dynamically re-planning mid-flight can actually slow you down if your scheduler panics over a blown budget.
What Problem Does This Paper Address?
Imagine an agentic workflow writing a research report: it outlines, searches, fact-checks, and summarizes. You have a heterogeneous fleet of models at your disposal—a pricey frontier model for deep reasoning, a mid-tier model for drafting, and a free local model on your own hardware for simple checks.
Choosing the right model for each step is only half the puzzle. These calls compete for shared capacity: API providers enforce strict tokens-per-minute (TPM) and requests-per-minute (RPM) rate limits, models cap concurrent requests, tasks depend on earlier tasks finishing, and you have a dollar budget. Current frameworks handle routing, dispatching, and rate-limit retries in isolation. Without global look-ahead, routing one task to a cheap or fast model right now might saturate a shared rate window and stall three critical downstream tasks. Worse, LLM execution is inherently noisy—token counts drift from estimates, calls fail, and tasks dynamically spawn follow-up work.
Methods
The authors cast LLM orchestration as a classical constraint programming problem solved using Google's OR-Tools CP-SAT solver, paired with a "rolling-horizon" execution engine.
- Joint Assignment and Timing: Every eligible
(task, model)pair is modeled as an optional time interval, allowing the solver to choose which model runs a task and when it starts inside a single optimization pass that balances total time (makespan), cost, and failure risk. - Bucket-Free Rate Limits (Novel Encoding): Continuous sliding-window API limits are tricky for discrete solvers. Instead of slicing time into coarse buckets, the authors attach a second, 60-second "shadow interval" to every request. Bounding the overlapping demand of these 60-second intervals with standard cumulative constraints cleanly enforces continuous per-minute token and request caps.
- Rolling-Horizon Re-solving: When reality departs from estimates—a task's duration misses by >25%, an API call fails, or a task spawns new fact-checking sub-tasks—the engine pins currently running tasks and re-solves the remaining graph. If the remaining budget is mathematically impossible to meet, a two-stage lexicographic relaxation first minimizes the budget overspend, then optimizes the schedule.
Datasets
Because no standard benchmark exists for rate-limited, multi-provider agent scheduling, the authors built a reproducible, seeded discrete-event simulator using common random numbers (ensuring every scheduling strategy faces the exact same stochastic token drifts, failures, and spawned tasks).
- Synthetic Workflows: Layered Directed Acyclic Graphs (DAGs) of 15 to 40 tasks requiring six distinct skills: 20 DAGs for tuning, 20 held-out DAGs for main evaluation, and 80 fresh DAGs for a pre-registered follow-up study.
- Simulated Fleet: Five models across three provider pools (three Anthropic Claude models sharing a pool, OpenAI's
gpt-4o-mini, and a single-slot localllama3model), with latency and token speeds calibrated from real API calls. - Live Sanity Check: One hand-written 11-task research-report workflow executed against real cloud APIs via LiteLLM.
Key Insights and Ideas
- Look-ahead crushes greedy list scheduling: Standard list schedulers like Online HEFT (Heterogeneous Earliest Finish Time) assign a ready task to whichever model finishes it soonest right now, blind to the fact that burning a provider's rate window or budget will bottleneck downstream tasks.
- The "Budget Panic" Paradox: Surprisingly, solving the schedule once at the start (
CP-SAT static) beat dynamically re-planning (CP-SAT rolling)! Post-hoc sleuthing revealed why: mid-run retries and unbudgeted spawned tasks push actual spending past initial estimates. Whenrollingrealizes the remaining budget is infeasible, its strict budget-relaxation rule forces minimal overspend first—dumping remaining tasks onto the free local Llama model. Because that local model is slow and processes only one task at a time, a massive queue forms.Staticnever checks spent budget mid-run, blissfully avoiding the local bottleneck. - Pricing overspend fixes the panic: In a pre-registered follow-up, replacing strict overspend minimization with a soft penalty (
Priced overspend) allowed the solver to spend fractions of a cent more to avoid the slow local queue, recovering ~72% of the static baseline's speed advantage.
Key Results
Comparison of cost and makespan across strategies, the makespan advantage over Online HEFT, and the impact of budget relaxations on rolling vs. static.
- Massive gains over heuristics: On the 20 main test DAGs,
CP-SAT rollingfinished in 123.2 s on average vs. 221.9 s for capacity-awareOnline HEFT—a 98.8 s (45%) reduction—while cutting costs by 11% and reducing budget-violation rates by 35 percentage points. On 80 fresh DAGs, the lead widened to 142.4 s. - Fast solver overhead: Across 1,245 solves, the median CP-SAT solve time was just 20 ms (mean total of 1.10 s per workflow run).
- Static vs. Rolling:
CP-SAT staticfinished 24.6 s faster thanrollingon the main set (and 21.2 s faster on the 80 fresh DAGs). Switching toPriced overspendspedrollingup by 15.2 s for just $0.00042 extra per run, while completing slightly more tasks thanstatic. - Quality-first routing is expensive: A capacity-blind
Reliability routerachieved a 100% task success rate (vs. 97.4% forrolling), but cost ~9× as much, took 1.5× as long, and triggered ~38 HTTP 429 rate-limit errors per run (vs. 1.32 forrolling).
Limitations and Future Work
- Simulator vs. real provider quirks: Both the solver and simulator count total tokens at request time in a 60-second sliding window. While mathematically safe under continuous token buckets, real APIs add quirks like separate input/output limits, sub-minute burst caps, or counting
max_tokensupfront. - Noisy estimates & narrow scope: Results rely on one fleet configuration and one random DAG generator. Furthermore, the scheduler relies on upfront token estimates—in the live 11-task API test, models generated 1.3× to 2.2× more output tokens than estimated.
- Next steps: Developing smarter budget rules that match the speed of
Priced overspendwithout extra spend, modeling exact provider-specific token metering, and benchmarking at scale on live APIs.
Summary updated