CourseAgentic AI Engineer: The Complete Course · Module 15: Runtime and Infrastructure · part 86 of 97
Part 86 · Module 15: Runtime and Infrastructure

Lab: Run the desk as a budgeted background worker

40 min read·
Module 15 · Lab · About 80 minutes · Needs: the Module 3 lab's tools.py, lessons 1 (jobs, checkpoints, retries, schedules), 2 (serving, limits, tenants) and 3 (the budget ledger)

What you are building

RETURNS_DESK AFTER MODULE 15 app FastAPI, 202 Redis queue, events run_request start or resume call tools.py cron 08:00, hourly BudgetLedger reserve, settle checkpoints graph_checkpoints.db model
Your new code (blue) takes requests and schedules into a queue, and every run reserves from the ledger (green) before the model (amber) is called; Redis, checkpoints and Module 3's call are infrastructure (grey).

It is Friday 3 July 2026, week 12 (simulated), the last day before full launch. This lab moves the module into returns_desk/worker.py: Lesson 1's RQ jobs, including work_overnight_queue and check_all_waiting for cron_config.py. Every request reserves from Lesson 3's budget ledger before it may call a model. Lesson 2's FastAPI service shares the file, so web and workers share one job definition. Tool calls still go through Module 3's call. You follow Aisha's R-1001.

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.

Or open everything with a plan