APIs, Containers & Deployment
Make your AI component usable as a service. Build a validated API, test it, containerize it, and deploy it to an agreed environment.

Build an API
Validate inputs and outputs and handle errors.
Package your service
Build and run a reproducible container.
Deliver working software
Automate tests and demonstrate a deployed service.
APIs, Containers, and Deployment
make your AI component usable as a service.
Before you start: Software Engineering for AI and Systems, Networking & Data, plus a working inference function from applied ML, deep learning, or LLM Applications.
Learn
- FastAPI routes, Pydantic request/response models, validation, error responses, and basic CORS.
- Load reusable model resources efficiently; use current FastAPI lifecycle guidance.
- Separate inference logic from HTTP handling; test both.
- Build a Docker image, configure runtime values, and run the service locally.
- Automate tests in a basic workflow, deploy to an assigned environment, and inspect health and logs.
Resources
APIs Explained in 6 Minutes
Required. Introductory API concepts.
How to Use FastAPI: A Detailed Python Tutorial
Required. Use it for the first app and endpoint examples. Check current documentation for implementation details.
FastAPI: Tutorial — User Guide
Required. Select request bodies, response models, error handling, testing, and deployment sections.
Docker 101 Tutorial
Required. Complete the runnable tutorial, then adapt it to your own service.
GitHub Actions: Building and testing Python
Required. Automate your tests on a push or pull request. Prior Engineering Fundamentals GitHub Actions practice can be reused and extended.
HTML, CSS, and JavaScript in 30 minutes
Further reading. For a small browser client.
Learn DOM Manipulation in 18 Minutes
Further reading. For displaying API results in that client.
Practice
- Expose your model or LLM feature through a validated endpoint and provide example requests.
- Test a valid request, an invalid input, and an inference failure; add a basic health endpoint.
- Build and run a Docker image; verify configuration and logs from a fresh run.
- Add an automated test workflow and deploy the service. Use a small browser client or command-line client to demonstrate it.
Expected output
A deployed service, a Dockerfile, passing tests, an automated test workflow, and setup/use instructions. Include model or LLM evaluation results separately from software test results. Deployment may use Academy infrastructure or an agreed hosted environment.
Workload
Use the provisional estimates where supplied. Other workloads remain pending pilot. Include implementation, debugging, review, and revision.
Finish this module
Keep the required outputs and explain your decisions. Diagnose a relevant failure during review and revise incomplete evidence after feedback. Resource completion supports progress; the stated practical requirements determine completion.
