# Submit a Run Job

> Start training runs, batch jobs and evaluations without managing a machine.

This page shows how to submit a Run Job with the CLI. Each one needs compute, an image and a command.

## <span className="sr-only">Run a job</span>

<steps level="4">

#### Install and sign in

[Install the CLI](/cli) and sign in:

```bash
featherless-cloud login
```

#### Run a command

Put the command after `--`:

```bash
featherless-cloud exec --gpu-count 1 -- python -c "import torch; print(torch.cuda.get_device_name(0))"
```

The CLI waits for the job, streams its output, and exits with the command's exit code.

#### Choose the image and data

Without `--template` or `--image`, the job runs the default PyTorch environment. Mount network volumes for input and output:

```bash
featherless-cloud exec \
  --template featherless/rocm-pytorch \
  --gpu-count 1 \
  --volume my-data:/workspace \
  -- python /workspace/train.py
```

</steps>

Use `--cpu-cores <n>` instead of `--gpu-count` for CPU compute. See [`exec`](/cli/exec) for every option.

## Run Job options

<table>
<thead>
  <tr>
    <th>
      Option
    </th>
    
    <th>
      Flag
    </th>
    
    <th>
      Default
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Time limit, up to 24 hours
    </td>
    
    <td>
      <code>
        --timeout <seconds>
      </code>
    </td>
    
    <td>
      24 hours
    </td>
  </tr>
  
  <tr>
    <td>
      Retries after an interruption, 0–3
    </td>
    
    <td>
      <code>
        --preemption-retries <n>
      </code>
    </td>
    
    <td>
      0
    </td>
  </tr>
  
  <tr>
    <td>
      Working directory
    </td>
    
    <td>
      <code>
        --workdir <path>
      </code>
    </td>
    
    <td>
      <code>
        /workspace
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Container disk, 20–2,000 GiB
    </td>
    
    <td>
      <code>
        --disk <gb>
      </code>
    </td>
    
    <td>
      20
    </td>
  </tr>
  
  <tr>
    <td>
      Network volumes, up to 8
    </td>
    
    <td>
      <code>
        --volume <name>:<path>
      </code>
    </td>
    
    <td>
      None
    </td>
  </tr>
  
  <tr>
    <td>
      Environment variables and secrets
    </td>
    
    <td>
      <code>
        --env K=V
      </code>
      
      , <code>
        --secret K=V
      </code>
    </td>
    
    <td>
      None
    </td>
  </tr>
  
  <tr>
    <td>
      Collect output
    </td>
    
    <td>
      <code>
        --no-retain-logs
      </code>
      
       turns it off
    </td>
    
    <td>
      On
    </td>
  </tr>
</tbody>
</table>

The time limit starts when compute is assigned, not when you submit, and covers all retries together. Secrets are files under `$FEATHERLESS_SECRETS_PATH`, not environment variables; see [Secret variables](/templates/custom-images#read-secrets-in-your-code).

## Retry safely

Submitting the same job twice with the same `--idempotency-key <key>` returns the first job instead of starting another, so a script can retry a submission safely.

## Run in the background

`--detach` submits the job and returns at once. Follow it later with `featherless-cloud runjob logs <job-id> --follow`, using the ID it prints. Pressing Ctrl-C while `exec` waits also detaches; add `--cancel-on-interrupt` to cancel the job instead.

## Next steps

<card-group>
<card icon="i-lucide-activity" title="Monitor and manage" to="/run-jobs/manage">

Follow, cancel and delete Run Jobs.

</card>

<card icon="i-lucide-graduation-cap" title="Fine-tune with a Run Job" to="/examples/fine-tune-run-job">

An end-to-end example with a network volume.

</card>
</card-group>
