> This page is for version 0.5.0 · 26.06.
> For other versions, use one of these documentation indexes:
> - Nightly (default): https://docs.nvidia.com/nemo/automodel/nightly/llms.txt
> - Latest: https://docs.nvidia.com/nemo/automodel/latest/llms.txt
> - 0.5.0 · 26.06: https://docs.nvidia.com/nemo/automodel/v0.5/llms.txt
> - 0.4.0 · 26.04: https://docs.nvidia.com/nemo/automodel/v0.4/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/automodel/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/automodel/_mcp/server.

# nemo_automodel.components.speculative.dspark.registry

Dispatch registry mapping a target architecture string to a DSpark draft model.

Mirrors the EAGLE / DFlash registries: keyed by the target's HF `architectures`
string so adding a target family is a one-line append, with no recipe change.

## Module Contents

### Classes

| Name                                                                                                          | Description                                                              |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [`DraftSpec`](#nemo_automodel-components-speculative-dspark-registry-DraftSpec)                               | How to build a DSpark draft model for a particular target architecture.  |
| [`ModelOwnedDSparkProvider`](#nemo_automodel-components-speculative-dspark-registry-ModelOwnedDSparkProvider) | Target config that owns construction of its architecture-specific draft. |

### Functions

| Name                                                                                                            | Description                                                                |
| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [`build_target_layer_ids`](#nemo_automodel-components-speculative-dspark-registry-build_target_layer_ids)       | Evenly spread `num_feature_layers` feature layers across the target depth. |
| [`resolve_dspark_draft_spec`](#nemo_automodel-components-speculative-dspark-registry-resolve_dspark_draft_spec) | Return the first registered DSpark draft spec matching `architectures`.    |

### Data

[`DSPARK_DRAFT_REGISTRY`](#nemo_automodel-components-speculative-dspark-registry-DSPARK_DRAFT_REGISTRY)

[`_DENSE_ARCHITECTURES`](#nemo_automodel-components-speculative-dspark-registry-_DENSE_ARCHITECTURES)

### API

```python
class nemo_automodel.components.speculative.dspark.registry.DraftSpec(
    draft_cls: type[torch.nn.Module]
)
```

Dataclass

How to build a DSpark draft model for a particular target architecture.

**`draft_cls`** `type[Module]`

---

```python
class nemo_automodel.components.speculative.dspark.registry.ModelOwnedDSparkProvider()
```

Protocol

Target config that owns construction of its architecture-specific draft.

```python
nemo_automodel.components.speculative.dspark.registry.ModelOwnedDSparkProvider.build_dspark_draft(
    options: object
) -> torch.nn.Module
```

Build a draft from the generic recipe's declarative options.

```python
nemo_automodel.components.speculative.dspark.registry.build_target_layer_ids(
    num_target_layers: int,
    num_feature_layers: int
) -> list[int]
```

Evenly spread `num_feature_layers` feature layers across the target depth.

Used as the default when `target_layer_ids` is not given. Returns strictly
increasing ids in `[1, num_target_layers - 1]` (the embedding output, id
`-1`/`0`, is excluded by default to match the paper's choice of mid/late
feature layers).

```python
nemo_automodel.components.speculative.dspark.registry.resolve_dspark_draft_spec(
    architectures: list[str]
) -> nemo_automodel.components.speculative.dspark.registry.DraftSpec
```

Return the first registered DSpark draft spec matching `architectures`.

```python
nemo_automodel.components.speculative.dspark.registry.DSPARK_DRAFT_REGISTRY: dict[str, DraftSpec] = {arch: (DraftSpec(draft_cls=Qwen3DSparkModel)) for arch in _DENSE_ARCHITECTURES}
```

```python
nemo_automodel.components.speculative.dspark.registry._DENSE_ARCHITECTURES: tuple[str, ...] = ('Qwen3ForCausalLM', 'Qwen3MoeForCausalLM')
```