Application
The Vorte class is the entry point for every project. It wraps FastAPI, manages module registration, and provides lifecycle hooks for startup and shutdown orchestration.
Creating an Application
Constructor Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
auto_load | bool | False | Automatically discover and load all modules |
modules | list[str] | None | None | Explicit list of module names to load |
exclude | list[str] | None | None | Module names to skip during auto_load |
config | dict | None | None | Inline configuration dictionary |
config_path | str | None | None | Path to a YAML or JSON config file |
title | str | "Vorte App" | Application title shown in docs and OpenAPI |
version | str | "0.1.0" | Application version |
debug | bool | False | Enable debug mode with verbose logging |
Module Loading Strategies
Auto-Load Everything
Set auto_load=True to scan the modules/ directory and register every discovered module.
Cherry-Pick Modules
Pass an explicit list to load only the modules your service needs. This reduces startup time and memory footprint.
Exclude Specific Modules
Lifecycle Hooks
Vorte provides decorators to register async callbacks that run at application startup and shutdown. Use them to initialize database pools, warm caches, or gracefully close connections.
on_startup
on_shutdown
Hook Priority
Hooks with lower priority numbers execute first. The default priority is 50. Startup hooks run in ascending order; shutdown hooks run in descending order so that the last resource initialized is the first cleaned up.
| Priority | Typical Use |
|---|---|
| 1-10 | Core infrastructure (logging, config validation) |
| 10-30 | Database and cache connections |
| 30-50 | AI model loading, external service clients |
| 50-70 | Default application logic |
| 70-100 | Health check registration, metrics setup |
Built-in Endpoints
Every Vorte application exposes the following endpoints automatically. They can be disabled individually through configuration.
| Endpoint | Method | Description |
|---|---|---|
/health | GET | Returns application health status |
/ready | GET | Returns readiness probe for orchestrators |
/live | GET | Returns liveness probe for orchestrators |
/info | GET | Returns version and module information |
/metrics | GET | Returns Prometheus-compatible metrics |
/dashboard | GET | Serves the Vorte admin dashboard UI |