Planning Ahead Under Rate Limits: Rolling-Horizon CP-SAT Scheduling for Heterogeneous LLM Agent Fleets

Pouria Mortezaagha, Arya RahgozararXiv 2026

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.

Figure 1: System overview. The engine follows the current plan and calls the solver again whenever execution departs from it.
  • 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 local llama3 model), 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. When rolling realizes 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. Static never 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.

Figure 2: (a) Cost and makespan per DAG (small markers) and overall means (large markers), log scales. (b) Per-DAG makespan of online HEFT minus CP-SAT rolling, sorted, with the mean and its 95% CI; blue bars are DAGs where rolling finishes first, gray bars ties within 0.5%. (c) Per run, makespan of CP-SAT static minus CP-SAT rolling against the number of budget relaxations in the rolling run (horizontal jitter added); points below zero are runs where static finishes first.
  • Massive gains over heuristics: On the 20 main test DAGs, CP-SAT rolling finished in 123.2 s on average vs. 221.9 s for capacity-aware Online 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 static finished 24.6 s faster than rolling on the main set (and 21.2 s faster on the 80 fresh DAGs). Switching to Priced overspend sped rolling up by 15.2 s for just $0.00042 extra per run, while completing slightly more tasks than static.
  • Quality-first routing is expensive: A capacity-blind Reliability router achieved a 100% task success rate (vs. 97.4% for rolling), but cost ~9× as much, took 1.5× as long, and triggered ~38 HTTP 429 rate-limit errors per run (vs. 1.32 for rolling).

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_tokens upfront.
  • 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 overspend without extra spend, modeling exact provider-specific token metering, and benchmarking at scale on live APIs.

Summary updated

BibTeX
@misc{mortezaagha2026planning,
  author = {Pouria Mortezaagha and Arya Rahgozar},
  title = {{Planning Ahead Under Rate Limits: Rolling-Horizon CP-SAT Scheduling for Heterogeneous LLM Agent Fleets}},
  year = {2026},
  eprint = {2611.40366},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.40366},
}
Figure