> 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

### 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
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__)
```