Skip to content

Glossary: ML in Production

Lifespan (FastAPI)

Also written: lifespan, asynccontextmanager

Code that runs once when the service starts and stops. The service loads its model there instead of on every request.

Where the book teaches it

Related terms

FastAPIServing