> 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.
> 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.models.clef.export

Merge CLEF adapters and typed heads into the publisher's release layout.

## Module Contents

### Functions

| Name                                                                             | Description                                                                    |
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [`export_release`](#nemo_automodel-components-models-clef-export-export_release) | Write the trained CLEF release, preserving the publisher's loader and license. |
| [`merge_lora_`](#nemo_automodel-components-models-clef-export-merge_lora_)       | Merge LoRA pairs into `state_dict` in place.                                   |

### Data

[`logger`](#nemo_automodel-components-models-clef-export-logger)

### API

```python
nemo_automodel.components.models.clef.export.export_release(
    base: str | pathlib.Path,
    revision: str,
    stage: pathlib.Path,
    out: pathlib.Path
) -> None
```

Write the trained CLEF release, preserving the publisher's loader and license.

**Parameters:**

**`base`** `str | Path`

Hub repository ID or existing local base release directory.

---

**`revision`** `str`

Immutable Hub commit ID for remote model files.

---

**`stage`** `Path`

Published native CLEF stage containing DCP head state and optional native PEFT model weights.

---

**`out`** `Path`

Destination for the merged release.

---

```python
nemo_automodel.components.models.clef.export.merge_lora_(
    state_dict: dict[str, torch.Tensor],
    adapter: dict[str, torch.Tensor],
    scale: float
) -> int
```

Merge LoRA pairs into `state_dict` in place.

**Parameters:**

**`state_dict`** `dict[str, torch.Tensor]`

Base weights by HF name; `&lt;module&gt;.weight` tensors have shape \[out_features, in_features].

---

**`adapter`** `dict[str, torch.Tensor]`

`&lt;module&gt;.lora_A.weight` of shape \[rank, in_features] and `&lt;module&gt;.lora_B.weight` of shape
\[out_features, rank].

---

**`scale`** `float`

LoRA scaling `alpha / dim`.

---

**Returns:** `int`

Number of merged modules.

**Raises:**

* `KeyError`: If an adapter module has no matching base weight.

```python
nemo_automodel.components.models.clef.export.logger = logging.getLogger(__name__)
```