Context trimming reduces the tokens sent on each model call by summarizing or removing conversation history, dropping irrelevant tool descriptions, or constraining response length with structured outputs. section 8.3.8
Unlike caching or model routing, which reduce costs through reuse or model selection, trimming changes the context sent to the model. Tight summaries can save tokens but weaken coherence across multi-turn conversations. section 8.3.8
Use trimming selectively:
- Summarize or remove conversation history that does not need to be sent on every call. section 8.3.8
- Drop irrelevant tool descriptions or use structured outputs to constrain response length. section 8.3.8
- Measure cost per session, resolved task, and user before optimizing; weigh savings against coherence and the value being produced. section 8.3.8
