AISim › Chapter 4: Running it for real
The nightly job ate the day
Level 17. A million tickets to summarise, and live users get 429s.
Someone kicked off a job to summarise and tag every support ticket from the last year. It runs through the same real-time API as your live chat. Now 60% of your traffic is a background job nobody is waiting on, it's eating your rate limit, and live customers are getting errors.
Goals
- error rate at most 1%
- cost per 1,000 requests at most $9
- accuracy at least 85%
- median latency at most 6.0s
Concepts: Batch APIs, Async workloads, Rate limits.
Hint
Not every request needs an answer in seconds. Where could work that can wait a few hours go instead?
What you learn
Separate work that someone is waiting on from work that can wait. Providers offer batch APIs at roughly half price with results within hours, and batch jobs don't compete with your live traffic for rate limits. Real-time capacity is precious: keep it for real-time users.
More in this chapter
- The 20-page system prompt (Level 16)
- Fine-tune it? (Level 18)
- Nothing changed. Everything broke. (Level 19)
- Compliance is calling (Level 20)
- Finance wants a word (Chapter 4 boss)
This interactive level needs JavaScript. Built by Joshua Paul (cybernerdie).