πŸ“° Key Summary

Google has launched native document slicing for the Gemini API. Developers can upload PDF, Word, PPT, Excel, audio and video files directly, so the AI reads only specified pages, spreadsheet cells, or a segment of a video, and Token charges are based only on what is actually read. For example, when analyzing a financial report with hundreds of pages, the AI can first use a low-cost text-only mode to find the target section, then read high-resolution images of only the relevant pages to check charts and footnotes. When working with Excel, it can target specific worksheets and cell ranges, reading data, formulas, and charts separately. Developers could get similar results before, but they usually had to call PDF tools, LibreOffice, or FFmpeg themselves to split and convert files in advance. Now the Gemini API does this directly on the server side. A file only needs to be uploaded once, and an Agent can call it repeatedly in later tasks, deciding for itself which part to read next. As for results, tests from LiteLLM, an AI model gateway, show that document slicing cut input Tokens by 67% for one PDF and 33% for one Excel workbook. Vercel said that in its tests, extracting only the text of document pages used 14x fewer Tokens than rendering the entire PDF. The feature is now available through the API and covers the Gemini 4 series models, with existing file size and page limits unchanged.


πŸ’¬ JudyAI Lab Take

Google has launched native file slicing for the Gemini API, letting the AI read only specified PDF pages, Excel cells, or video segments, and billing only for what it actually reads. This means the cost structure of processing long files is changing.

In the past, developers had to call PDF tools, LibreOffice, or FFmpeg themselves to split files first. Now the server handles it directly. LiteLLM’s tests show input Tokens down 67% for one PDF and 33% for an Excel workbook. Vercel’s tests found that extracting only page text used 14x fewer Tokens than rendering the whole PDF. A file only needs to be uploaded once, and the Agent can call it again and again, deciding for itself which part to read next. The trend we see here: instead of stuffing the whole file into context, let the model locate things cheaply first, then pull in exactly the pieces it needs. The focus of Agent design is shifting from “how much data can we cram in” to “let the model decide what to read.”

If you’re building a file-processing workflow, start by taking stock of which steps burn Tokens on whole files. Then try a two-stage approach: find the table of contents first, then read specific pages.


πŸ“… Source Info


πŸ”— Further Reading