Optimizing Agentic Language Model Inference via Speculative Tool Calls

Daniel Nichols, Prajwal Singhania, Charles Jekel, Abhinav Bhatele, Harshitha Menon
12/17/2025
cs.PLcs.AIcs.DC

No confident code implementation found for this paper.

Abstract

Language models (LMs) are becoming increasingly dependent on external tools. LM-based agentic frameworks frequently interact with their environment via such tools to search files, run code, call APIs, etc.

Show full abstract

Further, modern reasoning-based LMs use tools such as web search and Python code execution to enhance their reasoning capabilities. While tools greatly improve the capabilities of LMs, they also introduce performance bottlenecks during the inference process. In this paper, we introduce novel systems optimizations to address such performance bottlenecks by speculating tool calls and forcing sequences to remain resident in the inference engine to minimize overheads. Our optimizations lead to throughput improvements of several hundred tokens per second when hosting inference for LM agents. We provide a theoretical analysis of our algorithms to provide insights into speculation configurations that will yield the best performance. Further, we recommend a new "tool cache" API endpoint to enable LM providers to easily adopt these optimizations.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{nichols2025optimizing,
  title  = {Optimizing Agentic Language Model Inference via Speculative Tool Calls},
  author = {Daniel Nichols and Prajwal Singhania and Charles Jekel and Abhinav Bhatele and Harshitha Menon},
  year   = {2025},
  eprint = {2512.15834},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.15834v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.15834.svg)](https://codeofpaper.com/paper/2512.15834)

Discussion