ML in Production · 3 min read
Gemini API Adds Tool Retrieval and File Slicing to Cut Agent Token Costs
Google's Gemini Interactions API gains Tool Retrieval, file slicing and Managed Agents. LiteLLM reports 67% token cuts on PDFs; Vercel partner data shows 14x savings on text-based page review.
Key takeaways
- Tool Retrieval launched November 19, 2026 for the Gemini Interactions API; it loads full tool details only on demand.
- File slicing controls arrived November 23, 2026, covering PDF pages, Excel ranges, slides, video and audio segments.
- LiteLLM tests showed 67% token reduction on PDFs and 33% on workbooks; a Vercel partner report cited 14x savings.
- Google added token budget controls, scheduled execution and environment hooks to Managed Agents in July 2026.
- The Interactions API keeps conversation state server-side, removing the need to resend full context each request.

Google's Gemini API updates claim token cuts of 67% on PDFs and 33% on workbooks in LiteLLM's tests, with one Vercel partner report showing a 14x reduction when pages were reviewed as text instead of rendered. The features — Tool Retrieval, file slicing and Managed Agents — target the two pain points every agent team knows: input token bloat and custom orchestration code.
What does the Interactions API change?
The Gemini Interactions API sits at the center of Google's agent stack. It gives developers one interface for model calls, conversation history, tool use and long-running tasks, and it holds state on the server.
That last part matters for cost. In older setups, developers resent the full conversation with every request, burning tokens on context the model already had. Server-side state removes that repeat work between steps.
How does Tool Retrieval work?
Tool Retrieval, announced November 19, 2026, attacks a scaling problem: an agent connected to 100 tools may receive the full description and parameters of every tool at the start of each request. That inflates input tokens and can make tool selection less accurate.
The new approach works in two stages. The agent first sees only tool names and short descriptions, then requests a tool's full details when the task actually calls for it. Google also supports remote Model Context Protocol (MCP) servers — an open standard for connecting external tool services — as an alternative integration path. Tool Retrieval remains in preview, and savings depend on how many tools a task touches.
What can file slicing save?
File slicing controls, added November 23, 2026, let developers specify which parts of a file Gemini inspects. An agent reviewing a 200-page PDF can run text extraction first, find the relevant sections, then inspect only those pages.
The same control applies to Excel cell ranges, slide pages, video time ranges and audio segments. The published numbers — Vercel's 14x figure, LiteLLM's 67% PDF and 33% workbook cuts — come from specific tests, so treat them as directional rather than guaranteed.
What about long-running tasks?
Background execution lets an agent keep working without a request staying open, which matters for jobs that research, read files, run code and write reports. The Managed Agents environment handles web search, code execution, file handling and package installation inside an isolated Linux environment, and it preserves that environment so an agent can resume a task later.
Google's July 2026 additions to Managed Agents included token budget controls, scheduled execution, environment hooks and new model options. The max_total_tokens setting caps model use when an agent takes too many steps — a useful guardrail against runaway loops.
What should data teams do with this?
The pieces compound. Tool Retrieval trims tool descriptions, file slicing limits document input, server-side state cuts repeated context, and background execution removes held-open requests. Teams building coding assistants, research tools, or finance agents that read selected pages of long reports can replace custom infrastructure with the managed environment.
Two caveats deserve weight. Lower token use does not guarantee a lower final bill: agents may compensate by calling more tools or taking extra steps. And a managed environment still requires safety checks, clear permissions and human review of agent output before it reaches customers. Benchmark the specific workload before assuming LiteLLM's numbers carry over.
cloud.google.com (Original)
More from Priya Raman
Show full bio
Correspondent covering regulation, policy and their impact on Analytics Digest is a professional daily at Analytics Digest.
48 articles