The standalone runtime is the recommended way to ship an Idun agent (chat UI, admin panel, traces viewer, hot reload, SSO, all in one process). When you already have a FastAPI service and just want the engine’s agent routes inside it, or when you want to boot the engine from Python withoutDocumentation Index
Fetch the complete documentation index at: https://docs.idun-group.com/llms.txt
Use this file to discover all available pages before exploring further.
idun init, drop down to the SDK below.
Public API
idun_agent_engine exports its surface from the package root:
libs/idun_agent_engine/src/idun_agent_engine/__init__.py.
Boot the engine from Python
The lowest-friction path isrun_server_from_config. It loads config.yaml, builds the FastAPI app, and starts uvicorn in one call. The port comes from server.api.port in the config unless you override.
run_server_from_config accepts every kwarg run_server does (host, port, reload, log_level, workers). It blocks until uvicorn exits.
For programmatic configuration, swap the YAML for a ConfigBuilder:
ConfigBuilder validates each section as it is added; .build() returns a fully validated EngineConfig you can also pass directly to create_app(engine_config=...).
Embed the engine into an existing FastAPI app
create_app(...) returns a regular FastAPI instance with the agent routers (/agent/run, /agent/stream, /agent/sessions, /agent/capabilities, the deprecated /agent/invoke) and the base routes (/health, /reload, /_engine/info, /openapi.json) already attached. Mount that into your existing app:
POST /idun/agent/run hits the engine’s AG-UI streaming endpoint and GET /idun/health returns the engine’s health payload. Your own routes at /billing/* keep working.
Three things to know when embedding:
- CORS.
create_appadds wide-open CORS middleware to the engine’s app (allow_origins=["*"]). Mount it inside a parent that owns CORS for the rest of your surface, otherwise the engine’s permissive middleware applies to every embedded route. POST /reload. Passreload_auth=...tocreate_appto gate it behind a FastAPI dependency. Without that, the route is unauthenticated. The standalone runtime injects its ownreload_disabledcallable here. Reference: Architecture / Reload auth.- Lifespan. The engine ships its own
lifespancontext manager. When you mount it into a parent FastAPI app, FastAPI runs the mounted app’s lifespan automatically; you do not need to wire it manually.
Unconfigured boot
create_app() with no config (no config_path, no config_dict, no engine_config, no ./config.yaml in cwd) boots in unconfigured mode: every route is registered, but /agent/* returns 503 agent_not_ready until you supply a config. Embedders use this to start the process before they know which agent to serve, then call the engine’s reload pipeline once the config is ready.
The standalone runtime uses this shape during the first-run wizard.
Run the server explicitly
When you have anengine_config in hand and want full control over the uvicorn lifecycle, build the app first and call run_server separately:
run_server is a thin wrapper around uvicorn.run with sensible defaults. Skip it entirely if you already run uvicorn (or Gunicorn, or Hypercorn) yourself; create_app returns a FastAPI you can hand to any ASGI server.
Source pointers
| Concern | File |
|---|---|
| Public exports | libs/idun_agent_engine/src/idun_agent_engine/__init__.py |
create_app | core/app_factory.py |
run_server, run_server_from_config, run_server_from_builder | core/server_runner.py |
ConfigBuilder | core/config_builder.py |
| Lifespan | server/lifespan.py |
Next steps
Programmatic chat: /agent/run contract
The HTTP shape the chat UI uses, including AG-UI request body and SSE events.
Custom adapter
Implement
BaseAgent for a framework Idun does not bundle yet.Standalone admin and reload
How the standalone runtime hot-reloads on top of these same primitives.