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

# Batch Operations with AI Agents

> Use MCP tools to deploy multiple GPU instances, run commands across a fleet, and check status in bulk — all through conversation.

export const RuncrateStyles = () => {
  if (typeof document !== 'undefined' && !document.getElementById('runcrate-overrides')) {
    const s = document.createElement('style');
    s.id = 'runcrate-overrides';
    s.textContent = `
      /* Match Runcrate's rounding scale (--radius: 0.75rem) */
      .rounded-sm { border-radius: 0.5rem !important; }   /* 8px */
      .rounded-md { border-radius: 0.625rem !important; } /* 10px */
      .rounded-lg { border-radius: 0.75rem !important; }  /* 12px */
      .rounded-l-sm { border-top-left-radius: 0.5rem !important; border-bottom-left-radius: 0.5rem !important; }
      .rounded-r-sm { border-top-right-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }
      .rounded-l-md { border-top-left-radius: 0.625rem !important; border-bottom-left-radius: 0.625rem !important; }
      .rounded-r-md { border-top-right-radius: 0.625rem !important; border-bottom-right-radius: 0.625rem !important; }
      .rounded-l-lg { border-top-left-radius: 0.75rem !important; border-bottom-left-radius: 0.75rem !important; }
      .rounded-r-lg { border-top-right-radius: 0.75rem !important; border-bottom-right-radius: 0.75rem !important; }

      /* Cards: never pure white in light mode */
      .card { background-color: #fcfcfc !important; border-radius: 0.75rem !important; }
      html.dark .card { background-color: #141414 !important; }

      /* Docs hero box */
      .rc-hero { background-color: #fcfcfc; border: 1px solid #e0e0e0; }
      html.dark .rc-hero { background-color: #141414; border-color: #242424; }
      html.dark .rc-hero h1 { color: #f5f5f5; }

      /* Runcrate scrollbar — thin, transparent track, hide-until-hover thumb */
      ::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
      ::-webkit-scrollbar-track { background-color: transparent; }
      ::-webkit-scrollbar-thumb { background-color: rgba(155, 155, 155, 0.5); border-radius: 10px; transition: opacity 0.3s ease; opacity: 0; }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(155, 155, 155, 0.7); }
      *:hover::-webkit-scrollbar-thumb,
      *:focus::-webkit-scrollbar-thumb,
      *:active::-webkit-scrollbar-thumb { opacity: 1; }
      * { scrollbar-width: thin; scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
    `;
    document.head.appendChild(s);
  }
  return null;
};

<RuncrateStyles />

Deploy a fleet of instances, run the same command on all of them, and monitor everything at once. Your AI agent handles the coordination.

***

## "Deploy 4 RTX 4090 instances for a hyperparameter sweep."

The agent provisions the fleet:

1. **`list_gpu_types`** — confirms RTX 4090 availability and pricing
2. **`create_instance`** — creates `sweep-1` with RTX 4090
3. **`create_instance`** — creates `sweep-2` with RTX 4090
4. **`create_instance`** — creates `sweep-3` with RTX 4090
5. **`create_instance`** — creates `sweep-4` with RTX 4090
6. **`instance_status`** — polls all four until running

> Deployed 4 instances:
>
> | Instance | GPU      | Status  | Cost      |
> | -------- | -------- | ------- | --------- |
> | sweep-1  | RTX 4090 | running | \$0.35/hr |
> | sweep-2  | RTX 4090 | running | \$0.35/hr |
> | sweep-3  | RTX 4090 | running | \$0.35/hr |
> | sweep-4  | RTX 4090 | running | \$0.35/hr |
>
> Fleet burn rate: **\$1.40/hr**. All 4 are ready for commands.

***

## "Install dependencies on all of them and start training with different learning rates."

The agent runs commands across the fleet:

1. **`ssh_execute`** on each instance — `pip install torch transformers datasets`
2. **`file_upload`** on each instance — uploads `train.py`
3. **`ssh_execute`** on each instance — starts training with different args:
   * sweep-1: `python train.py --lr 1e-4`
   * sweep-2: `python train.py --lr 5e-5`
   * sweep-3: `python train.py --lr 1e-5`
   * sweep-4: `python train.py --lr 5e-6`

> All 4 instances are running training with different learning rates:
>
> | Instance | Learning Rate | Status           |
> | -------- | ------------- | ---------------- |
> | sweep-1  | 1e-4          | training started |
> | sweep-2  | 5e-5          | training started |
> | sweep-3  | 1e-5          | training started |
> | sweep-4  | 5e-6          | training started |
>
> Check back in \~30 minutes for results, or ask me to monitor progress.

***

## "Check training status on all instances and tear down any that are done."

The agent checks each instance and cleans up:

1. **`ssh_execute`** on each — `tail -5 /root/train.log`
2. **`ssh_execute`** on each — `nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader`

> | Instance | GPU Util | Last Log Line                         | Status  |
> | -------- | -------- | ------------------------------------- | ------- |
> | sweep-1  | 0%       | `Training complete. Best loss: 0.312` | done    |
> | sweep-2  | 0%       | `Training complete. Best loss: 0.287` | done    |
> | sweep-3  | 94%      | `Epoch 4/5 Step 800/1000 Loss: 0.301` | running |
> | sweep-4  | 91%      | `Epoch 3/5 Step 620/1000 Loss: 0.445` | running |
>
> **sweep-2** (lr=5e-5) has the best loss so far at 0.287.
> Terminating finished instances to save money.

3. **`file_download`** on sweep-1 and sweep-2 — downloads results
4. **`delete_instance`** — terminates `sweep-1` and `sweep-2`

> Downloaded results from sweep-1 and sweep-2.
> Terminated both. Fleet cost reduced to \$0.70/hr (2 remaining).

***

## Tools used in this workflow

| Tool                                  | Purpose                                   |
| ------------------------------------- | ----------------------------------------- |
| `list_gpu_types`                      | Check availability before bulk deployment |
| `create_instance` / `instance_status` | Deploy fleet and wait for readiness       |
| `file_upload` / `ssh_execute`         | Distribute code and run commands          |
| `file_download`                       | Retrieve results from completed runs      |
| `delete_instance`                     | Tear down finished instances              |
