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

Shared DSpark target-identification and tokenization helpers.

## Module Contents

### Functions

| Name                                                                                                                  | Description                                                                      |
| --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [`apply_target_chat_template`](#nemo_automodel-components-speculative-dspark-target_utils-apply_target_chat_template) | Attach or validate the chat template used to tokenize messages-format data.      |
| [`read_target_model_type`](#nemo_automodel-components-speculative-dspark-target_utils-read_target_model_type)         | Return the target HF `model_type` without instantiating the model when possible. |

### Data

[`DEEPSEEK_V4_MODEL_TYPE`](#nemo_automodel-components-speculative-dspark-target_utils-DEEPSEEK_V4_MODEL_TYPE)

[`GEMMA4_MODEL_TYPES`](#nemo_automodel-components-speculative-dspark-target_utils-GEMMA4_MODEL_TYPES)

[`GLM_5_2_MODEL_TYPE`](#nemo_automodel-components-speculative-dspark-target_utils-GLM_5_2_MODEL_TYPE)

[`MINIMAX_M3_MODEL_TYPES`](#nemo_automodel-components-speculative-dspark-target_utils-MINIMAX_M3_MODEL_TYPES)

### API

```python
nemo_automodel.components.speculative.dspark.target_utils.apply_target_chat_template(
    tokenizer,
    chat_template
) -> None
```

Attach or validate the chat template used to tokenize messages-format data.

```python
nemo_automodel.components.speculative.dspark.target_utils.read_target_model_type(
    target_path: str,
    trust_remote_code: bool
) -> str
```

Return the target HF `model_type` without instantiating the model when possible.

```python
nemo_automodel.components.speculative.dspark.target_utils.DEEPSEEK_V4_MODEL_TYPE = 'deepseek_v4'
```

```python
nemo_automodel.components.speculative.dspark.target_utils.GEMMA4_MODEL_TYPES = ('gemma4', 'gemma4_unified')
```

```python
nemo_automodel.components.speculative.dspark.target_utils.GLM_5_2_MODEL_TYPE = 'glm_moe_dsa'
```

```python
nemo_automodel.components.speculative.dspark.target_utils.MINIMAX_M3_MODEL_TYPES = ('minimax_m3_vl',)
```