Production AI Operations Workshop
About 48 min
Goal
By the end of this lesson, you can trace one request through a production service and use operational evidence to make admission, rollout, and recovery decisions.
Follow one request across the service
Follow one request before looking at the whole controller. A client sends "summarize this text" with max_tokens=200. The API first checks that the fields and limits are valid. Admission then asks whether the current service has enough safe capacity. The scheduler decides when and where the request runs. The model performs inference. The service streams or returns the output. Telemetry records what happened under the exact deployment version.
A request can fail at any one of those boundaries for a different reason. Invalid input should fail before expensive work starts. A valid request may still wait because memory is full. A healthy inference can still belong to a bad rollout if the candidate violates a release gate. Keeping the boundaries separate makes the earliest cause visible.
The same request can be written as a concrete sequence:
- API validation
- admission
- scheduling
- model execution
- streaming or final response
- telemetry
- terminal accounting
Pin deployment identity and admission
The deployment record names the exact service image, model revision, serving runtime, and configuration. Carry that identity with every fixture so measurements from two candidates are not mixed.
{"request_id":"r-17","deployment":"v18","admitted":true,"queue_ms":42,"ttft_ms":310,"terminal":"ok"}
Admission checks both request limits and available memory. A valid request can still wait or receive an overload response when the current replica cannot fit it safely. Clean rejection is better than crashing the shared model process.
Schedule and account for memory
The scheduler creates batches under a wait deadline and concurrency limit. Record queue time, time to first token, and full generation time separately. Then a throughput improvement cannot hide a large increase in interactive wait time.
Memory accounting includes weights, KV-cache budget, workspace, and reserve. The workshop does not emulate a real GPU kernel. It checks whether controller decisions stay inside the declared resource budget.
Use telemetry and rollout gates
Telemetry records the deployment version, request class, latency pieces, error category, and capacity signals. Keep request IDs in trace-like records instead of aggregate metric labels.
The rollout fixture compares a baseline with a candidate. The candidate passes only when normal thresholds and critical zero-tolerance rules all hold. If a gate fails, the controller chooses the known rollback deployment.
Test recovery and recompute evidence
Recovery tests also remove one replica. The remaining system must respect safe capacity, queue limits, and degraded-mode rules. A test that works only when every resource is healthy is not enough.
The project validator recomputes critical metrics from raw requests, deployments, and events. It does not trust fields such as admitted, release_passed, or healthy when those values can be derived from primary evidence.
When something fails, debug the earliest broken boundary. An out-of-memory crash may begin with bad admission accounting. A latency regression may begin in the queue. A rollout comparison may be wrong because telemetry mixed two versions. Clear evidence at each boundary makes the cause easier to find.