INNER CODE UNIT · Python

lifespan

SearchSavior/OpenArc · src/server/main.py:51

async def lifespan(app: FastAPI):
    # Let OPENARC_STARTUP_MODELS (exported by `openarc serve start`) win over the
    # config file's startup_models key.
    models = os.getenv("OPENARC_STARTUP_MODELS", "").strip()
    if not models:
        from src.cli.modules.server_config import ServerConfig

        configured = ServerConfig().load_config().get("startup_models") or ""
        models = configured.strip() if isinstance(configured, str) else ""

    if models:
        from pathlib import Path

        from src.cli.modules.server_config import ServerConfig

        # All config parsing, env interpolation and relative-path resolution
        # happens inside ServerConfig so startup and the CLI share one loader.
        server_config = ServerConfig()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…