> 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. |

### 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)

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

### API

```python
class nemo_automodel.components.speculative.dspark.registry.DraftSpec(
    draft_cls: type[transformers.PreTrainedModel]
)
```

Dataclass

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

```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')
```

```python
nemo_automodel.components.speculative.dspark.registry.__all__ = ['DraftSpec', 'DSPARK_DRAFT_REGISTRY', 'resolve_dspark_draft_spec', 'build_targe...
```