> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://docs.nvidia.com/dynamo/llms.txt. For full content including API reference and SDK examples, see https://docs.nvidia.com/dynamo/llms-full.txt.

# dynamo.router

`dynamo.router` publishes 3 classes and 4 functions. Source: [`components/src/dynamo/router/__init__.py`](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/__init__.py)

#### DynamoRouterArgGroup (class)

CLI argument group for standalone router options.

```python
from dynamo.router.args import DynamoRouterArgGroup
```

[`components/src/dynamo/router/args.py#L79`](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/args.py#L79)

**Public methods**

<h4 id="api-dynamo-router-args-dynamorouterarggroup-add-arguments">
  add_arguments
</h4>

```python
add_arguments(parser) -> None
```

Add router-owned arguments to parser.

[source](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/args.py#L84)

#### DynamoRouterConfig (class)

Typed configuration for the standalone KV router (router-owned options only).

```python
from dynamo.router.args import DynamoRouterConfig
```

[`components/src/dynamo/router/args.py#L24`](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/args.py#L24)

**Public methods**

<h4 id="api-dynamo-router-args-dynamorouterconfig-validate">
  validate
</h4>

```python
validate() -> None
```

Validate config invariants (aligned with Rust KvRouterConfig where applicable).

[source](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/args.py#L32)

#### DynamoRouterSweepConfigProvider (class)

Router search-space preparation and replay-spec materialization.

```python
from dynamo.router.simulation import DynamoRouterSweepConfigProvider
```

[`components/src/dynamo/router/simulation/provider.py#L117`](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/simulation/provider.py#L117)

**Public methods**

<h4 id="api-dynamo-router-simulation-provider-dynamoroutersweepconfigprovider-generate-search-space">
  generate_search_space
</h4>

```python
generate_search_space(search_spec: Mapping[str, JSONValue], context: SweepContext) -> AdapterSearchPlan
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/simulation/provider.py#L124)

<h4 id="api-dynamo-router-simulation-provider-dynamoroutersweepconfigprovider-materialize-replay">
  materialize_replay
</h4>

```python
materialize_replay(plan: AdapterSearchPlan, selection: Mapping[str, JSONValue], context: CandidateContext) -> AdapterReplaySpec
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/simulation/provider.py#L150)

#### build\_aic\_perf\_config (function)

No summary available.

```python
from dynamo.router.args import build_aic_perf_config
```

```python
build_aic_perf_config(router_config: DynamoRouterConfig) -> AicPerfConfig | None
```

[`components/src/dynamo/router/args.py#L126`](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/args.py#L126)

#### build\_kv\_router\_config (function)

Build KvRouterConfig from DynamoRouterConfig.

```python
from dynamo.router.args import build_kv_router_config
```

```python
build_kv_router_config(router_config: DynamoRouterConfig) -> KvRouterConfig
```

[`components/src/dynamo/router/args.py#L121`](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/args.py#L121)

#### create\_provider (function)

Create the entry-point registered Router sweep configuration provider.

```python
from dynamo.router.simulation import create_provider
```

```python
create_provider() -> DynamoRouterSweepConfigProvider
```

[`components/src/dynamo/router/simulation/provider.py#L191`](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/simulation/provider.py#L191)

#### parse\_args (function)

Parse command-line arguments for the standalone router.

```python
from dynamo.router.args import parse_args
```

```python
parse_args(argv: Optional[list[str]] = None) -> DynamoRouterConfig
```

**Returns**

* `DynamoRouterConfig` — Parsed and validated configuration.

[`components/src/dynamo/router/args.py#L134`](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/router/args.py#L134)