> This page is for version Nightly (default).
> 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.7.0 · 26.10: https://docs.nvidia.com/nemo/automodel/v0.7/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.

# nemo_automodel.components.models.nemotron_decision.export

Export a trained Nemotron Decision stage (merged LoRA adapter or full weights) as a complete, servable checkpoint.

## Module Contents

### Functions

| Name                                                                                                          | Description                                                                                                  |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [`checkpoint_fingerprint`](#nemo_automodel-components-models-nemotron_decision-export-checkpoint_fingerprint) | SHA-256 over the configuration, the decision contract files and every `*.safetensors` shard of a checkpoint. |
| [`export_full_checkpoint`](#nemo_automodel-components-models-nemotron_decision-export-export_full_checkpoint) | Write a complete checkpoint from consolidated backbone fine-tuning weights, cast to the base dtypes.         |
| [`merge_lora_checkpoint`](#nemo_automodel-components-models-nemotron_decision-export-merge_lora_checkpoint)   | Merge a PEFT LoRA adapter into the base weights and write a complete checkpoint.                             |

### Data

[`_FINGERPRINTED`](#nemo_automodel-components-models-nemotron_decision-export-_FINGERPRINTED)

[`_NOT_COPIED`](#nemo_automodel-components-models-nemotron_decision-export-_NOT_COPIED)

### API

```python
nemo_automodel.components.models.nemotron_decision.export.checkpoint_fingerprint(
    checkpoint_dir: str | pathlib.Path,
    chunk_size: int = 1 << 24
) -> str
```

SHA-256 over the configuration, the decision contract files and every `*.safetensors` shard of a checkpoint.

Covers `config.json`, `decision.json` and `decision_template.jinja` (each when present) and reads every
weight byte, so a base whose interior weights or decision prompt differ (for example, an ordinary fine-tune of the
same architecture) gets a different fingerprint.

**Parameters:**

**`checkpoint_dir`** `str | Path`

Local checkpoint directory.

---

**`chunk_size`** `int` — default: 1 \<\< 24

Bytes read per step.

---

**Returns:** `str`

Hex digest.

**Raises:**

* `FileNotFoundError`: If the directory has no `*.safetensors` shard.

```python
nemo_automodel.components.models.nemotron_decision.export.export_full_checkpoint(
    base_dir: str | pathlib.Path,
    weights_dir: str | pathlib.Path,
    output_dir: str | pathlib.Path
) -> dict
```

Write a complete checkpoint from consolidated backbone fine-tuning weights, cast to the base dtypes.

**Parameters:**

**`base_dir`** `str | Path`

Checkpoint the run started from (configuration, tokenizer and model code are copied from it).

---

**`weights_dir`** `str | Path`

Directory of consolidated `*.safetensors` weights of the trained model.

---

**`output_dir`** `str | Path`

New directory (must not exist).

---

**Returns:** `dict`

Receipt `&#123;"base", "weights", "tensors"&#125;` (also written as `export-receipt.json`).

**Raises:**

* `ValueError`: If the trained tensor names or shapes differ from the base.
* `FileExistsError`: If `output_dir` exists.

```python
nemo_automodel.components.models.nemotron_decision.export.merge_lora_checkpoint(
    base_dir: str | pathlib.Path,
    adapter_dir: str | pathlib.Path,
    output_dir: str | pathlib.Path
) -> dict
```

Merge a PEFT LoRA adapter into the base weights and write a complete checkpoint.

**Parameters:**

**`base_dir`** `str | Path`

Checkpoint the adapter was trained on.

---

**`adapter_dir`** `str | Path`

Directory with `adapter_config.json` and `adapter_model.safetensors`.

---

**`output_dir`** `str | Path`

New directory (must not exist).

---

**Returns:** `dict`

Receipt `&#123;"base", "adapter", "lora_modules", "r", "alpha", "scale"&#125;` (also written as `merge-receipt.json`).

**Raises:**

* `ValueError`: For DoRA/rank-pattern adapters, adapter weights missing from the base, or shape mismatch.
* `FileExistsError`: If `output_dir` exists.

```python
nemo_automodel.components.models.nemotron_decision.export._FINGERPRINTED = ('config.json', DECISION_CONFIG_FILE, DECISION_TEMPLATE_FILE)
```

```python
nemo_automodel.components.models.nemotron_decision.export._NOT_COPIED = ('*.safetensors', '*.safetensors.index.json', '.cache', 'merge-receipt.json', 'e...
```