ROUTER is Aria Compute’s OpenAI-compatible inference gateway. One of three parallel decisioners picks the route: semantic (YAML v0.3), a lightweight builtin agent, or afm-d (System One Choice via AFM runtime). The request then forwards to shared providers under hard constraints.
This page covers the self-hosted CLI / FFI. HTTP API details: ROUTER introduction.
Install
Fetch the latest release for your platform from the downloads page.Setup, validate, serve
setup, the default config is under ~/.ariacompute/router.yml. Pass --config to use an example file from the router repository.
If using afm-d: run aria-engine first to provide System One, then use an afm-d recipe or
ariacompute/afm-d-auto- Data plane (
--bind):POST /v1/chat/completions,GET /v1/models - Management plane (
--mgmt-bind): health, validate, providers, topology, dashboard
YAML config
One request uses exactly one entrypoint:
ariacompute/semantic-autoariacompute/agent-autoariacompute/afm-d-auto
AFM_ENGINE_URL (the engine defaults list the encoder and decoder ports). Templates: aria-router setup --template afm-d.
Response headers report the decision, for example:
Quick request
Language bindings
ROUTER ships SDKs for Rust, Python, Go, TypeScript, React Native, Flutter, Swift, and Kotlin, all wrapping one C ABI, plus a CLI and the FFI shared library.Extended SDK surface
On top ofinit / connect / setup / complete / models / last_route / close, all eight SDKs also expose (method names use snake_case / camelCase / PascalCase per language):
setup_status(setupStatus/SetupStatus): read back the in-memorybase_url/token.setup_clear: reset both fields to empty (in-memory only; never writesrouter.yml).complete_stream(completeStream/CompleteStream): delivers the completion as one full-body callback (not per-SSE-chunk), then returns the parsed result.last_route()["headers"](lastRoute()["headers"]): the last decision’s whitelistedx-aria-router-*headers (includingx-aria-router-redecision); auth and cookie headers are never exposed.destroy(closealias): tear down the handle.
last_route fails loudly: an uninitialized handle or a failed request raises/returns an error instead of {}.
Python
When to use aria-router vs aria-engine
- Routing gateway (OpenAI chat + policy):
aria-router - Typed System One decisions only: call aria-engine (or Ollaya) directly