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

# Run

> Upload a Python file, enqueue a function, optionally wait for JSON.

```bash theme={null}
compute run <file.py>::<function> --gpu <sku> [options]
```

Example:

```bash theme={null}
compute run simple_mlp.py::train --gpu H100-SXM --wait --yes
```

`--gpu H100` is an alias for `H100-SXM`. `--gpu MI300X` is the AMD SKU (stock can be tight).

## Flags

| Flag         | Meaning                                                                   |
| ------------ | ------------------------------------------------------------------------- |
| `--gpu`      | SKU. Required unless the `@app.function` decorator already set one.       |
| `--provider` | Optional pin (`runpod`, `hotaisle`). Usually omit.                        |
| `--wait`     | Stream until terminal; print JSON result. Default is detach after create. |
| `--timeout`  | Function timeout in seconds. Default **600** (10 minutes).                |
| `--args`     | JSON object for function kwargs.                                          |
| `--dry-run`  | Print the upload plan. No upload, no machine.                             |
| `--yes`      | Skip interactive confirmation.                                            |
| `--json`     | (global) machine-readable envelope.                                       |

`compute run --help` is the live flag list.

## What happens

1. The CLI packages the target file (and what it imports from the project).
2. The API enqueues a run if admission and credit allow it.
3. A worker provisions a **new** machine, installs the image, runs the function, streams logs, then **terminates** the machine.
4. You get a JSON return value, a receipt, and an empty `compute machines` list.

## Provider vs SKU

You pick a GPU name. Compute picks the provider unless you pass `--provider`. You do not pick a region or an instance template.

## Detached vs wait

```bash theme={null}
# prints run_id and exits
compute run train.py::main --gpu H100-SXM --yes

# later
compute runs status <run_id>
compute logs <run_id> -f
compute runs result <run_id>
compute runs receipt <run_id>
```

Or do it in one shot with `--wait`.

## Inspect

```bash theme={null}
compute runs list
compute runs status <run_id>
compute runs result <run_id>
compute runs receipt <run_id>
```

`result` is the function return value. `receipt` is billed minutes and the platform fee (see [Billing](/billing)).
