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

# Attach Remote AI Workers

## Introduction

The **AI Worker** is a crucial component of the Livepeer AI network, responsible
for performing AI inference tasks. It can be run as a separate process on
compute machines distinct from the Orchestrator or combined with the
Orchestrator on the same machine.

## Key Setup Considerations

* **Startup Configuration**: If you decide to use separate AI Workers, this
  **must** be selected at the Orchestrator's startup. A combined Orchestrator
  **cannot** simultaneously support remote AI Workers.
* **Shared Configuration File**: Both the Orchestrator and AI Workers use the
  `aiModels.json` file (see
  [Configuring AI Models](/ai/orchestrators/models-config.md)).
  * The **Orchestrator** uses `aiModels.json` to set model pricing.
  * The **AI Worker** uses it to manage the runner containers for each model.

## Remote AI Worker Setup

> [!WARNING]
>
> When using experimental external runner containers, ensure they connect to the
> AI Worker and not directly to the Orchestrator.

In a split configuration, the Orchestrator manages multiple AI Workers and
allocates tasks based on the connected workers' capacity. Worker **capacity** is
determined by the following formula:

```
runner container count per pipeline/model_id = capacity per pipeline/model_id
```

The **Orchestrator's capacity** is the sum of the capacities of all connected AI
Workers. This setup enables flexible scaling of compute resources by adding or
removing AI Workers as needed.

### Launch Commands for Remote AI Worker

Below are the launch commands for both the Orchestrator and AI Worker nodes.

> [!NOTE]
>
> For the full Orchestrator launch command, see [Start Your AI
> Orchestrator](/ai/orchestrators/start-orchestrator.md).

> [accordion] Show Launch Commands
>
> #### Orchestrator Command
>
> ```bash theme={null}
> docker run \
>     --name livepeer_ai_orchestrator \
>     ...
>     livepeer/go-livepeer:master \
>     -orchestrator \
>     ...
>     -orchSecret <orchestrator secret>
>     -serviceAddr <orchestrator service address>
> ```
>
> #### AI Worker Command
>
> ```bash theme={null}
> docker run \
>     --name livepeer_ai_worker \
>     ...
>     livepeer/go-livepeer:master \
>     -aiWorker \
>     ...
>     -orchSecret <orchestrator secret> \
>     -orchAddr <orchestrator service address>
> ```
>
> > [!NOTE]
> >
> > **Pricing**: Prices in this example may vary and should be adjusted based on
> > market research and the operational costs of providing compute.

### Configuration Files (`aiModels.json`)

The `aiModels.json` file configures AI model parameters separately for the
Orchestrator and the AI Worker, with each configuration tailored to the specific
needs of that node.

> [!NOTE]
>
> For detailed guidance on configuring `aiModels.json` with advanced model
> settings, see [Configuring AI Models](/ai/orchestrators/models-config.md).

> [accordion] Show Configuration Examples
>
> #### Orchestrator Configuration
>
> ```json theme={null}
> [
>   {
>     "pipeline": "text-to-image",
>     "model_id": "SG161222/RealVisXL_V4.0_Lightning",
>     "price_per_unit": 4768371,
>     "pixels_per_unit": 1
>   }
> ]
> ```
>
> #### AI Worker Configuration
>
> ```json theme={null}
> [
>   {
>     "pipeline": "text-to-image",
>     "model_id": "SG161222/RealVisXL_V4.0_Lightning",
>     "warm": true,
>     "optimization_flags": {
>       "SFAST": true
>     }
>   }
> ]
> ```

## Verifying Remote AI Worker Operation

After starting your **remote AI Worker** node, you can verify it is operational
by following the same inference test instructions used for the Orchestrator, as
described in the
[Orchestrator Confirmation Section](/ai/orchestrators/start-orchestrator.md#confirm-combined-ai-orchestrator-operation).

> [!NOTE]
>
> When accessing the AI Runner from a separate machine, replace `localhost` with
> the **Worker Node's IP address** in the inference test instructions.


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