FastAPI is a Python framework for building web APIs, based on type annotations. Pydantic defines the data schemas there: inputs are automatically converted and validated, and interactive documentation is generated. This pair is widely used to serve machine learning models.
Example
from pydantic import BaseModel
class Client(BaseModel):
age: int
revenu: float