Skip to content

App

latent_space.app

create_app(settings=None)

Build and configure the FastAPI application.

Constructing the app inside a factory (rather than at import time) keeps settings loading and router inclusion out of import side effects and lets tests build an app with injected settings. Run with Uvicorn's --factory flag so app creation happens on call, not on import.

Parameters:

Name Type Description Default
settings AppSettings | None

Application settings to use. Defaults to the process-wide cached settings when omitted.

None

Returns:

Type Description
FastAPI

The configured FastAPI application, with CORS and routers included.