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

# Training workers

> Where your training jobs run, and how to set up a browser, desktop, Python, or cloud worker to run them.

Your agent queues training jobs, and a worker picks them up and runs them. There are four kinds:

* **Browser worker:** a tab at [train.auremi.ai](https://train.auremi.ai). Browser workers are a great way to start training quickly, but they have memory limits. For larger jobs, install the desktop app or train on cloud compute.
* **Desktop app:** a TensorFlow\.js or Python worker without the browser's memory limits. It runs unattended.
* **Python worker (coming soon):** a command-line worker for a GPU machine. It will run PyTorch model repos, with no memory limits beyond the machine's own.
* **Cloud compute:** SageMaker or Vertex AI in your own cloud account.

## Pair a browser worker

<Steps>
  <Step title="Open the worker">
    On the training machine, open [train.auremi.ai](https://train.auremi.ai).
  </Step>

  <Step title="Request pairing">
    Enter your **Auremi account email** and an optional **Device name**, then click **Pair this worker**. Copy the eight-character pairing code it shows.
  </Step>

  <Step title="Approve it in the console">
    Sign in to the [Auremi console](https://auremi.ai) and open **Training Workers** from the sidebar. Under **Approve a training worker**, enter the **Pairing code** and a **Worker name**. Leave **Eligible jobs** on **Any compatible job**, pick an **Authorization** length, and click **Approve worker**.
  </Step>
</Steps>

The worker starts by itself. On **Training Workers** its status reads **available**. If the code expires first (the time is shown under it), pair again.

Authorization ends after the length you picked. Tick **Extend authorization while this worker is healthy** to keep it running, or click **Renew** on the worker later.

## Install the desktop app

Use the desktop app when a job needs more memory than a browser tab allows, or on a machine that should train with no browser open. It runs TensorFlow\.js and Python workers.

* [Windows](https://auremi.ai/downloads/training-worker/windows)
* **Mac:** coming soon
* **Linux:** coming soon

Open the app and pair it the same way: enter your email, click **Pair this worker**, and approve the code on **Training Workers**. Then leave the app running.

## Run a worker from Python

<Note>Coming soon. The Python worker will run PyTorch model repos on a GPU machine from a terminal or a service manager, with no browser memory limits.</Note>

## Train on SageMaker or Vertex

Connect your cloud account once in the Auremi console. After that, ask your agent to run jobs there. It builds and uploads the training image itself the first time.

### SageMaker

<Steps>
  <Step title="Sign in to Auremi and open the setup guide">
    Sign in to the [Auremi console](https://auremi.ai). The setup guide and the AWS policy JSON you need are only shown there. Open **Cloud Compute**, stay on the **GPU** tab, choose **SageMaker**, click **How do I set this up?**, and pick **Allow Coding Agent To Push Images**.
  </Step>

  <Step title="Set up AWS">
    In AWS, using the policy JSON from that setup guide:

    * Create an IAM user or role for your coding agent, with the policy under **See image upload policy JSON**, so it can push the runner image to ECR.
    * On the machine where your agent runs, install Docker and sign the AWS CLI in with that identity. Check it with `aws sts get-caller-identity`. The agent builds and pushes the image with these, not with anything stored in Auremi.
    * Create the Auremi access role. Auremi assumes it to start, check, and stop training jobs, so they run and bill in your AWS account. Give it the trust policy under **See Auremi access role trust policy JSON**, which already contains your external ID, and the permissions under **See SageMaker submit policy JSON**.
    * Create the SageMaker execution role. Give it the trust policy under **See SageMaker trust policy JSON** and the permissions under **See SageMaker runtime policy JSON**.
  </Step>

  <Step title="Fill in the form">
    Back in the Auremi console, fill in the SageMaker form:

    * **Display name**, **AWS account id**, and **Region**
    * **Execution role ARN:** the execution role you just created.
    * **Auremi access role ARN:** the access role you just created.
    * **ECR image:** `<account-id>.dkr.ecr.<region>.amazonaws.com/auremi/runner:latest`. This is where your agent pushes the image.
    * The instance type (for example `ml.g5.xlarge`), **Instance count**, **Max spend**, **Max runtime minutes**, and **Storage GB**

    Click **Save SageMaker**.
  </Step>

  <Step title="Ask your agent">
    <Prompt description="Train on SageMaker">
      Train on SageMaker using the full dataset, with 6 epochs.
    </Prompt>

    <Accordion title="What the agent runs">
      ```bash theme={null}
      auremi cloud-compute push-runner sagemaker
      auremi train --target sagemaker --dataset <datasetVersionId> --mode full --epochs 6 --no-run
      auremi train --target sagemaker --dataset <datasetVersionId> --mode full --epochs 6 --wait
      ```
    </Accordion>
  </Step>
</Steps>

### Vertex AI

<Steps>
  <Step title="Sign in to Auremi and open the setup guide">
    Sign in to the [Auremi console](https://auremi.ai). Open **Cloud Compute**, choose **Vertex**, and click **How do I set this up?**. The guide lists what to set up in Google Cloud.
  </Step>

  <Step title="Set up Google Cloud">
    Following that guide:

    * Enable the Vertex AI, Artifact Registry, and IAM Service Account Credentials APIs.
    * Create a service account for Auremi's jobs, and give it Vertex AI User, plus Service Account User on itself.
    * Create a Workload Identity Federation pool with an OIDC provider whose issuer is Auremi. The guide shows the issuer URL. Then grant your Auremi account Workload Identity User on the service account, using the exact subject the guide shows. Auremi starts, checks, and stops jobs only by acting as that service account, so they run and bill in your project.
    * On the machine where your agent runs, install Docker and sign `gcloud` in. The agent builds and pushes the image with these, not with anything stored in Auremi.
  </Step>

  <Step title="Fill in the form">
    Back in the Auremi console, fill in the Vertex form:

    * **Display name**, **GCP project**, **GCP project number**, and **Region**
    * **Service account** and **Workload identity provider**
    * **Container image:** an Artifact Registry address, such as `us-central1-docker.pkg.dev/<gcp-project>/<repo>/auremi-runner:latest`. This is where your agent pushes the image.
    * **Machine type**, **Accelerator type**, **Accelerator count**, **Max spend**, **Max runtime minutes**, and **Boot disk GB**

    Click **Save Vertex**.
  </Step>

  <Step title="Ask your agent">
    <Prompt description="Train on Vertex">
      Train on Vertex using the full dataset, with 6 epochs.
    </Prompt>

    <Accordion title="What the agent runs">
      ```bash theme={null}
      auremi cloud-compute push-runner vertex --image us-central1-docker.pkg.dev/<gcp-project>/<repo>/auremi-runner:latest
      auremi train --target vertex --dataset <datasetVersionId> --mode full --epochs 6 --no-run
      auremi train --target vertex --dataset <datasetVersionId> --mode full --epochs 6 --wait
      ```
    </Accordion>
  </Step>
</Steps>

## Manage workers

Each worker has a card on **Training Workers**. A worker shows **offline** when its tab or app is closed or asleep.

* **Drain** finishes the current job and takes no new ones.
* **Stop** pauses the worker.
* **Revoke** removes its access immediately.
