Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,8 @@ Use `--router-queue-policy wspt` when your workload has a mix of short and long
## Runtime Policy Updates

**Experimental.** `/router_policy` groups worker-selection parameters and model-level busy
thresholds on the frontend HTTP port (8000 by default).
thresholds on the frontend admin port (`127.0.0.1:8002` by default), which is off unless
`DYN_ENABLE_FRONTEND_ADMIN_API=1` is set.
Comment thread
jthomson04 marked this conversation as resolved.
Resolved

| Resource | Methods | Scope |
| --- | --- | --- |
Expand All @@ -611,7 +612,7 @@ Routers that have stopped or do not respond within five seconds are omitted; hea
remain available in the listing.

```bash
curl --get http://localhost:8000/router_policy --data-urlencode model=qwen
curl --get http://localhost:8002/router_policy --data-urlencode model=qwen
```

Use a returned `router_id` and revision in `PATCH /router_policy`:
Expand Down Expand Up @@ -672,7 +673,7 @@ resets use these effective values; host-owned cache accounting settings are unch
one or more threshold fields with `POST /router_policy/busy_threshold` to update them:

```bash
curl -X POST http://localhost:8000/router_policy/busy_threshold \
curl -X POST http://localhost:8002/router_policy/busy_threshold \
-H 'Content-Type: application/json' \
-d '{"model":"qwen","active_decode_blocks_threshold":0.85,"active_prefill_tokens_threshold":1000,"active_prefill_tokens_threshold_frac":0.8}'
```
Expand All @@ -695,10 +696,10 @@ reset. Updating thresholds and selection parameters is not one atomic transactio

### Scope and Access

The frontend admin API remains enabled by default on the HTTP port, with no separate admin
authentication. `DYN_DISABLE_FRONTEND_ADMIN_API=1` disables `/router_policy`, its busy-threshold
subresource, and the legacy `/busy_threshold` routes. Restrict access to these management
routes at the deployment's gateway or network boundary.
The admin listener has no authentication and is never served on the inference port. If you
widen its bind address with `DYN_FRONTEND_ADMIN_HOST`, restrict the admin port at the network
boundary. See [Admin](../../../../reference/components/frontend-configuration.mdx#admin) for the
listener settings.

Updates are process-local and not persisted. A rebuilt router receives a new ID and starts
from its configured startup values. A controller must address each frontend replica directly,
Comment thread
jthomson04 marked this conversation as resolved.
Resolved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ Backend KV event publishing is independent of the frontend's `--no-router-kv-eve

The CLI arg `--router-ttl-secs` controls local cache prediction lifetime when the router operates without receiving events from workers and the approximate cache policy is `ttl`. The experimental `lru` policy is local to one router replica and does not synchronize releases with other replicas. A missing or zero per-rank `total_kv_blocks` value clears that rank's LRU state and pins it to TTL until the worker rank is removed and re-registered. When workers publish KV events and the router is configured to consume them, the exact event index becomes primary and the selected approximate primary policy is inactive. An explicitly configured predicted side index remains active and is always TTL-based. Worker publication alone does not disable approximate indexing.

`--router-queue-threshold` and the busy thresholds (`--active-decode-blocks-threshold`, `--active-prefill-tokens-threshold`, `--active-prefill-tokens-threshold-frac`) serve different purposes. Busy thresholds reject a worker entirely from the candidate set when it exceeds a utilization limit. In contrast, `--router-queue-threshold` defers the entire routing decision while every eligible worker exceeds `threshold * max_num_batched_tokens`, so the request is routed with the freshest load metrics once capacity is available. `nvext.agent_hints.strict_priority` selects the primary pending-queue tier, and `nvext.agent_hints.priority` adjusts the configured policy score within that tier. The busy thresholds can be updated at runtime without restarting the frontend via the `/busy_threshold` HTTP endpoint. For the eligibility and backpressure distinction, see [Router Filtering](worker-filtering.md). For rejection behavior details, see [Request Rejection](../../../../kubernetes/fault-tolerance/request-rejection.md) and [Priority Scheduling](../../../../use-cases/agents/priority-scheduling.md).
`--router-queue-threshold` and the busy thresholds (`--active-decode-blocks-threshold`, `--active-prefill-tokens-threshold`, `--active-prefill-tokens-threshold-frac`) serve different purposes. Busy thresholds reject a worker entirely from the candidate set when it exceeds a utilization limit. In contrast, `--router-queue-threshold` defers the entire routing decision while every eligible worker exceeds `threshold * max_num_batched_tokens`, so the request is routed with the freshest load metrics once capacity is available. `nvext.agent_hints.strict_priority` selects the primary pending-queue tier, and `nvext.agent_hints.priority` adjusts the configured policy score within that tier. The busy thresholds can be updated at runtime without restarting the frontend via the [`/busy_threshold` admin endpoint](../../../../reference/components/frontend-configuration.mdx#admin). For the eligibility and backpressure distinction, see [Router Filtering](worker-filtering.md). For rejection behavior details, see [Request Rejection](../../../../kubernetes/fault-tolerance/request-rejection.md) and [Priority Scheduling](../../../../use-cases/agents/priority-scheduling.md).
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Busy thresholds are worker filters. They are configured separately from the queu
- `--active-prefill-tokens-threshold`
- `--active-prefill-tokens-threshold-frac`

When a threshold is exceeded, worker monitoring reports that worker as overloaded. The scheduler then excludes that worker from normal candidate selection. The thresholds can be updated at runtime through the `/busy_threshold` HTTP endpoint.
When a threshold is exceeded, worker monitoring reports that worker as overloaded. The scheduler then excludes that worker from normal candidate selection. The thresholds can be updated at runtime through the [`/busy_threshold` admin endpoint](../../../../reference/components/frontend-configuration.mdx#admin).

Busy filtering preserves error classification:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ reachable.
workers. This drops `request.nvext` at handler entry and ignores the
routing-override headers.
- **Admin API.** The frontend's HTTP admin API (for example,
`GET`/`POST /busy_threshold`) is enabled by default. If the deployer does not need to
change runtime tunables through it, set `DYN_DISABLE_FRONTEND_ADMIN_API=1`.
Inference, metrics, models, health, and liveness routes are unaffected.
`GET`/`POST /busy_threshold`) is disabled by default. `DYN_ENABLE_FRONTEND_ADMIN_API=1`
Comment thread
jthomson04 marked this conversation as resolved.
Resolved
starts it on its own listener, bound to `127.0.0.1:8002` and never served on the
inference port. It has no authentication. If you widen the bind with
`DYN_FRONTEND_ADMIN_HOST`, restrict the admin port to trusted operators with a network
policy or firewall.
- **Metrics endpoint.** The `/metrics` endpoint is intended for scraping by
trusted monitoring systems; scope it to your observability stack rather than
exposing it to untrusted networks.
Expand Down
17 changes: 11 additions & 6 deletions docs/fern/pages/kubernetes/fault-tolerance/request-rejection.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,22 @@ for the complete flag, environment-variable, and validation reference.
<Step title="Adjust thresholds at runtime">

Optional. Use the Frontend admin API to change thresholds for a discovered model without redeploying.
The API is available by default. Set `DYN_DISABLE_FRONTEND_ADMIN_API` to a truthy value to turn it
off, which unregisters both `busy_threshold` routes so they return 404.
The API is off by default. Set `DYN_ENABLE_FRONTEND_ADMIN_API=1` in the Frontend's environment to
Comment thread
jthomson04 marked this conversation as resolved.
Resolved
serve it on a separate admin port, bound to `127.0.0.1:8002` inside each Frontend pod; the inference
port does not serve it. Updates apply to one Frontend process, so port-forward to each Frontend pod
you want to change.

```bash
kubectl port-forward svc/<deployment-name>-frontend 8000:8000 -n ${NAMESPACE}
FRONTEND_POD=$(kubectl get pods -n ${NAMESPACE} \
-l nvidia.com/dynamo-graph-deployment-name=<deployment-name>,nvidia.com/dynamo-component-type=frontend \
-o jsonpath='{.items[0].metadata.name}')
Comment thread
jthomson04 marked this conversation as resolved.
Resolved
kubectl port-forward pod/${FRONTEND_POD} 8000:8000 8002:8002 -n ${NAMESPACE}
```

Set one or more thresholds:

```bash
curl -X POST http://localhost:8000/busy_threshold \
curl -X POST http://localhost:8002/busy_threshold \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen/Qwen3-0.6B",
Expand All @@ -105,7 +110,7 @@ curl -X POST http://localhost:8000/busy_threshold \
Read the stored thresholds:

```bash
curl http://localhost:8000/busy_threshold
curl http://localhost:8002/busy_threshold
```

A numeric value enables only its corresponding check. The router applies the new configuration when
Expand All @@ -120,7 +125,7 @@ decision immediately. This endpoint does not enable `--router-mode kv` or
Inspect the configured thresholds and worker-load metrics:

```bash
curl -s http://localhost:8000/busy_threshold
curl -s http://localhost:8002/busy_threshold
curl -s http://localhost:8000/metrics \
| grep -E 'dynamo_frontend_worker_active_(decode_blocks|prefill_tokens)'
```
Expand Down
34 changes: 27 additions & 7 deletions docs/fern/pages/reference/components/frontend-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,33 @@ accepted fields, limits, errors, and rolling upgrades.
| `GET` | `/metrics` | Prometheus metrics |
| `GET` | `/openapi.json` | OpenAPI specification |
Comment thread
jthomson04 marked this conversation as resolved.
Resolved
| `GET` | `/docs` | Swagger UI |
| `POST` | `/busy_threshold` | Set independently enabled busy thresholds for a discovered model (disabled when `DYN_DISABLE_FRONTEND_ADMIN_API` is truthy) |
| `GET` | `/busy_threshold` | Get stored busy thresholds (disabled when `DYN_DISABLE_FRONTEND_ADMIN_API` is truthy) |

### Admin

Admin routes are off by default, have no authentication, and are served on a separate listener,
not the inference port.
Comment thread
jthomson04 marked this conversation as resolved.
Resolved

| Method | Path | Description |
|--------|------|-------------|
| `GET`, `PATCH` | `/router_policy` | Get or update worker-selection parameters of a router instance |
| `GET`, `POST` | `/router_policy/busy_threshold` | Get or set busy thresholds for a discovered model |
| `POST` | `/busy_threshold` | Set independently enabled busy thresholds for a discovered model |
| `GET` | `/busy_threshold` | Get stored busy thresholds |

<ParamField path="DYN_ENABLE_FRONTEND_ADMIN_API" type="boolean" default="false">
When truthy (`1`, `true`, `yes`, or `on`), the frontend starts the admin listener and serves the
routes above.
</ParamField>

<ParamField path="DYN_FRONTEND_ADMIN_HOST" type="string" default="127.0.0.1">
Address the admin listener binds to. If you widen it, restrict the admin port at the network
boundary.
</ParamField>

<ParamField path="DYN_FRONTEND_ADMIN_PORT" type="integer" default="8002">
Comment thread
jthomson04 marked this conversation as resolved.
Resolved
Port of the admin listener. When the admin API is enabled and the port cannot be bound, the
frontend fails to start.
</ParamField>

`POST /busy_threshold` accepts `model` plus any of `active_decode_blocks_threshold`,
`active_prefill_tokens_threshold`, and `active_prefill_tokens_threshold_frac`. A numeric field enables
Expand Down Expand Up @@ -908,11 +933,6 @@ are disabled by default. Truthy values are `1`, `true`, `yes`, or `on`, case-ins
these endpoints do not use `x-tenant-id` or `x-dynamo-*` routing headers in either mode.
</ParamField>

<ParamField path="DYN_DISABLE_FRONTEND_ADMIN_API" type="boolean" default="false">
When truthy, `GET /busy_threshold` and `POST /busy_threshold` are not registered and return 404.
Inference, metrics, models, health, and liveness routes are unaffected.
</ParamField>

### Endpoint path customization

All endpoint paths can be overridden via environment variables:
Expand Down
1 change: 1 addition & 0 deletions lib/llm/src/bin/generate_frontend_openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ fn generate_openapi() -> anyhow::Result<()> {
.enable_responses_endpoints(true)
.enable_anthropic_endpoints(true)
.enable_batch_endpoints(true)
.enable_admin_api(true)
.build()
.context("failed to build HttpService for OpenAPI generation")?;

Expand Down
Loading
Loading