Without dashboards, token and dollar controls are vibes. Ops needs live views of usage, cost, cache hits, tier mix, errors, and budget burn.
Capstone-adjacent observability for everything taught in 13.3–13.4.
Related foundations: recount tokens with tiktoken (Vol. 12) and keep payloads inside the context window (Vol. 11).
Learning Objectives
By the end of this lesson, students should be able to:
- List essential LLM cost dashboard panels.
- Break down cost by model, feature, tenant, and env.
- Chart token totals with input/output split.
- Overlay budgets and alert thresholds.
- Track quality alongside cost (not cost alone).
- Automate daily digests for stakeholders.
Cost monitoring dashboards are operational views that visualize LLM token usage, spend, quotas, and related efficiency metrics (cache hit rate, tier mix, error/retry rates) over time.
| Panel | Metrics | Action link |
|---|---|---|
| Spend burn | $/hour, $/day vs budget | Alerts lesson |
| Token split | In vs out tokens | Pricing tiers |
| Model mix | % small/large | Tiering |
| Efficiency | Cache hit %, $/successful task | Caching / optimization |
| Reliability | 429s, overflows, retries | Rate limit / overflow |
Code: Emit Cost Metrics
Finance invoice
- Authoritative late
- Poor debug
- Monthly
Live usage metrics
- Actionable
- Needs instrumentation
- Minute/hour
Joined view
- Cost + quality
- Harder pipelines
- Best for orgs
Strengths
- Makes COGS visible daily
- Enables attribution by feature
- Supports executive trust
Tradeoffs
- Bad tags → useless charts
- Cardinality explosions
- Cost without quality misleads
“We graph total tokens only.” Without input/output split, model, and feature tags, you cannot tell whether RAG or chatter caused the spike.
Knowledge Check
- Short Answer: Name three dashboard dimensions. Answer: Model, feature, tenant/env (or in/out, budget—any three).
- True/False: Invoices alone are enough for realtime ops. Answer: False.
- Multiple Choice: Cache hit % belongs under: (a) efficiency panels, (b) CSS, (c) dropout. Answer: (a).
- Short Answer: Why tag by feature? Answer: Attribute spend to product surfaces.
- True/False: Cost dashboards should ignore 429/overflow rates. Answer: False.
- Multiple Choice: Input/output split panels support: (a) tiered pricing analysis, (b) font choice, (c) PCA. Answer: (a).
- Short Answer: What joins cost to quality? Answer: $/successful task or eval pass rate overlays.
- Short Answer: Where do token numbers originate? Answer: API usage (+ local tiktoken estimates).
- Multiple Choice: High cardinality tags risk: (a) useless/expensive metrics, (b) free GPUs, (c) better BLEU always. Answer: (a).
- True/False: Daily digests help non-oncall stakeholders. Answer: True.
Key Takeaways
- Instrument cost with useful tags.
- Split tokens; overlay budgets.
- Watch efficiency and reliability together.
- Prefer live metrics over waiting on invoices.
- Next: Cost-per-Request Optimization (Vol. 13 capstone).
Lab: Sketch a 6-panel LLM cost dashboard for a multi-tenant SaaS.
Discussion: Which single panel would you show a CEO weekly?
Recap: Dashboards make token money observable. Continue with the Vol. 13 capstone: Cost-per-Request Optimization.