internalsGet Pro

AI Engineering · Module 10

Cost, latency and scaling

Lessons
11
Free
0
Reading
~3 h

Your progress

0 / 11 lessons done

Sign in to track

Lessons

  1. Where the time goes in an LLM requestWhen a person waits for a model, “it’s slow” is not something you can fix. Engineers who can say which stage holds the seconds, and which lever moves that stage, spend their time on the change that helps instead of the one that sounds fast.17 min
  2. Caching for LLM apps: exact, semantic and promptEvery LLM feature repeats itself: the same questions from users, the same instructions on every call. Caching the right repeat cuts the bill and the wait; caching the wrong one shows a customer someone else’s answer, with no error to warn you.18 min
  3. Token economics: caching, batch and effort togetherEvery team that ships model features gets asked to make them cheaper. The cuts that look biggest are often the smallest, the savings don’t add up the way a spreadsheet suggests, and the wrong cut moves the cost from the invoice onto your users.18 min
  4. Model routing: small models first, large when neededMost AI features serve a mix of easy and hard requests. Routing is how you pay large-model prices only for the hard ones, and a careless router can cost more than never routing at all.18 min
  5. Batch and background processing for LLM jobsEvery AI product collects work nobody waits for: eval runs, audits, and backfills after a prompt or model change. Running it at half price, without crowding out live traffic and without paying twice after a crash, is everyday production work.18 min
  6. Provider rate limits, queues and fallbacksOnce several features call the same model, they share one set of limits. On the busiest morning the work nobody is waiting for can take the room from the person who is, unless your own code decides the order.18 min
  7. Cost control: budgets, quotas and alertsA model API bills every call, and a bug or an abusive customer can multiply the calls overnight without any error. Cost control is what turns that from a surprise on the invoice into a page within minutes and a feature that switches off on purpose.18 min
  8. Charging for AI features: metering and quotas per customerEvery AI feature sold to customers needs a bill they trust and a price above what the model calls cost. A meter that counts the wrong thing, or counts it twice, turns into refunds, angry emails and features that lose money on the biggest customers.18 min
  9. Self-hosting open models: when and howOnce one AI job runs a hundred thousand times a day, someone asks whether a small model on your own GPU would be cheaper. The honest answer needs the GPU price, the memory arithmetic and the people who keep it running.17 min
  10. Case: Instacart’s batch platform for LLM jobsOnce several teams send millions of prompts, the provider’s batch API is the easy part. Splitting files, surviving crashes, sorting failures and charging each team is most of the work, and Instacart published how it shared that work across the company.19 min
  11. Design: scaling a chat assistant to a million usersAn AI feature that works for a few customers usually breaks at scale on limits nobody sized: the provider’s tokens per minute, budgets set for normal days, and retries that multiply load. Planning the peak, and what users see when it is exceeded, is the work that keeps a launch from turning into an outage.30 min

Practise with

No tools or paper guides for this module yet.

Terms this module teaches 46

Open glossary

Acceleration limit

A provider limit on how fast an organization’s usage may rise, which can return 429 errors after a sharp jump even while usage is below the per-minute limits.