CourseLarge Language Models: The Complete Course · Module 13: Deployment, Operations, and Economics · part 94 of 103
Part 94 · Module 13: Deployment, Operations, and Economics

Lab: One gateway, a web service and a way back

43 min read·13 Oct 2026
Module 13 · Lab · About 90 minutes · Needs: lessons 1 to 4 of this module, and the Module 1, 2, 10 and 11 labs (or the cells in Step 1)

What you are building

SUPPORTDESK/ AFTER MODULE 13 caller X-User: lena api.py POST /triage gateway.py Gateway.run hosted model local model otel_trace.py spans releases.py register, flag, rollback Redis cache, quotas Dockerfile and ci.yml ship it; tests/test_gateway.py pins it
Every model call (amber) now passes one door in code (blue), with shared state in Redis (grey) and the release rules beside it.

It is Friday 28 August 2026, end of week 13. Before drafted replies go live on Monday, every model call must pass through one door. gateway.py holds Lesson 1's data rules and anonymiser and Lesson 3's deadline, fallback, cache, quotas and kill switches behind one Gateway.run. otel_trace.py records OpenTelemetry spans beside Module 8's trace.py. api.py serves the gateway over HTTP; releases.py holds Lesson 4's register, flag and rollback rules; a Dockerfile and ci.yml ship it. The running examples are T-1001, Ana Duarte's duplicate charge, and T-1017, Jonas Feldmann's, whose contract says EU processing (simulated). Eleven hosted calls are made, in Steps 6 and 7.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.