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

# Worker manifest

> Field reference for iii.worker.yaml: name, description, dependencies, runtime base image, setup and start scripts, env, resources, and publish metadata.

This page covers `iii.worker.yaml` configuration options. `iii.worker.yaml` exists at a worker's
root and gives iii what it needs to provision the worker's runtime, install its dependencies, start
its process, and pass through configuration. At add time the schema is strict: an unknown key is an
error, and the error lists the supported fields.

Compose reads two fields from it: `scripts.start` and `runtime.base_image`. The worker provisioning
path reads the other fields. Project workers are declared and operated through
[`worker-compose.yaml`](../using-iii/compose), not the engine's `config.yaml`.

For how to connect a worker into a project once its manifest exists, see
[Creating Workers / Workers](https://iii.dev/docs/0-26-0/creating-workers/workers.md).

> [!NOTE]
>
> `iii.worker.yaml` only matters when iii provisions and runs the worker in its built-in
> virtualization. If you run the worker process yourself, for example `node ./myworker/src/index.js`
> on your own host, you do not need the manifest at all. Any process that uses an iii SDK, calls
> `registerWorker()`, and connects to an iii instance is a worker, and behaves identically whether
> iii started it or not.

## `name`

Required. One path segment: ASCII alphanumerics, `-`, `_` and `.`. A leading `.` and a `..` sequence
are both errors.

## `description`

Optional. One-line summary of the worker. iii prints it when it installs a worker from an image.

## `runtime`

Declares details about the worker's environment. `base_image` is the only supported field.

### `base_image`

Optional. Overrides the default OCI rootfs. Must be a valid OCI reference (alphanumerics plus
`. _ - / : @ +`, max 512 characters). Invalid references are dropped with a warning and the default
is used.

```yaml theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
runtime:
  base_image: oven/bun:1 # From docker.io
  # Or a fully-qualified registry path, e.g. GitHub Container Registry:
  # base_image: ghcr.io/astral-sh/uv:bookworm-slim
```

The images that ship with iii come in two variants:

| Image | Contents | Use it when |
| - | - | - |
| `docker.io/iiidev/node:latest`, `docker.io/iiidev/python:latest` | The language runtime and its package manager. No build toolchain. | The dependencies of the worker install from prebuilt binaries or wheels. This is the default. |
| `docker.io/iiidev/node:builder`, `docker.io/iiidev/python:builder` | The same runtime plus a C toolchain and the development tools. | A dependency compiles from source at install time, for example a node-gyp module or a source distribution. |

## `scripts`

Lifecycle commands. `setup` runs once when the sandbox is provisioned, for the system packages a
dependency needs to build. `install` installs dependencies. `start` runs the worker process, and it
is required.

```yaml Node theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
scripts:
  setup: "apt-get update && apt-get install -y build-essential"
  install: "npm install"
  start: "npx tsx watch src/index.ts"
```

```yaml Python theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
scripts:
  setup: "apt-get update && apt-get install -y libpq-dev"
  install: "pip install watchfiles && pip install -e ."
  start: "watchfiles 'python main.py'"
```

```yaml Rust theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
scripts:
  setup: "apt-get update && apt-get install -y pkg-config libssl-dev"
  install: "cargo install cargo-watch && cargo build"
  start: "cargo watch -x run"
```

```yaml Go theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
scripts:
  setup: "apt-get update && apt-get install -y golang-go"
  install: "go mod download && go build -o worker ./cmd/worker"
  start: "./worker"
```

Declare `setup`, `install` and `start` explicitly. The keys that fed the old inference path
(`runtime.kind`, `runtime.package_manager`, `runtime.entry`, `runtime.language`) are deprecated and
will be removed in a later version.

An omitted `install` skips the dependency install and prints a warning. `install: ""` skips it
without a warning.

> [!NOTE]
>
> A registry bundle manifest rejects `scripts.setup` with `W180 BundleManifestRejected`. It accepts
> `scripts.install` and `runtime.base_image`, and it rejects a base image that is not a plausible
> OCI reference. See [Worker Registry](https://iii.dev/docs/0-26-0/using-iii/workers-registry.md#artifact-types).

## `env`

Map of environment variables injected into the worker process. Keys and values must be strings. The
keys `III_URL` and `III_ENGINE_URL` are filtered out; the engine sets the connection URL itself.

```yaml theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
env:
  LOG_LEVEL: info
  MY_API_KEY: replace-me
```

The manifest does not set the namespace a worker registers in. The worker environment
(`III_NAMESPACE`) or the registration call sets it. See [Namespaces](https://iii.dev/docs/0-26-0/using-iii/namespaces.md).

## `dependencies`

Map of `<worker-name>: <semver range>` declaring other workers this worker depends on, resolved
against the registry.

```yaml theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
dependencies:
  http: "^0.20"
  state: "^0.20"
```

Rules:

* Each name must satisfy the same rules as [`name`](#name).
* Each range must be a valid semver version requirement (for example `^1.2`, `~0.5.0`, `>=2 <3`).
* Duplicate keys are an error.
* A worker cannot depend on itself.
* Prerelease ranges are accepted syntactically, but the default registry resolver serves only stable
  versions, so a prerelease range surfaces as `version_not_found` at resolve time.

## `resources`

Optional CPU and memory requests for the worker's sandbox. Requests above the cap are clamped to the
cap. For bundle workers this emits a `W182 BundleResourceClamped` warning at install time.

```yaml theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
resources:
  cpus: 2
  memory: 2048
```

### `cpus`

Optional integer. Number of vCPUs. Defaults to `2`, capped at `4`.

### `memory`

Optional integer. Memory in MiB. Defaults to `2048`, capped at `4096`.

## `iii_engine_version`

Optional string: the semver range of iii engines the worker runs on, like the `engines` field of a
Node `package.json`. Compose refuses to validate or start the worker (`INCOMPATIBLE_ENGINE`) when the
running iii engine is outside the range, and registry installs only pick versions whose range
includes it. A registry bundle is checked again each time it is installed, so one pinned in
`worker-compose.lock` before an `iii update` is refused too. The engine is compared by its `MAJOR.MINOR.PATCH`, so `0.26.0-rc.2` counts as `0.26.0`.

A range is one or more comparators (`>=`, `>`, `<=`, `<`, `=`, `^`, `~`, or none, followed by
`MAJOR.MINOR.PATCH`). Comparators joined by spaces must all hold; sets joined by `||` may each
hold. A bare `0.26.0` means exactly that version, and `^0.26.0` means `>=0.26.0 <0.27.0`. No `v`
prefix, prerelease, `x` wildcard, or hyphen range.

Quote the value: YAML reads a leading `>` as a block scalar.

```yaml theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
iii_engine_version: ">=0.26.0"
# iii_engine_version: ">=0.26.0 <0.28.0"
# iii_engine_version: "^0.25.0 || ^0.26.0"
```

## Publish metadata: `iii`, `deploy`, `manifest`, `tags`, `license`

Optional metadata used by the workers-repository release pipeline, not by the engine. The engine
accepts these keys (so a manifest published from the workers repo also works with a local Compose
worker) but never reads them at runtime.

```yaml theme={"theme":{"light":"catppuccin-latte","dark":"dark-plus"}}
iii: v1 # manifest format marker
deploy: image # release artifact type: binary | image | bundle
manifest: pyproject.toml # file the release version is read from
tags: # search aliases sent to the workers registry
  - http
  - rest
  - api
license: Apache-2.0
```

`iii`, `deploy`, `manifest`, and `license` are strings. `tags` is a list of strings used for agent
and user discovery in the workers registry. Keep tags short, lowercase, and focused on search terms
rather than repeating the worker description. `license` is an
[SPDX license id](https://spdx.org/licenses/), for example `Apache-2.0`. The release pipeline of the
workers repository requires it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.