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

State dict adapter for Llama model.

The model uses separate q\_proj / k\_proj / v\_proj / gate\_proj / up\_proj that match
HuggingFace key names exactly, so the adapter is a passthrough (only tied-weight
handling is applied in from\_hf).

## Module Contents

### Classes

| Name                                                                                                        | Description                          |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| [`LlamaStateDictAdapter`](#nemo_automodel-components-models-llama-state_dict_adapter-LlamaStateDictAdapter) | State dict adapter for Llama models. |

### Data

[`logger`](#nemo_automodel-components-models-llama-state_dict_adapter-logger)

### API

```python
class nemo_automodel.components.models.llama.state_dict_adapter.LlamaStateDictAdapter(
    config: transformers.LlamaConfig
)
```

State dict adapter for Llama models.

Uses separate projections that match HuggingFace key names exactly, so
from\_hf / to\_hf are simple passthroughs (only tied-weight handling in
from\_hf).

```python
nemo_automodel.components.models.llama.state_dict_adapter.LlamaStateDictAdapter.from_hf(
    hf_state_dict: dict[str, typing.Any],
    kwargs = {}
) -> dict[str, typing.Any]
```

```python
nemo_automodel.components.models.llama.state_dict_adapter.LlamaStateDictAdapter.to_hf(
    state_dict: dict[str, typing.Any],
    exclude_key_regex: typing.Optional[str] = None,
    kwargs = {}
) -> dict[str, typing.Any]
```

```python
nemo_automodel.components.models.llama.state_dict_adapter.logger = logging.getLogger(__name__)
```