The demo, replayed against real-world responses
A scripted fake API replays five kinds of real responses. The demo code has no guards.
A demo calls the model once and works. A product makes thousands of calls and meets rate limits, timeouts, broken formats, wrong answers, attacks and model updates. Each failure has a known engineering fix, and this course teaches them in order.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write is_retryable(status) that returns True for 408, 429 and any 5xx status, and False otherwise.
Write extract_json_object(text) that returns the parsed object from the first { to the last }, or None if that slice doesn't parse.
Explain it without notes
List five ways a model call can fail in production, split into loud and quiet failures.
Why can a feature pass every manual test and still fail daily in production?
Which errors should you retry, and which shouldn't you?
Expected output
request 1: positive
request 2: CRASH (rate limited, HTTP 429)
request 3: CRASH (reply was not valid JSON)
request 4: CRASH (timed out)
request 5: neutral
3 of 5 requests crashed the demo