> This page is for version Latest.
> 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.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.loggers.trackio_utils

Trackio run wrapper used by the training recipes.

## Module Contents

### Classes

| Name                                                                              | Description                            |
| --------------------------------------------------------------------------------- | -------------------------------------- |
| [`TrackioLogger`](#nemo_automodel-components-loggers-trackio_utils-TrackioLogger) | Log training metrics to a Trackio run. |

### Data

[`RESERVED_KEYS`](#nemo_automodel-components-loggers-trackio_utils-RESERVED_KEYS)

[`logger`](#nemo_automodel-components-loggers-trackio_utils-logger)

### API

```python
class nemo_automodel.components.loggers.trackio_utils.TrackioLogger(
    run: typing.Any
)
```

Log training metrics to a Trackio run.

Wraps the `trackio.Run` returned by `trackio.init` so recipes can log `MetricsSample` dictionaries
directly: reserved keys are dropped, tensors are reduced to Python floats and non-numeric values are skipped.
Built by `nemo_automodel.components.loggers.loggers.TrackioConfig.build` on rank 0 only.

**Parameters:**

**`run`** `Any`

The `trackio.Run` to log to.

---

```python
nemo_automodel.components.loggers.trackio_utils.TrackioLogger.finish() -> None
```

Finish the run and flush pending metrics.

```python
nemo_automodel.components.loggers.trackio_utils.TrackioLogger.log_metrics(
    metrics: collections.abc.Mapping[str, typing.Any],
    step: int
) -> None
```

Log a metrics dictionary at `step`.

**Parameters:**

**`metrics`** `Mapping[str, Any]`

Metric name to value. Values may be Python numbers or tensors; a tensor with more than one
element is logged as its mean. Reserved Trackio keys (e.g. `step`, `timestamp`) and
non-numeric values are skipped.

---

**`step`** `int`

Training step used as the x-axis.

---

```python
nemo_automodel.components.loggers.trackio_utils.RESERVED_KEYS = frozenset({'project', 'run', 'timestamp', 'step', 'time', 'metrics'})
```

```python
nemo_automodel.components.loggers.trackio_utils.logger = logging.getLogger(__name__)
```