FastAPI Basics for ML Engineers
FastAPI app, GET/POST endpoints, path and query params, async def vs def for ML inference.
Why FastAPI for ML?
FastAPI is a modern Python web framework ideal for serving models: it is fast, auto-generates interactive docs, and validates requests with type hints. It has become the default way to wrap a model behind an HTTP API.
Creating the App
Instantiate a FastAPI application; this app object holds all your routes.
from fastapi import FastAPI
app = FastAPI(title="Model Serving API")All lessons in this course
- FastAPI Basics for ML Engineers
- Pydantic Schemas for Request and Response
- Loading and Serving ML Models
- Dockerizing the Model API