1. Courses
  2. Product Management
  3. AI Product Management
  4. Stop 1

35 minIntermediate

How AI features work, just enough for PMs

Welcome to AI Product Management. You don't need to build models to manage AI products, but you do need to know what happens between a question and an answer, because that is where the cost, the waiting time and the mistakes come from. This lesson gives you that picture, the arithmetic behind it, and a fair way to decide between running a model on your own server and calling an API.

By the end you can

  • Explain model, tokens, context, prompt, retrieval, tools and fine-tuning in one sentence each, with an example
  • Estimate the cost per answer and per month of an AI feature, at normal volume and at festival peak
  • Set a response-time budget and say which step spends it
  • Compare your own server with an API on privacy, cost per query, response time and quality
  • Write a one-page AI feature fact sheet that engineers and finance can check

The everyday picture

Imagine head office hires a brilliant temp to answer phone calls from store managers. She has read millions of books and manuals, writes clearly in many languages and never gets tired. She has never worked at your company. She also has three odd habits. She forgets each call the moment she hangs up. She can only use what is on her desk during the call. And her agency bills by the page: every page she reads and every line she writes. When the answer is not on her desk, she sometimes gives a confident guess instead of saying "I don't know".

To make her useful you do three things. You tape an instruction sheet to her desk: "You answer store managers. Quote the procedure you used. If you are not sure, say so." You give her a runner who fetches the right two pages from the procedures binder for each call. And you give her a phone with a short list of numbers she may ring, such as the receiving system, where the person at the other end checks who is asking before reading anything out. That is almost a whole AI feature. The temp is the model, the sheet is the prompt, the runner is retrieval and the phone is tools. The agency's bill is your cost per answer, and the time she spends reading, phoning and writing is your response time.

What happens between a question and an answer

This course follows one product from idea to agent. Mangrove's store managers send head office about 3,000 questions a week through the ops desk's chat groups and phone line: "What markdown goes on yoghurt two days before expiry?", "Why is GRN 8812 still open?", "Why was my app order cut?". Eight people on the ops desk spend about 300 hours a week answering them, and a typical answer arrives about three hours later. Imran's team is building Ask Ops, an assistant inside the Store app and the back office that answers these questions from Mangrove's procedures and live data. Later lessons decide which questions it should take (pm-47), design it (pm-48), measure it (pm-49) and let it act (pm-50).

Here is what happens when Ama, a store manager, types "Why is GRN 8812 still open?". A GRN is a goods received note, the record of a delivery.

  1. The app sends the question with who is asking: Ama, store manager, store 112.
  2. Retrieval finds the few pieces of the procedures that match the question, here parts of RC-1, the receiving procedure, from the procedures Ama's role may read.
  3. A tool call reads the live record of GRN 8812 from the Store app's API, with Ama's permissions.
  4. The context is assembled: the instructions, the procedure pieces, the GRN record, the earlier messages in this chat and the question.
  5. The model writes the answer a word or so at a time, streamed to Ama's screen, with the procedure it used and the time the GRN was checked.

The model is a . It reads and writes , which are pieces of words; in English one token is roughly three quarters of a word. Everything the model can see in one call must fit in its . The fixed instructions at the start of every call are the .

Three facts follow, and each one shapes the product.

  • The model has no memory between calls. A follow-up question works only because the app sends the earlier messages again. Long chats therefore cost more per message.
  • It knows nothing about Mangrove. Its knowledge was fixed when it was trained. Procedures and live data must arrive in the context of each call.
  • It is not deterministic. The same question can get different answers, and sometimes a fluent, wrong one, called a . You can't judge quality from one try, which is why the course spends a whole lesson on evals.

Engineers who want the details of tokens, embeddings and vector search will find them in Designing AI features: LLMs, RAG and vector search. You need the picture and the trade-offs.

Quick check

Ama asks a follow-up in the same chat, "And who do I call about it?". What does the model know about her first question?

Ama asks why is GRN 8812 open? Ask Ops API adds role and store search look up Retrieval RC-1 pieces 2,000 tokens, 0.2 s Tool call GRN 8812 record 1,500 tokens, 0.4 s pieces live data Context for this call prompt, chat, data: 6,000 tokens Model first word after 1 s 300 tokens, 6 s Answer + sources cites RC-1, GRN at 09:42
One Ask Ops answer. The API adds who is asking, retrieval fetches procedure pieces and a tool reads the live GRN. About 6,000 tokens go into the model and about 300 come out, streamed, with sources. Every number here is approximate; your team measures its own.

Four ways to make a model useful at your company

A general model knows a lot about the world and nothing about your stores. There are four ways to close the gap. Each costs something different and fixes something different.

TechniqueWhat it changesUse it forAt Mangrove
PromptInstructions and a few examples in every callBehaviour, tone, format, rules such as "say when you are not sure""Answer in five lines or fewer. Name the procedure you used."
RetrievalRelevant pieces of your documents added at question timeKnowledge that lives in documents and changesThe ten procedures, from RF-2 Refunds to CD-1 Customer data
ToolsThe model asks your code to run a named function and gets the resultLive data, and later actionsRead a GRN, a stock count, an order's cut lines
Fine-tuningFurther training of the model on your examplesHabits: a strict format, a narrow classification, a styleNot needed for v1

, often called RAG, is how Ask Ops knows the procedures. When the refund rules change, the team updates the document and the next answer uses the new text. Answers can cite the piece they came from, so a manager can check in a tap. is how it sees live data. The model never touches the database. It asks for get_grn_status with a GRN number, and Mangrove's code checks that Ama may see that GRN, runs the query and returns the result as text.

is the technique people ask for first and need last. It is good at habits and poor at facts that change: train the model on this month's refund limit and it will repeat it after the limit changes, with no source to check. It also needs hundreds of good examples and has to be redone when you move to a newer base model. Reach for it only when evals show that prompts, retrieval and tools can't reach your quality bar.

Quick check

Next month the refund amount that needs a manager's approval changes from $50 to $40. What is the best way to make Ask Ops answer correctly?

Cost per answer, and a cost budget

With an API, every call is billed by tokens: cost per answer = input tokens × input price + output tokens × output price. Providers publish a price per million tokens for each model, and output tokens usually cost several times more than input tokens. Prices change often, so this lesson counts tokens and leaves the price to your provider's current price page. If you run the model yourself, the bill is servers and people instead (see the last section).

Most of the tokens in an answer are ones the user never sees. Here is one Ask Ops answer, measured in the pilot:

Output
System prompt (rules, format, examples)    1,500 tokens in
Procedure pieces (5 pieces of ~400)        2,000 tokens in
Tool result (GRN 8812 record and lines)    1,500 tokens in
Earlier messages in this chat              1,000 tokens in
Question                                      50 tokens in
------------------------------------------------------
Input                                     ~6,000 tokens
Output (the answer)                         ~300 tokens

Two things push the count up quickly. Every follow-up resends the chat so far. And every extra tool round is a whole new model call that reads everything again plus the new result: an answer that needs three rounds reads about 6,000, then 7,000, then 8,000 tokens, roughly 21,000 in total. Agents, which work in loops, multiply this (pm-50).

Then multiply by volume. Today's 3,000 questions a week is the floor: when asking becomes easy, people ask more. Mangrove plans for about 6,000 a week, about 26,000 a month, and twice that in a festival week. That is roughly 26,000 × 6,300 ≈ 164 million tokens a month. At the price Mangrove paid in the pilot this came to about 1.5 cents an answer, or about $390 a month. Compare that with the ops desk: 300 hours a week at about $8 an hour is over $10,000 a month. The model bill is rarely the biggest cost of an AI feature. Engineering time, evals and people reviewing the output usually are. It still needs a budget, because it grows with every new feature and every runaway loop.

The levers, roughly in order of effort:

  • Send less. Three good procedure pieces instead of five; the last two chat turns plus a short summary instead of the whole chat.
  • Route by difficulty. Send easy questions to a smaller, cheaper model and hard ones to the strongest. Check both with evals.
  • Cache. Many providers charge less when the start of a prompt is identical to a recent call (, explained in Claude: how Anthropic serves Claude at scale). Keep the fixed system prompt first. Identical questions, such as "when is the weekly stock count?", can reuse a stored answer keyed by role and procedure version.
  • Batch what can wait. Overnight work, such as tomorrow's suggested tasks, can use slower, cheaper batch processing where your provider offers it.
  • Cap it. A cost alert per day and a limit per store, so a loop that goes wrong can't spend the month's budget in an afternoon.

Quick check

Output tokens cost four times as much as input tokens on Mangrove's model. Which change cuts the cost of a typical answer the most?

Response time, and a latency budget

Two numbers describe how fast an AI answer feels. is how long until the first word appears; it grows with the amount of input the model must read. Then the model writes at some tens of tokens per second, so a long answer takes several more seconds. Streaming shows the words as they come, which makes the wait feel much shorter. Judge speed at the , the time 95 of 100 questions beat, never the average.

Write a budget the way you would for money. Ask Ops promises first words within 3 seconds and the full answer within 10 seconds, for 95% of questions. The pilot measured where the time goes:

Output
Step                                       Time (approx.)
App to Ask Ops API, check role             0.1 s
Retrieval: find RC-1 pieces                0.2 s
Tool: read GRN 8812                        0.4 s
Model reads 6,000 tokens, first word       1.0 s
-------------------------------------------------
First words on screen                     ~1.7 s   budget 3 s
Model writes 300 tokens at ~50 a second    6.0 s
-------------------------------------------------
Full answer                               ~7.7 s   budget 10 s

What spends the budget: a longer input delays the first word, a longer answer delays the end, each extra tool round adds a full model call, and peak load adds queueing. If you want to know why reading and writing behave so differently inside the chip, read ChatGPT: serving a large language model to hundreds of millions. The product fixes are ordinary: run lookups at the same time instead of one after another, ask for short answers, show progress ("Checking GRN 8812…"), set a timeout with a fallback (show the matching procedure pieces if the model is slow), and move work that doesn't need a person waiting into the background, with a notification when it is done.

Quick check

After the team adds a second lookup for "why was my order cut?" questions, those answers take 14 seconds at p95. The average is still 6 seconds. What should Imran ask for first?

Your own server or an API

There are two ways to run the model. You can call a provider's API, where a hosted model runs on the provider's machines. Or you can run an on servers you control, in your data centre or on rented cloud GPUs, using serving software such as vLLM, Ollama or llama.cpp. Open-weight families include Llama, Mistral, Qwen, Gemma and, since August 2025, OpenAI's gpt-oss, whose larger version runs on a single 80 GB GPU. Treat every name here as an example: the list changes every few months. Judge the choice on four questions, then on who will run it.

QuestionAPIYour own server
PrivacyData leaves your network. Read the provider's terms: training use, how long data is kept, where it is processed. OpenAI, for example, says it does not train on business data by default and may keep API data up to 30 days for abuse checks, with zero retention for eligible uses (2026). Terms differ by provider and change.Data stays inside. You own the security of the servers, the logs and the people who can read them.
Cost per queryPay per token. Near zero when idle, grows in a straight line with use.Pay for the machines all month, busy or idle, plus the people who run them. Cost per query falls as volume rises.
Response timeLarge shared fleets, usually fast. Adds an internet round trip; can slow at the provider's busy hours; rate limits apply.Fast when quiet. A few GPUs queue up at peak unless you buy enough for your busiest hour.
QualityThe strongest models are usually API-only.Open-weight models do well on narrow jobs such as answering from procedures. Measure on your own test set.
Running itThe provider runs it. You handle outages and limits.Updates, monitoring, capacity and on-call are yours.

The cost comparison has a shape worth drawing. API cost rises with every answer; your own server is a flat monthly cost that steps up when you add machines. The point where they cross is the : fixed monthly cost ÷ API cost per answer.

Privacy is often the real reason companies self-host. In April 2023 staff at Samsung accidentally leaked internal data into ChatGPT; on 1 May Samsung restricted generative AI tools on company devices until it had safeguards, and was reported to be building in-house tools. There are middle paths too: an API under a business agreement with limited retention and a processing region you approve; an open-weight model hosted for you by a cloud provider in your region; or a hybrid that sends the few sensitive question types to your own server. Whatever you choose, keep the model behind one interface in your code and keep your test set, so switching later is a test you run, not a rewrite (sd-34 shows the engineering).

Quick check

In which situation does running your own model make the most sense?

cost a month $0 $4k $8k 0 250k 500k answers a month own server fixed monthly API: grows with use break-even about 330,000 Mangrove: 26k a month
Mangrove's numbers: about 1.5 cents an answer on the API, against a quote of about $5,000 a month for two GPU servers plus a quarter of an engineer. The lines cross near 330,000 answers a month, about thirteen times the expected volume. A real server line steps up each time you add machines for peak load.

Do it

Write a one-page AI feature fact sheet that an engineer, a finance analyst and a privacy lead can each check.

  1. Trace one request

    Pick a real, typical question. Write each step from the question to the answer: who is asking, what is retrieved, which tools run, what goes to the model, what comes back. Ask an engineer to correct it.

  2. Count the tokens

    Use the team's measurements if the feature exists, or estimates if it doesn't: system prompt, retrieved pieces, tool results, chat history, question, answer. Count tool rounds; each one is a full call.

  3. Estimate volume and cost

    Start from today's volume, then plan for more once asking is easy, and for the festival peak. Multiply by your provider's current prices.

    Output
    Volume today     3,000 questions a week (to the ops desk)
    Plan             6,000 a week = ~26,000 a month; festival week x2
    Tokens/answer    6,000 in + 300 out (1 tool round)
    Tokens/month     26,000 x 6,300 = ~164 million
    Cost/answer      ~1.5 cents at pilot prices (recheck the price page)
    Cost/month       ~$390 normal; ~$600 in a festival month
    Caps             alert at $30 a day; 200 questions per store per day
  4. Set the latency budget

    Write the promise at p95, then list the steps and their measured times. Mark which step you would cut first if the budget breaks.

  5. Make the hosting decision on four questions

    Privacy, cost per query (with break-even), response time and quality, each with a number from a test. Add who would run it, and the triggers that would make you revisit.

  6. Write the fact sheet

    Markdown
    ## AI feature fact sheet: Ask Ops v1 (answers only, no actions)
    Users: 320 store managers, Store app and back office
    Job: answer procedure and status questions with sources, in seconds
    Knowledge: 10 procedures via retrieval (RF-2 ... CD-1), re-indexed on change
    Tools (read-only, run as the user): GRN status, stock count, order cut lines
    Model: hosted API v1, behind one interface; open-weight option tested
    Tokens per answer: ~6,000 in, ~300 out; 1 tool round typical, 3 max
    Volume: ~26,000 answers a month; festival week x2
    Cost: ~1.5 cents an answer, ~$390 a month; alert at $30 a day
    Latency (p95): first words 3 s, full answer 10 s; measured 1.7 s / 7.7 s
    Privacy: no customer names, phones or addresses sent; phone numbers
      masked on input; provider terms: no training, short retention, region
    Quality: 88% on the 150-question test set (bar for launch: 85%)
    Fallback: if the model is slow or down, show matching procedure pieces
    Revisit hosting if: >150,000 answers a month, data rules change,
      or an open-weight model reaches 86% on the test set

Bring it to your team

Ask these in the first design review of any AI feature.

  • Walk me through one request: what is retrieved, which tools run, and how many model calls does a typical answer make?
  • How many tokens go in and out per answer, and what is the cost per answer at today's prices?
  • What is our p95 for first words and full answer, and which step would we cut first?
  • Exactly which data leaves our network in each call, and what do the provider's terms say about it?
  • What is the monthly cost at festival peak, and what stops a runaway loop?
  • If we wanted to switch models next year, how many files change and which test would tell us it worked?

Red flags

  • "We'll fine-tune it on our procedures" as the plan for keeping answers current.
  • Latency quoted as an average from a demo with ten users.
  • A cost estimate that counts only the answer, not the prompt, history and tool results.
  • "Self-hosting is free once we buy the GPU."
  • Provider SDK calls scattered through the codebase, with no test set to compare models.

Practice

Budget a second AI feature

The Partner app team wants "type your order": a shop owner writes "same as last week, plus 2 more sugar" in any language, and AI builds the cart for him to confirm. About 4,000 partner orders a week arrive today, 62% through the app. The team expects half of app orders to use the new box. Each request needs: a system prompt of 1,200 tokens, the shop's last three orders (800 tokens), a catalogue search tool whose results add about 2,000 tokens, the message (50 tokens) and an output cart of about 150 tokens. One tool round is typical; unclear messages need two. Write the token count per request, monthly tokens, a p95 latency budget with reasons, a hosting recommendation, and two cost levers.

  • Input is about 4,050 tokens per request, and you note that a second round more than doubles it
  • Monthly volume is about 4,000 × 62% × 50% × 4.33 ≈ 5,400 requests, with a festival multiplier
  • The latency budget is stated at p95, and is looser than chat because the owner reviews a cart
  • The hosting choice uses the four questions and break-even, and says the API wins at this volume
  • The levers are specific, such as fewer catalogue results or caching the fixed prompt
Show a model answer
Output
Per request   1,200 + 800 + 2,000 + 50 = ~4,050 in, ~150 out (1 round)
              two rounds: the second call re-reads it all plus new
              search results, ~4,050 + ~6,000 = ~10,000 in;
              assume 1 in 5 requests need two
Volume        4,000 x 0.62 x 0.5 = 1,240 a week = ~5,400 a month;
              x2 in festival weeks
Tokens/month  ~5,400 x (0.8 x 4,200 + 0.2 x 10,300) = ~29 million
Latency p95   cart on screen within 6 s; show "Finding your items..."
              at once. Owners review a cart, so a few seconds are fine,
              but not 20: the shop has customers waiting
Hosting       API. At ~5,400 requests a month, break-even with a
              server is far away; no personal data needed (shop ID and
              product codes only); quality checked on 100 real messages
              in several languages before launch
Levers        return the 10 best catalogue matches instead of 30;
              put the fixed prompt first so prompt caching applies;
              skip the model when the message is "same as last week"

Review a vendor's AI proposal

Lagoon Digital, the agency that builds the Partner app, proposes this for a partner-shop help assistant. Find at least four problems and say what you would ask for instead.

Output
1. Fine-tune an open model on our 200 help articles so it "knows" them
2. Host it on one GPU server in our office to keep data private
3. Expected speed: 2 seconds (tested with our 5 staff)
4. Cost: the GPU, $0 per answer after that
5. Quality: our team tried 20 questions and all looked good
  • You replace fine-tuning with retrieval, because help articles change and need citations
  • You ask for failover, monitoring and who runs the server, and challenge "$0 per answer"
  • You ask for p95 latency at festival load, not an average with five users
  • You ask for a test set of real shop questions with a pass mark, instead of 20 tries
  • You ask for a cost and privacy comparison with an API option
Show a model answer
  1. Fine-tuning for facts. Articles change; a tuned model repeats old answers with no source. Use retrieval with citations and re-index on change.
  2. One GPU in an office. No failover, no peak capacity, unclear security and on-call. Ask for the full monthly cost, including people, and a second server or a fallback.
  3. 2 seconds with five users. Ask for p95 first words and full answer under a festival-peak load test.
  4. "$0 per answer". Servers, power, updates and staff are monthly costs. Ask for cost per answer at expected volume and the break-even against an API.
  5. 20 questions "looked good". Ask for 100 or more real questions from shop owners, with expected answers written by the partner team and a pass mark agreed before testing.

Check yourself

Finance asks why Ask Ops' model bill tripled in a month when the number of questions rose only 20%. What is the most likely cause?

Legal says customer personal data must never leave Mangrove's network. About 90% of Ask Ops questions don't need any. What is the strongest proposal?

A vendor's demo answers in 2 seconds. Which question best predicts what store managers will feel?

Flashcards

Open my review

Key takeaways

  • An AI feature is a model plus a prompt, retrieval for documents and tools for live data. The model knows nothing about your company and remembers nothing between calls.
  • Fine-tuning is for habits, not for facts that change. Prompt first, then retrieval and tools.
  • Cost per answer is mostly input tokens the user never sees: prompt, procedures, data, history and every tool round. Count them, then multiply by volume and festival peak.
  • Set a latency budget at p95 for first words and full answer. Tool rounds and long inputs spend it.
  • Decide on your own server or an API with four numbers: privacy, cost per query with break-even, response time and quality on your test set. Keep the model swappable.

Further reading

Episode transcriptThe temp who bills by the page · about 12 minutes · tap any line to play from there
  1. NadiaImran, how many questions do store managers send the ops desk every week?
  2. ImranAbout three thousand. Eight people spend roughly three hundred hours a week answering them, and a typical answer takes about three hours to arrive.
  3. NadiaAnd now your team is building Ask Ops, an assistant that answers them in seconds. So today's question is what actually happens between a question and an answer. Because that's where the cost, the waiting and the mistakes come from.
  4. ImranI'll admit, I've been treating the model as a black box with a price tag.
  5. NadiaThen let's open the box with a story. Head office hires a brilliant temp to answer store managers' calls. She's read millions of books, writes well in many languages, never gets tired. She's never worked at Mangrove.
  6. NadiaAnd she has three odd habits. She forgets each call the moment she hangs up. She can only use what's on her desk during the call. And her agency bills by the page, every page she reads and every line she writes.
  7. ImranAnd when the answer isn't on her desk?
  8. NadiaShe sometimes gives a confident guess. So you do three things. You tape an instruction sheet to her desk. You give her a runner who fetches the right two pages from the procedures binder. And you give her a phone with a few numbers she may ring, where someone checks who's asking before reading anything out.
  9. ImranSo the temp is the model, the sheet is the prompt, the runner is retrieval and the phone is tools.
  10. NadiaThat's most of an AI feature. The agency's bill is your cost per answer, and the time she spends reading, phoning and writing is your response time.
  11. ImranWalk me through a real one. Ama types, why is GRN eight eight one two still open?
  12. NadiaIf you can see your screen, the first diagram shows it top to bottom. If not, picture it. The app sends the question with who's asking: Ama, store manager, store one twelve.
  13. NadiaRetrieval finds the few pieces of the receiving procedure, R C one, that match. At the same time a tool reads the live GRN record, using Ama's own permissions. Then everything is packed into one context: the instructions, the procedure pieces, the GRN record, the chat so far and the question.
  14. ImranAnd the model writes the answer from that.
  15. NadiaWord by word, streamed to her screen, with the procedure it used and the time the GRN was checked. About six thousand tokens in, about three hundred out.
  16. ImranTokens being pieces of words.
  17. NadiaRight. In English a token is roughly three quarters of a word. Many other languages need more tokens for the same meaning. Price, limits and speed are all counted in tokens.
  18. ImranHere's my guess about follow-ups. When Ama asks, and who do I call about it, the model remembers her first question.
  19. NadiaThat's the most common wrong guess. The model remembers nothing between calls. The follow-up works because the app sends the earlier messages again. Which is also why long chats cost more per message.
  20. ImranSo it forgets the call when it hangs up, like the temp.
  21. NadiaExactly. It also knows nothing about Mangrove, because its knowledge was fixed when it was trained. And it isn't deterministic. The same question can get different answers, and sometimes a fluent wrong one. That's a hallucination, and it's why a later lesson is all about evals.
  22. ImranLet's talk about how you make it know Mangrove. Leadership keeps saying fine-tune it on our procedures.
  23. NadiaThere are four ways to close the gap. A prompt changes behaviour: answer in five lines, name the procedure, say when you're not sure. Retrieval brings in document pieces at question time.
  24. NadiaTools fetch live data, and later take actions. And fine-tuning trains the model further on your own examples.
  25. ImranAnd fine-tuning is the one people ask for first.
  26. NadiaAnd need last. It's good at habits, like a strict format. It's poor at facts that change. Next month the refund amount that needs a manager drops from fifty dollars to forty. A fine-tuned model keeps saying fifty, with no source to check.
  27. ImranWhereas with retrieval, the team updates the refunds procedure, R F two, and the next answer uses the new text, with a citation Ama can tap.
  28. NadiaThat's it. Prompt first, retrieval for documents, tools for live data, and fine-tune only when evals prove the others can't reach your bar.
  29. ImranNow the money. How do I work out the cost of one answer?
  30. NadiaOn an API it's input tokens times the input price, plus output tokens times the output price. Output tokens usually cost several times more each. Prices change often, so count tokens and take the price from your provider's page that week.
  31. ImranAnd most of the tokens are ones Ama never sees.
  32. NadiaRight. Fifteen hundred for the system prompt, two thousand for procedure pieces, fifteen hundred for the GRN record, a thousand for earlier messages, fifty for her question. Then every extra tool round is a full new call that reads everything again.
  33. ImranSo three rounds isn't six thousand tokens.
  34. NadiaIt's roughly six, then seven, then eight thousand. About twenty-one thousand. Agents work in loops, so they multiply this.
  35. ImranAnd volume. We have three thousand questions a week today.
  36. NadiaThat's the floor. When asking gets easy, people ask more. Mangrove plans for about six thousand a week, about twenty-six thousand a month, and double in a festival week.
  37. ImranAnd in the pilot that came to roughly one and a half cents an answer, so around three hundred and ninety dollars a month.
  38. NadiaAgainst an ops desk spending over ten thousand dollars a month of people's time on the same questions. The model bill is rarely the biggest cost. Engineering, evals and people reviewing the output usually are.
  39. ImranBut it still needs a budget.
  40. NadiaBecause it grows with every feature and every runaway loop. The levers: send less, like three good pieces instead of five. Route easy questions to a smaller model.
  41. ImranAnd cache the identical start of the prompt where the provider supports it.
  42. NadiaYes. Batch work that can wait overnight. And put a daily alert and a per-store limit on it.
  43. ImranSpeed next. Our promise is first words within three seconds and the full answer within ten, for ninety-five percent of questions.
  44. NadiaGood, you said ninety-five percent. That's the p ninety-five, and it matters more than the average, because the slow five percent is what managers remember.
  45. ImranWhere does the time go?
  46. NadiaAbout a tenth of a second to reach the API, two tenths for retrieval, four tenths for the GRN lookup, about a second for the model to read six thousand tokens and start. So first words at about one point seven seconds.
  47. NadiaThen three hundred tokens at roughly fifty a second, about six seconds. Full answer near seven point seven. Streaming makes those six seconds feel short.
  48. ImranWe added a second lookup for order-cut questions, and those now take fourteen seconds at p ninety-five.
  49. NadiaBecause each tool round is a whole model call. Fetch both records before the model starts, or in one round. Don't reach for a bigger model, which is usually slower.
  50. ImranNow the big argument. Our head of IT wants Ask Ops on our own servers, for privacy.
  51. NadiaA fair instinct. Samsung restricted generative AI tools on company devices in May twenty twenty-three, after staff accidentally leaked internal data into ChatGPT. So decide with four questions: privacy, cost per query, response time and quality. Then ask who will run it.
  52. ImranAnd the second diagram is the cost one.
  53. NadiaYes. If you can see it, there's a rising line and a flat line. If not, picture this. The API line starts at zero and climbs with every answer. Your own server is a flat line, the same every month, busy or idle, plus the people who run it.
  54. ImranAnd where they cross is break-even.
  55. NadiaThe server's full monthly cost divided by the API cost per answer. Mangrove's quote was about five thousand dollars a month for two GPU servers and a quarter of an engineer. At one and a half cents an answer, they cross near three hundred and thirty thousand answers a month.
  56. ImranAbout thirteen times what we expect.
  57. NadiaSo here's what you actually did. You ran both options for two weeks on the same hundred and fifty test questions. Privacy: procedures aren't sensitive, store data is covered by the provider's business terms, and customer names, phones and addresses are never sent.
  58. ImranThe order tool returns codes, not names, and a filter masks any phone number a manager types.
  59. NadiaResponse time: the API was one point eight seconds to first words. The test server was faster on a quiet morning but six seconds in a simulated festival peak, unless you add a GPU. Quality: the hosted model passed eighty-eight percent, the best open-weight model that fitted one GPU passed seventy-nine.
  60. ImranSo the memo chose the API for version one, with the masking filter and the terms in the contract. And three triggers to revisit: volume above a hundred and fifty thousand a month, a change in data rules, or an open-weight model reaching eighty-six percent.
  61. NadiaAnd the head of IT signed, because privacy got a design answer instead of a slogan. One warning, though. People compare the API bill with a GPU's sticker price. A real server also needs failover, monitoring, updates and someone on call.
  62. ImranSo the do-it is a one-page fact sheet.
  63. NadiaTrace one request with an engineer. Count the tokens, including every tool round. Estimate volume for today, for easy asking and for festival peak, and multiply by current prices. Write the latency promise at p ninety-five with the measured steps. Then the hosting decision on four numbers, with triggers to revisit.
  64. ImranAnd in my next design review I'll ask: how many model calls does a typical answer make? Exactly which data leaves our network in each call? And if we switched models next year, which test would tell us it worked?
  65. NadiaGood list. Now a pause-and-think. A vendor proposes fine-tuning a model on two hundred help articles, hosting it on one GPU in their office, and says it costs nothing per answer after that. What's the first thing wrong? Take a second.
  66. ImranThe help articles change, so a fine-tuned model will repeat old answers with no source.
  67. NadiaThat's the first. Then one GPU means no failover and no festival capacity, and nothing is free per answer when servers and staff cost money every month.
  68. ImranLet me sum up. One: an AI feature is a model plus a prompt, retrieval for documents and tools for live data, and the model remembers nothing between calls.
  69. ImranTwo: cost per answer is mostly tokens nobody sees, and tool rounds multiply them. Three: decide on your own server or an API with four numbers, privacy, cost per query, response time and quality.
  70. NadiaOne nuance on the third. Keep the model behind one interface and keep your test set, so switching later is a test you run, not a rewrite.
  71. ImranNext time: leadership has a list of five AI ideas, and I suspect some of them are spreadsheets in disguise.
Finished reading?Mark it complete to fill in its stop on your course line.

Use it at work

Cost estimate for an AI feature

A prompt, the expected reply length and traffic, and what it costs per call, per day and per month on each model.

Open in the AI Lab
Next stopPicking the right problems for AI
Was this lesson helpful?
Questions and discussion

Loading the discussion…