cs.AIOct 13, 2026

Whose turn is it? Context-guided model routing for stateful agents

Authors: Anikesh Parashar, Avik Dutta, Vashu Chauhan, Sumit Gulwani, Priyanshu Gupta, Hosein Hasanbeig, Vu Le, Ashish Tiwari, 

Organizations: Microsoft

Abstract

Model routing can reduce the cost of LLM applications by assigning simpler requests to cheaper models without sacrificing the quality of the response. However, most routers treat requests as independent. Stateful agents do not operate under this assumption: a user turn may require multiple model and tool calls, its difficulty depends on the state produced by earlier turns, and changing models can sacrifice reuse of the conversational prompt cache. We study zero-shot, cost-aware routing at the user-turn boundary, systematically varying the routing rule, access to session history, candidate models that differ in size, reasoning effort, or model provider, and prompt-cache behavior. We evaluate on multi-turn versions of SheetCopilot and SpreadsheetBench 2, where persistent workbooks and cross-turn dependencies make isolated routing decisions especially brittle. At a matched offloading rate, giving the router session history improves task pass rate over the same router without history, with gains for every model pair; history-aware routing remains within one point of always using the expensive model. We also found that cost depends on execution dynamics rather than token prices alone: the cheaper model's per-task cost advantage narrows from 6.8x to 3.2x on longer sessions. A closed form cache analysis further shows that downward switches (expensive to cheap) recover their cache cost within two LLM calls, whereas upward switches do not break even under the evaluated conditions. Together, these results show that agent routing is a sequential decision problem: effective policies must account for what happened earlier in the session and for the asymmetric cost of switching models.

Figures & tables

Appendix figures & tables3 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. MTRouter: Cost-Aware Multi-Turn LLM Routing with History-Model Joint Embeddings

    Apr 26, 2026Yiqun Zhang, Hao Li, Zihan Wang +6Cost-Aware InferenceLLM Routing

  2. RSI-Router: Evolving Subtask-Level LLM Routing and Skills for Cost-Efficient Agents

    Sep 28, 2026Hao Li, Hangfan Zhang, Zhiyao Cui +5Cost-Aware InferenceLLM Agent Workflow Optimization

  3. AgentRouter: Heterogeneous Model Routing for Cost-Optimal Multi-Step Agentic Workflows

    Sep 19, 2026Rudrendu Kumar Paul, Sourav NandyLLM Agent RoutingCost-Aware Inference