Mid-level interview question
How do you turn a machine's hourly price into a cost per token, and how much can batching change it?
Model answer
Divide the price per hour by tokens per hour: the book's $2 an hour at 100 tokens/s is about $5.56 per million output tokens. Batching raises throughput, so it cuts cost: at an illustrative $2 an hour, our Apple GPU's measured throughput gives $3.50 per million at batch 1 and $0.26 at batch 64, about 13 times cheaper. But bigger batches slow each user, and the KV cache caps the batch.
Practise the rest
9 Cost per request questions, 492 in all, each with a model answer. Free.
More Cost per request interview questions
- How is an API request priced, and why is the reply often most of the bill?
- (Illustrative numbers.) Model A costs $0.004 per request and is correct 50% of the time; model B costs $0.006 and is correct 95% of the time. Which is cheaper, and what should you track?
- You're deciding between a model API and self-hosting. How do you find the break-even, and what does the simple calculation leave out?
- How do you cut token costs at scale?
- When is a small open model good enough, rather than a frontier model?
- When do you send inference to a fast model and when to a cheap one? Walk me through the cost and latency trade-offs.