Lesson 2 · Unit 04
Cost and latency
Where the tokens and the seconds go, and the levers
What you practise
- Input and output tokens, caching a shared prefix, streaming, a small model for easy calls, budgets for context
Try a question from this lesson
Pick one
A request sends 6,000 input tokens and gets 300 output tokens back. On this provider an output token costs 4 times an input token. Which side dominates the bill?
Correct answer
Input: 6,000 units against 1,200
Why
Output tokens cost more each, but there are twenty times fewer: 300 × 4 = 1,200 units against 6,000. Most features read far more than they write, so the prompt is usually where the money goes.
The idea
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Prefix caching
A provider can reuse the work it did on the start of a prompt when the next request begins with exactly the same tokens.
So order matters: put what never changes first (system message, tools, examples) and what changes last. One different token early on, and everything after it is processed again at full price.
11 more exercises in the app
- 3× type the answer
- 4× multiple choice
- 1× order the lines
- 1× true or false
- 1× fill the blanks
- 1× match the pairs
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.