Serving: FastAPI & Docker
Deploying your agent as a production-ready API.
Notebooks are great for development, but for production, you need a server. We provide a template usage of FastAPI to wrap your agent logic and Docker to containerize it.
Key Concepts
- FastAPI: Modern, fast (high-performance) web framework for building APIs with Python.
- Docker: Platform to use OS-level virtualization to deliver software in packages called containers.
- Health Check: Endpoint to verify if the service is running correctly.
Project Code
The code for this session is located in the week4_production/serving_api directory.
main.py: The application logic.Dockerfile: The container definition.