SteelReed

Search

Search posts, questions…

AI & LLMQuestion 4 / 25

Middle

How do you estimate the cost of a feature that uses an LLM?

Short answer

Cost = input tokens × input price + output tokens × output price, times the number of tasks per day. Count per completed task, including retries and tool-call rounds.

× tool rounds, retries× tasks per dayInput tokens × input priceCost per callOutput tokens × outputpriceCost per taskCost per day

3 points to say:

  1. Measure real tokens with the usage field or a token-counting API, not by characters; Vietnamese text and a tokenizer change shift the count.
  2. Every tool round resends the whole context; output tokens cost 4–8× more than input tokens.
  3. Cut in this order: prompt caching → batch → fewer input/output tokens, and only then a smaller model, with quality measured.

Keep reading the deep dive

Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.