> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ariacompute.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ROUTER decision routing

ROUTER decision routing is Aria Compute’s unified inference-gateway product. A set of **decision layers** routes each request: **semantic** (YAML v0.3) handles chat routing, the **lightweight agent** runs an in-process tool loop, and **afm-d** calls System One Choice through aria-engine. Each request then forwards to shared providers under hard constraints. One request uses **exactly one** layer. The gateway data plane implements the standard OpenAI `/v1/chat/completions` and `/v1/models` endpoints, so existing SDKs work unchanged.

## Decision layers

ROUTER routes requests across several parallel decision layers. The routing result (layer, decision, model) comes back in response headers:

| Layer | Meaning | Entrypoint example |
| - | - | - |
| **Semantic** | Matches chat requests against a YAML v0.3 recipe using routing signals | `ariacompute/semantic-auto` |
| **Lightweight Agent** | In-process fixed tools + limited-turns tool loop | `ariacompute/agent-auto` |
| **afm-d** | System One Choice selection via [aria-engine](https://docs.ariacompute.com/sdks/engine-runtime.md) | `ariacompute/afm-d-auto` |

## Routing config (YAML v0.3)

You declare entrypoints, providers, and routing rules in a YAML v0.3 config that ROUTER reloads dynamically. The config blocks:

| Block | Meaning |
| - | - |
| `listeners` | Data-plane bind |
| `providers` | Models / `backend_refs` |
| `entrypoints` | Virtual model → `router: semantic\|agent\|afm-d` + `recipe` |
| `recipes` | Semantic `routing.*`, agent `agent.*`, afm-d `afm-d.*` |
| `global` | Auth / keys paths (optional) |

## Gold entrypoints

Common virtual entrypoints ship with built-in recipes:

* `ariacompute/semantic-auto`
* `ariacompute/agent-auto`
* `ariacompute/afm-d-auto`

The **afm-d** layer needs `AFM_ENGINE_URL` pointing at a running [aria-engine](https://docs.ariacompute.com/sdks/engine-runtime.md). The layer and decision come back in `x-aria-router-*` response headers.

```bash theme={null}
curl -s http://127.0.0.1:8899/v1/chat/completions \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer sk-aria_your_router_api_key' \
  -d '{
    "model": "ariacompute/semantic-auto",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

## Constraints and governance

Shared provider models and hard constraints (cost, latency, capability) are evaluated at request time. The management plane covers authentication, routing configuration, cost tracking, and key management under `/v1/router/*`; `AFM_ENGINE_URL` can wire afm-d into System One.

## How to run

* **[ROUTER Runtime](https://docs.ariacompute.com/sdks/router-runtime.md)** — self-host `aria-router` CLI / FFI; data plane defaults to `--bind 127.0.0.1:8899`, management plane `--mgmt-bind 127.0.0.1:8090`.
* **[AGENT Runtime](https://docs.ariacompute.com/sdks/agent-runtime.md)** — for tool use and planning scaffolding only, see `aria-agent`.
* Related: [ROUTER introduction](https://docs.ariacompute.com/api-reference/router/introduction.md), [AFM foundation models](https://docs.ariacompute.com/concepts/models.md).

## See also

* [Playground experience](https://docs.ariacompute.com/guides/playground.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.