> ## 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.

# Upload and Download Files with AI Agents

> Use MCP tools to upload code, datasets, and configs to GPU instances, and download results — 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 />

Transfer files to and from GPU instances without manual SCP commands. Your AI agent handles uploads, downloads, and file verification.

***

## "Upload my training script and config to the training instance."

The agent transfers files directly:

1. **`list_instances`** — finds the target instance
2. **`file_upload`** — uploads `train.py` to `/workspace/train.py`
3. **`file_upload`** — uploads `config.yaml` to `/workspace/config.yaml`
4. **`ssh_execute`** — runs `ls -lh /workspace/` to confirm

> Uploaded 2 files to **training-run**:
>
> | File        | Size   | Remote Path            |
> | ----------- | ------ | ---------------------- |
> | train.py    | 3.8 KB | /workspace/train.py    |
> | config.yaml | 512 B  | /workspace/config.yaml |
>
> Both files verified on the instance.

***

## "Download the trained model weights and the training log."

The agent retrieves files from the instance:

1. **`ssh_execute`** — runs `ls -lh /workspace/output/` to see what's there
2. **`file_download`** — downloads `/workspace/output/model.safetensors`
3. **`file_download`** — downloads `/workspace/output/training.log`

> **Files on the instance:**
>
> ```
> -rw-r--r-- 1 root root 1.2G model.safetensors
> -rw-r--r-- 1 root root  48K training.log
> -rw-r--r-- 1 root root 2.1K config.json
> ```
>
> Downloaded **model.safetensors** (1.2 GB) and **training.log** (48 KB).

<Note>File upload and download have a 10MB limit per transfer. For larger files, use `ssh_execute` with `wget` or `curl` to transfer directly between instances or from external URLs.</Note>

***

## "Upload a requirements.txt and install everything on my dev-box."

The agent combines file transfer with command execution:

1. **`file_upload`** — uploads `requirements.txt` to `/root/requirements.txt`
2. **`ssh_execute`** — runs `pip install -r /root/requirements.txt`
3. **`ssh_execute`** — runs `pip list | wc -l` to confirm packages installed

> Uploaded **requirements.txt** (28 packages) to **dev-box**.
>
> Installation output:
>
> ```
> Successfully installed torch-2.4.0 transformers-4.44.0 ...
> ```
>
> 28 packages installed. Environment is ready.

***

## Tools used in this workflow

| Tool             | Purpose                                                 |
| ---------------- | ------------------------------------------------------- |
| `list_instances` | Find the target instance                                |
| `file_upload`    | Transfer files to an instance (max 10MB)                |
| `file_download`  | Retrieve files from an instance                         |
| `ssh_execute`    | Verify uploads, list remote files, run install commands |
