Worked lessons · 19 November 2026
Lesson 10 / 12 · approximately 8–12 minutes
Measure the economics of a workflow
Count the work and compare like-for-like outcomes.
The idea
A bill may include fresh input, cached input, generated output, tools and provider services. Local execution adds hardware time, energy and operational costs even without a token-priced API. Cache discounts depend on actual eligibility, model and provider policy. Do not confuse prompt caching with semantic answer caching: a previously computed answer can be obsolete or belong to another user. A useful comparison holds prompt, output length, quality criteria and cache state constant.
Worked example
A fictional price sheet charges 2 units per million fresh input tokens, 0.5 for cached input and 8 for output. A run has 10,000 fresh input, 20,000 cached input and 2,000 output tokens: 0.020 + 0.010 + 0.016 = 0.046 units, excluding tools. These are invented teaching rates, not a provider quote. Lower cost is meaningful only if the task still meets the same quality and latency gates.
Use it in a workflow
- Write token, cache, tool and output assumptions explicitly.
- Separate prefill/first-token latency from generation throughput.
- Use comparable repeated measurements and record failures.
- Check total workflow cost, data privacy and quality, not only model price.
Try it without a model
Recalculate the fictional example if cached input becomes fresh input. Then name two reasons not to cache the final answer.
Compare with the answer criteria
Input becomes 30,000 × 2 / 1,000,000 = 0.060; output stays 0.016; total is 0.076 units. Changing source revisions and owner scope can invalidate final-answer reuse. Tool actions should never be replayed merely because a cached response contains them.