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

# launch

Launch a Komodo job.

## Usage

`komo job launch [OPTIONS] CONFIG_FILE`

## Options

| Option          | Required | Description                                                                                                                                                                                                            | Type |
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
| ‑‑name          | No       | Job name. If not provided, a name will be generated.                                                                                                                                                                   | str  |
| ‑c, ‑‑cloud     | No       | Name of the cloud to use. If not provided, Komodo will select a cloud for you based on GPU prices and availability.                                                                                                    | str  |
| ‑g, ‑‑gpus      | No       | Which gpus to use, in the format \<GPU type>:\<Num GPUs> (eg. A100:4)                                                                                                                                                  | str  |
| ‑n, ‑‑num-nodes | No       | The number of nodes to launch for this job (for multi-node distributed training)                                                                                                                                       | int  |
| ‑d, ‑‑detach    | No       | Exit after the job is started instead of following the logs                                                                                                                                                            | flag |
| ‑r, ‑‑run       | No       | Command to run when the job starts                                                                                                                                                                                     |      |
| ‑e, ‑‑env       | No       | Specify an environment variable in the form `--env key=value` or `--env key` (value will come from the value of `$key` in your shell). You can use this flag multiple times to specify multiple environment variables. | str  |

## Examples

Run the hello world job described in the [quickstart](../../../../quickstart)

```bash theme={null}
komo job launch hello-world.yaml
```

Run the same job, but this time specify a different command to run

```bash theme={null}
komo job launch hello-world.yaml --run 'echo goodbye world'
```

Run a training job distributed over 4 nodes.
Your job will have access to the following environment variables:

`SKYPILOT_NODE_RANK`: rank (an integer ID from 0 to num\_nodes-1) of the node executing the task

`SKYPILOT_NODE_IPS`: a string of IP addresses of the nodes reserved to execute the task, where each line contains one IP address

`SKYPILOT_NUM_GPUS_PER_NODE`: number of GPUs reserved on each node to execute the task; the same as the count in accelerators: \<name>:\<count>

```bash theme={null}
komo job launch my-training-job.yaml --num-nodes 4
```

Run a job and exit as soon as the job has started

```bash theme={null}
komo job launch hello-world.yaml -d
```
