Intermediate

The Token Savings Playbook

The visualization-first checklist, the token optimization maturity model, a 30-day plan for teams starting from scratch, and the 10 rules that keep savings compounding long after the initial pass.

✍️ AI School Editorial Team · Lilly Tech Systems 📅 Published Jul 13, 2026 · Reviewed Jul 13, 2026

The Visualization-First Optimization Checklist

Use this checklist before deploying any new AI pipeline or during an optimization audit of an existing one. Each item maps to a lesson in this course.

Before You Build

  • Have you identified the seven waste patterns that commonly appear in this pipeline type? (Lesson 2)
  • Have you established a token baseline for the assembled runtime context, not just the template? (Lesson 2)
  • Have you mapped the static vs. dynamic ratio of the context? A static ratio above 30% is a caching opportunity to address before launch. (Lesson 4)

During Development

  • Have you run a token heat map on a representative request to see component distribution? (Lesson 4)
  • Is history truncation or summarization in place for any pipeline that accumulates multi-turn context? (Lesson 2)
  • Have you validated that retrieved chunks are top-3 to top-5 rather than top-10 or top-20, with a re-ranking step if needed? (Lesson 2)
  • For knowledge-heavy contexts, have you evaluated graph compression vs. flat-text injection? (Lesson 5)
  • Are output length constraints in place for any step where the output is parsed or summarized downstream? (Lesson 2)

Before Deploying to Production

  • Have you established the pre-deployment token baseline (p50, p90, cost per request) for this pipeline? (Lesson 7)
  • Is token logging in place that captures input tokens, output tokens, pipeline name, and cache read tokens? (Lesson 7)
  • Have you tested the optimized pipeline against a quality evaluation set to confirm no regression? (Lesson 6)
  • Are regression alerts configured for this pipeline (spike and drift alerts)? (Lesson 7)

Ongoing

  • Is there a monthly Graphify check scheduled to compare current component distribution against the post-optimization baseline? (Lesson 7)
  • Is the token savings dashboard reviewed as part of the regular cost review? (Lesson 7)

The Token Optimization Maturity Model

Token optimization is not a single action but a capability that organizations build over time. The maturity model has four levels:

LevelNameCharacteristics
1 Reactive Token spend noticed only when the invoice arrives. Optimization happens by intuition after a cost spike. No baseline, no logging, no repeatable process.
2 Measured Token logging in place. Baselines established per pipeline. Monthly cost review. Optimization applied after spikes are detected, not before.
3 Proactive Token profiling as part of the deployment process. Visualization used to identify waste before launch. Regression alerts catch drift automatically. Quality correlation tracked.
4 Systematic Token efficiency is a first-class design constraint. Graph compression, caching, and routing are applied by default to new pipelines. Savings compound from architecture decisions, not just post-hoc edits.

Most teams that complete this course move from Level 1 to Level 2 within a week and Level 3 within a month. Level 4 is the goal of the broader Token Optimization curriculum.

The 30-Day Plan

For teams starting from scratch, here is a concrete 30-day plan to reach Level 3 maturity.

Week 1: Baseline and Logging

  • Day 1-2: Identify your top 5 pipelines by request volume. These are the highest-impact targets.
  • Day 3-4: Add token logging to all 5 pipelines. Capture input tokens, output tokens, pipeline name, and timestamp.
  • Day 5-7: Let logging run and collect a week of data. Use the Anthropic Count Tokens API or provider equivalents to verify your logging is capturing accurate numbers.

Week 2: Visual Audit

  • Day 8-10: Run Graphify on captured samples from your two highest-volume pipelines. Generate token heat maps and component breakdowns. Identify the top waste pattern in each pipeline.
  • Day 11-14: Apply one compression to each pipeline. For most pipelines, the first pass will be either caching a large static system prompt or reducing RAG top-k. Test against a 20-query evaluation set before deploying.

Week 3: Measurement Infrastructure

  • Day 15-17: Build the minimal dashboard: a cost trend chart by pipeline and a p50/p90 token distribution chart. Even a simple spreadsheet updated weekly is a significant step up from nothing.
  • Day 18-21: Configure regression alerts. A simple script that compares the 7-day rolling average to the 30-day average and posts a Slack message when the ratio exceeds 1.5 catches most regressions.

Week 4: Graph Compression and Documentation

  • Day 22-24: For any pipeline with high entity-density retrieved context, prototype graph extraction. Test the compressed context against the same evaluation set.
  • Day 25-27: Audit your remaining 3 pipelines and apply the same checklist from the top of this lesson.
  • Day 28-30: Document the baselines, applied optimizations, and measurement setup in your team's runbook. Schedule the monthly Graphify review.

10 Rules That Keep Savings Compounding

These rules distill the principles from this course into operational habits. Apply them consistently and the savings grow rather than erode.

  1. Profile before you optimize. The biggest gains come from finding the real waste, not the assumed waste. Never skip the visualization step.
  2. Log from day one. Token logging added after a cost problem is too late. Build it into the pipeline before it reaches production.
  3. Optimize the runtime payload, not the template. The assembled context is what the model sees and what costs money. The template is not the context.
  4. Test quality before and after every compression. A compression that hurts quality is not a saving - it is a regression that will cost more in retries and support load.
  5. Apply one change at a time. Two simultaneous changes make regression attribution impossible. Incremental optimization is slower but produces a clean record.
  6. Cache static content first. It is the lowest-risk compression: the content does not change, so quality cannot degrade. The savings are immediate and predictable.
  7. Treat the long tail seriously. p99 requests often drive 30-40% of cost. Identify and handle the edge-case input patterns that generate outlier context sizes.
  8. Graph-compress knowledge before you retrieve it. Entity deduplication and graph serialization yield better compression ratios when applied at build time than at inference time.
  9. Schedule the monthly check. Token drift is silent. Only a scheduled review catches it before it becomes expensive. Put it on the calendar alongside the cost review.
  10. Connect savings to quality on every report. Stakeholders who see token count drop without a quality metric lose confidence that the savings are real. Always report them together.

Where to Go Next

This course covered the visual and graph-based layer of token optimization. The companion courses below go deeper on specific levers:

  • Token Optimization - The full strategic layer: caching, routing, output control, agentic workloads, and governance.
  • AI Token Efficiency - Hands-on prompt-level techniques: compression before/afters, caching strategies, and routing examples.
  • AI Agent Frameworks in Practice - Agents burn 10-100x the tokens of simple chat. Framework-level controls for agentic token spend.
🤝
Want a token optimization audit for your stack? Lilly Tech Systems designs cost-efficient AI pipelines - context architectures, caching layers, and token-spend governance - for startups and enterprises. Talk to our engineers →

Ready to Go Deeper?

Live instructor-led courses from our partners. Affiliate disclosure.