MLGuerrillaStart M1 →
Free · in beta·intermediate·M12·46 min read·Prereq: Production, Deployment & Scale (M11-1 and M11-2). The support agent from M6 to M11 is the running example, and its numbers come from the same workload sheet.

LLMOps & Cost

The capability

What LLMOps and cost engineering for an LLM system are

LLMOps for a feature that runs on a model is basically the loop that keeps it working after launch. Every change goes from a signal through an experiment and a release gate into production, and this module follows that loop by looking at what it costs. Cost engineering is the other half, and it's about knowing what one useful outcome costs and which levers change that number, including the ones that change quality as well.

The first part of that is picking a unit that somebody outside the team would recognise. The provider bills you in tokens, but cost per resolved ticket is the number anyone else can act on, and the gap between those two numbers is where most cost surprises turn out to be hiding.

The second is that every call bills on more than one meter. Input tokens, tokens read from the cache, tokens written to the cache and output tokens each have their own price, and output is usually the most expensive of the four by a long way.

The third is that cost per conversation is a distribution with a long tail. The average conversation is rarely the same one that sets your bill, which means that if you build a forecast on the mean, you've built it on the wrong conversation.

The fourth is that a cost belongs to a version. Every experiment and every week of production traffic ran on one specific version of the prompt, the model, the tools and the dataset, so if a cost number doesn't say which version it came from, you can't compare it with anything. The last two sections take the pieces that M1, M2, M8 and M11 built and join them into one loop, and then they run a customer complaint through that loop and put a cost on each step.

A ladder of five units stacked from cheapest and least meaningful at the bottom to most meaningful at the top. One token, then one model call, then one turn, then one conversation, then one resolved ticket. Beside each rung sits who cares about it: the provider bills tokens, an engineer debugs a call, a product owner thinks in turns, a support lead thinks in conversations of about 4.8 turns each, and finance thinks in resolved tickets. A marker sits on the resolved-ticket rung, labelled the unit to manage. A note underneath says the multiplier between the bottom rung and the top is the thing nobody estimates.
Every rung is a real number. Only the top one answers the question finance is asking.

You can't forecast this from a price list on its own, because what sets the bill is how many calls one outcome takes, how much history gets re-sent on each of them, how much of that history was cached, and how long the answers are. This module works out each one of those on a real workload and then goes after them in order.

Where it shows up

Every feature that runs on a model has this problem as soon as it stops being a prototype.

  • A support agent whose cost per conversation is 5 to 10 times its cost per model call.
  • A coding assistant where a long session re-sends the whole file tree on every turn.
  • A document pipeline where the per-page price looks fine until somebody uploads a 400-page PDF.
  • An internal chatbot that costs nothing at 50 users and becomes a line item at 5,000.

The arithmetic works the same way in all four of them, and it starts with one number that turns out to be wrong.

Keep reading

The rest of this lesson is free with an account

Create a free account to read the remaining 15 sections. It takes about twenty seconds and there's nothing to pay. The same account opens the slide decks and CV reviews.

  1. 02The spreadsheet said $588
  2. 03A conversation costs more than its answer
  3. 04The bill is a distribution
  4. 05Cheaper without touching quality
  5. 06Cheaper by trading quality, measured
  6. and 10 more