> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uniac.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# load

> Construct, validate, and hydrate a Service or System.

`uniac.load` is the single runtime entrypoint. It takes a [`Service`](/sdk/service) or [`System`](/sdk/system) class, constructs an instance, validates that every annotated [`Node`](/sdk/node) is set, and hydrates each Node's `.url` from the deploy-time wiring.

```python theme={null}
from uniac import load

service = load(MySystem)
```

## Signature

```python theme={null}
def load(spec_cls: type[T]) -> T: ...
```

* **Input** — a `Service` or `System` *class* (not an instance). Passing an instance raises `TypeError`.
* **Output** — a typed instance, with every `Node` hydrated.

## What it does, in order

1. **Read `UNIAC_INIT_*` env vars.** For each `__init__` parameter, look for `UNIAC_INIT_<UPPERCASE_NAME>`. Coerce the string value to the parameter's annotated type. Missing param + has default → use the default; missing param + no default → raise [`LoadError`](/sdk/exceptions).
2. **Construct** — `cls(**init_kwargs)`.
3. **Validate** — calls `_uniac_validate()` on the result (see [`NodeSpec`](/sdk/nodespec)).
4. **Hydrate Nodes** — reads `UNIAC_DEPS_JSON` and writes each Node's `_uniac_url`.

## Supported init-parameter types

`str`, `int`, `float`, `bool`. Any other annotation, or a parameter with no annotation, raises `LoadError`.

Bool coercion is case-insensitive: `"true" | "1" | "yes" | "on"` are truthy; anything else is false.

## Raises

| Exception                                 | When                                                        |
| ----------------------------------------- | ----------------------------------------------------------- |
| [`LoadError`](/sdk/exceptions)            | Required env var missing; unsupported init type; bad value. |
| [`UniacValidationError`](/sdk/exceptions) | Annotated Node slot unset or wrong type.                    |
| `TypeError`                               | `spec_cls` is not a class, or not a `NodeSpec` subclass.    |
