# nodus.runtime

> In-container helpers that speak nodusd's sockets (resources.md §8); each is a no-op outside Nodus.

Source: https://nodus-platform-site.pages.dev/docs/reference/python/nodus-runtime/
Build revision: 211ad9f836655b1c3a2668c4693e442471f28614

<!-- Generated by scripts/gen-reference.mjs from the SDK docstrings (griffe). Do not edit: run make gen. -->

In-container helpers that speak nodusd’s sockets (resources.md §8); each is a no-op outside Nodus.

Telemetry goes to `/run/nodus/events.sock` as JSON lines. Without the socket, inside a Nodus container, events are printed as `nodus.event {json}` lines, which nodusd also parses; outside Nodus nothing is emitted.

## `emit`

```python
emit(event: dict[str, Any]) -> None
```

Send one telemetry event; ids are unique per process so the node’s per-attempt dedup keeps every event.

## `in_nodus`

```python
in_nodus() -> bool
```

## `progress`

```python
progress(completed: int | float, total: int | float | None = None) -> None
```

Report progress; it appears in `status.progress` and the console, and drives `Restartable` cursors.

## `restored`

```python
restored() -> bool
```

True when this attempt started from a restored checkpoint.

## `self`

```python
self() -> dict[str, Any]
```

`{kind, name, project, attempt, epoch, index}` of the object this container runs for, from `api.sock`.

## `state_dir`

```python
state_dir() -> Path
```

The checkpointed directory: write model, optimizer and progress files here.
