Design a ChatGPT-style chat service
Launch day. Two million people start chatting at once. The model servers keep up, but the web tier runs out of open connections, a deploy at 3 p.m. cuts twenty thousand answers off mid-sentence, and one user on the $20 plan has already used $400 of tokens. None of that is about the model. It's about streaming, history, limits and cost, which is what this question tests.
In this lesson you'll learn to
- Design streaming delivery for many long-lived responses, including reconnects, cancellation and deploys.
- Store conversations and build each prompt from history so it fits the context window and hits the prompt cache.
- Layer rate limits per user, per token budget and per model fleet, and say what users see when they hit one.
- Estimate cost per user, and design plans and limits for the heavy tail rather than the average.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.