The pre-launch review as code
Nine production basics checked against a configuration. Run something like this in CI.
A small service skeleton you can copy: authenticate, enforce a tenant quota, build a budgeted context, call the model, stream events, store the exchange and log the outcome, plus a pre-launch review that checks the production basics.
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 6 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write sse(event) that turns a Python dict into one line data: <compact json> (use json.dumps with separators=(",", ":")) followed by a blank line, and print the encoding of {"delta": "Hi "} with repr.
Write join_events(lines) that takes the SSE lines of the skeleton (strings starting with data: ) and returns the text made from all delta events joined together, ignoring other events.
Explain it without notes
Walk through the steps of a request in the skeleton and say why they are in that order.
What belongs in the final event of a stream?
What would you add before taking this skeleton to production?
Expected output
ready: 9 of 9 pass
draft: 6 of 9 pass
fix: every query is scoped by tenant
fix: model calls have a timeout and a fallback
fix: readiness and liveness endpoints exist