📄️ FastAPI for ML
Turn a trained churn model into a production HTTP service with FastAPI: typed routes, Pydantic validation, batch scoring, auth, containers, and Locust load tests.
📄️ 1. Routes, types and docs
Module 1 of the FastAPI for ML premium course: build a minimal HTTP service, wire GET and POST routes, use type hints, and read the generated OpenAPI docs.
📄️ 2. Pydantic validation
Module 2 of the FastAPI for ML premium course: model request and response payloads with Pydantic, add constraints, defaults and examples, and read 422 errors.
📄️ 3. Loading the model at startup
Module 3 of the FastAPI for ML premium course: load the model once with lifespan, expose its version, and fail fast on startup rather than on the first request.
📄️ 4. Single and batch prediction
Module 4 of the FastAPI for ML premium course: expose a single-row route and a vectorized batch route, cap batch size, and share preprocessing with training.
📄️ 5. Error handling and status codes
Module 5 of the FastAPI for ML premium course: distinguish 400, 422 and 500, raise HTTPException correctly, add exception handlers, and never leak a traceback.
📄️ 6. Async and background tasks
Module 6 of the FastAPI for ML premium course: when async helps and when it hurts, run blocking models in a thread pool, and offload file scoring to background tasks.
📄️ 7. Token authentication
Module 7 of the FastAPI for ML premium course: protect routes with an API key header, add a security dependency, preview JWTs, and rotate keys with rate limiting.
📄️ 8. Logging and health probes
Module 8 of the FastAPI for ML premium course: emit structured logs with a request ID, expose liveness and readiness probes, track latency and errors, preview Prometheus.
📄️ 9. Containerization and deployment
Module 9 of the FastAPI for ML premium course: write a multi-stage Dockerfile, keep the image small and non-root, tune workers, and deploy behind a load balancer.
📄️ 10. Load testing and sizing
Module 10 of the FastAPI for ML premium course: write a Locust scenario against the churn API, read percentiles, find the real bottleneck, and size workers and replicas.
📄️ 11. Recap and exam
Module 11 of the FastAPI for ML premium course: a production checklist for a model API, a smoke script that validates every module, and the 40-question exam.