> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://docs.nvidia.com/dynamo/llms.txt. For full content including API reference and SDK examples, see https://docs.nvidia.com/dynamo/llms-full.txt.

# dynamo.health_check

`dynamo.health_check` publishes 1 classes and 1 functions. Source: [`lib/bindings/python/src/dynamo/health_check.py`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/health_check.py)

#### HealthCheckPayload (class)

Base class for managing health check payloads.

```python
from dynamo.health_check import HealthCheckPayload
```

```python
HealthCheckPayload()
```

Each backend should extend this class and set self.default\_payload
in their **init** method.

Environment variable DYN\_HEALTH\_CHECK\_PAYLOAD can override the default.

[`lib/bindings/python/src/dynamo/health_check.py#L75`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/health_check.py#L75)

**Public methods**

<h4 id="api-dynamo-health-check-healthcheckpayload-init">
  **init**
</h4>

```python
__init__()
```

Initialize health check payload.

Subclasses should call super().**init**() after setting self.default\_payload.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/health_check.py#L87)

<h4 id="api-dynamo-health-check-healthcheckpayload-to-dict">
  to_dict
</h4>

```python
to_dict() -> Dict[str, Any]
```

Get the health check payload as a dictionary.

Returns the environment override if DYN\_HEALTH\_CHECK\_PAYLOAD is set,
otherwise returns the default payload.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/health_check.py#L100)

#### load\_health\_check\_from\_env (function)

Load health check payload from environment variable.

```python
from dynamo.health_check import load_health_check_from_env
```

```python
load_health_check_from_env(env_var: str = 'DYN_HEALTH_CHECK_PAYLOAD') -> Optional[Dict[str, Any]]
```

Supports two formats:

1. JSON string: export DYN\_HEALTH\_CHECK\_PAYLOAD='\{"prompt": "test", "max\_tokens": 1}'
2. File path: export DYN\_HEALTH\_CHECK\_PAYLOAD='@/path/to/health\_check.json'

**Parameters**

**`env_var`** `str`

Name of the environment variable to check (default: DYN\_HEALTH\_CHECK\_PAYLOAD)

---

**Returns**

* `Optional[Dict[str, Any]]` — Dict containing the health check payload, or None if not set.

[`lib/bindings/python/src/dynamo/health_check.py#L33`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/health_check.py#L33)