> 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.datasets.llm.xlam

## Module Contents

### Classes

| Name                                                                    | Description                                                                                       |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [`XlamConfig`](#nemo_automodel-components-datasets-llm-xlam-XlamConfig) | Construction-time configuration for the xLAM function-calling dataset (tokenizer is a build arg). |

### Functions

| Name                                                                                      | Description                                                              |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [`_convert_tool_calls`](#nemo_automodel-components-datasets-llm-xlam-_convert_tool_calls) | Convert xLAM answers field into OpenAI tool\_calls messages.             |
| [`_convert_tools`](#nemo_automodel-components-datasets-llm-xlam-_convert_tools)           | Convert xLAM tool definitions into OpenAI tool schema.                   |
| [`_format_example`](#nemo_automodel-components-datasets-llm-xlam-_format_example)         | -                                                                        |
| [`_json_load_if_str`](#nemo_automodel-components-datasets-llm-xlam-_json_load_if_str)     | -                                                                        |
| [`make_xlam_dataset`](#nemo_automodel-components-datasets-llm-xlam-make_xlam_dataset)     | Load and preprocess the xLAM function-calling dataset to OpenAI messages |

### Data

[`_TYPE_MAP`](#nemo_automodel-components-datasets-llm-xlam-_TYPE_MAP)

[`logger`](#nemo_automodel-components-datasets-llm-xlam-logger)

### API

```python
class nemo_automodel.components.datasets.llm.xlam.XlamConfig(
    seq_length: int | None = None,
    limit_dataset_samples: int | None = None,
    fp8: bool = False,
    split: str = 'train',
    dataset_name: str = 'Salesforce/xlam-function-c...,
    padding: bool | str = False,
    truncation: bool | str = False
)
```

Dataclass

Construction-time configuration for the xLAM function-calling dataset (tokenizer is a build arg).

Identifier for the HuggingFace dataset to load.

Flag reserved for future mixed-precision use (currently unused).

If set, limit the number of examples loaded from the split.

Optional padding strategy.

If set, pad/truncate each example to this length.

Which split of the dataset to load (e.g. `train`, `validation`).

Optional truncation strategy.

```python
nemo_automodel.components.datasets.llm.xlam.XlamConfig.build(
    tokenizer: 'PreTrainedTokenizerBase | None'
) -> nemo_automodel.components.datasets.lazy_mapped_dataset.LazyMappedDataset
```

Build the xLAM :class:`LazyMappedDataset` from this :class:`XlamConfig` and a runtime tokenizer.

```python
nemo_automodel.components.datasets.llm.xlam._convert_tool_calls(
    raw_calls: typing.List[typing.Dict],
    example_id: typing.Optional[int] = None
) -> typing.List[typing.Dict]
```

Convert xLAM answers field into OpenAI tool\_calls messages.

```python
nemo_automodel.components.datasets.llm.xlam._convert_tools(
    raw_tools: typing.List[typing.Dict]
) -> typing.List[typing.Dict]
```

Convert xLAM tool definitions into OpenAI tool schema.

```python
nemo_automodel.components.datasets.llm.xlam._format_example(
    example,
    tokenizer,
    eos_token_id,
    pad_token_id,
    seq_length = None,
    padding = None,
    truncation = None
)
```

```python
nemo_automodel.components.datasets.llm.xlam._json_load_if_str(
    value
)
```

```python
nemo_automodel.components.datasets.llm.xlam.make_xlam_dataset(
    tokenizer,
    seq_length = None,
    limit_dataset_samples = None,
    fp8 = False,
    split = 'train',
    dataset_name = 'Salesforce/xlam-function-c...,
    padding = False,
    truncation = False
)
```

Load and preprocess the xLAM function-calling dataset to OpenAI messages
compatible with the bulbasaur chat template (tool-calling aware).

```python
nemo_automodel.components.datasets.llm.xlam._TYPE_MAP = {'str': 'string', 'string': 'string', 'int': 'integer', 'integer': 'integer', 'f...
```

```python
nemo_automodel.components.datasets.llm.xlam.logger = logging.getLogger(__name__)
```