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

# baseten train job

> Manage training jobs

## list

```sh theme={"system"}
baseten train job list [OPTIONS]
```

List training jobs, newest first.

Lists every job in projects your teams can access. Pass --project to narrow to one project, or --status to narrow to particular job states.

### Options

<ParamField body="--direction" type="TEXT" default="desc">
  Sort order by creation time: 'desc' (newest first) or 'asc' (oldest first).

  One of: `asc`, `desc`
</ParamField>

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="--project" type="TEXT">
  Only list jobs in this training project, by name or ID.
</ParamField>

<ParamField body="--status" type="TEXT (repeatable)">
  Only list jobs in these states: pending, created, deploying, deploy-failed, running, completed, failed, stopped, preempted. Repeatable.
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

List every training job you can see

```sh theme={"system"}
baseten train job list
```

List the running jobs of one project

```sh theme={"system"}
baseten train job list --project my-project --status running
```

List jobs oldest first

```sh theme={"system"}
baseten train job list --direction asc
```

### Filter output with `--jq`

Print just the job IDs

```sh theme={"system"}
baseten train job list --jq '.training_jobs[].id'
```

### Output

**Text mode (`--output text`):** Table with columns: ID, PROJECT, NAME, STATUS, INSTANCE TYPE, NODES, CREATED. When no jobs match, prints "No training jobs found." to stderr.

**JSON mode (`--output json`):** payload type `managementapi.SearchTrainingJobsResponse`.

## describe

```sh theme={"system"}
baseten train job describe [OPTIONS]
```

Describe a training job by ID, including its project, compute, and checkpoint sync state.

### Options

<ParamField body="--job-id" type="TEXT" required>
  ID of the training job.
</ParamField>

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

Describe a job

```sh theme={"system"}
baseten train job describe --job-id p7qr9qv
```

### Filter output with `--jq`

Print the job's current status

```sh theme={"system"}
baseten train job describe --job-id p7qr9qv --jq '.training_job.current_status'
```

### Output

**Text mode (`--output text`):** A field-per-line summary of the job and its project.

**JSON mode (`--output json`):** payload type `managementapi.GetTrainingJobResponse`.

## logs

```sh theme={"system"}
baseten train job logs [OPTIONS]
```

Fetch logs for a training job.

Without --tail, returns the logs in a time window; with --tail, streams new logs until the job stops producing them or you interrupt with Ctrl-C.

### Options

<ParamField body="--end" type="TEXT">
  End of the log time range. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone. Default is now. Window must be at most 7 days.
</ParamField>

<ParamField body="--job-id" type="TEXT" required>
  ID of the training job.
</ParamField>

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="--limit" type="INTEGER" default="5000">
  Maximum number of log lines to return, paging backward from the end of the window. Use 0 for no limit (every log line in the window). Not applicable with --tail.
</ParamField>

<ParamField body="--min-level" type="TEXT">
  Only return logs at or above this severity level.

  One of: `debug`, `info`, `warning`, `error`
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="--since" type="TEXT">
  Shortcut for fetching logs from a relative time ago until now. Accepts a duration (e.g. '30m', '1h30m') or '`N`d' (e.g. '3d'). Maximum '7d'. Mutually exclusive with --start and --end.
</ParamField>

<ParamField body="--start" type="TEXT">
  Start of the log time range. Accepts ISO 8601 (e.g. '2026-05-14', '2026-05-14T12:00:00', '2026-05-14T12:00:00Z'). Values without a timezone designator are interpreted in the local timezone. Default is 30 minutes before the end. Window must be at most 7 days.
</ParamField>

<ParamField body="--tail" type="BOOL">
  Stream new logs as they arrive until the job stops producing them or you interrupt with Ctrl-C. Cannot be combined with the time-range or filter flags. For machine-readable streaming, prefer --output jsonl over --output json.
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

Fetch the last 30 minutes of logs

```sh theme={"system"}
baseten train job logs --job-id p7qr9qv
```

Stream logs as they arrive

```sh theme={"system"}
baseten train job logs --job-id p7qr9qv --tail
```

Fetch a day of error logs

```sh theme={"system"}
baseten train job logs --job-id p7qr9qv --since 1d --min-level error
```

### Filter output with `--jq`

Print just the log messages

```sh theme={"system"}
baseten train job logs --job-id p7qr9qv --jq '.message'
```

### Output

**Text mode (`--output text`):** One log line per row, timestamped. With --output jsonl, one JSON log record per line.

**JSON mode (`--output json`):** payload type `managementapi.GetLogsResponse`.

## metrics

```sh theme={"system"}
baseten train job metrics [OPTIONS]
```

Report CPU, memory, GPU, and storage metrics for a training job.

Each series is reported as its most recent sample. Pass --start and --end, or --since, to select the window the samples come from.

### Options

<ParamField body="--end" type="TEXT">
  End of the sample window. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone. Default is now.
</ParamField>

<ParamField body="--job-id" type="TEXT" required>
  ID of the training job.
</ParamField>

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="--since" type="TEXT">
  Shortcut for sampling from a relative time ago until now. Accepts a duration (e.g. '30m', '1h30m') or '`N`d' (e.g. '3d'). Mutually exclusive with --start and --end.
</ParamField>

<ParamField body="--start" type="TEXT">
  Start of the sample window. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone.
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

Report a job's latest metrics

```sh theme={"system"}
baseten train job metrics --job-id p7qr9qv
```

Report metrics sampled over the last hour

```sh theme={"system"}
baseten train job metrics --job-id p7qr9qv --since 1h
```

### Filter output with `--jq`

Print the GPU utilization series

```sh theme={"system"}
baseten train job metrics --job-id p7qr9qv --jq '.gpu_utilization'
```

### Output

**Text mode (`--output text`):** Table with columns: METRIC, NODE, VALUE, MEASURED.

**JSON mode (`--output json`):** payload type `managementapi.GetTrainingJobMetricsResponse`.

## stop

```sh theme={"system"}
baseten train job stop [OPTIONS]
```

Stop a running or queued training job.

Stopping is not reversible: use 'baseten train job recreate' to run the same configuration again. Checkpoints already synced remain accessible.

### Options

<ParamField body="--job-id" type="TEXT" required>
  ID of the training job.
</ParamField>

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="--yes" type="BOOL">
  Skip the interactive confirmation prompt. Required when stdin is not a terminal.
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

Stop a job, confirming interactively

```sh theme={"system"}
baseten train job stop --job-id p7qr9qv
```

Stop a job without confirmation, for scripts

```sh theme={"system"}
baseten train job stop --job-id p7qr9qv --yes
```

### Filter output with `--jq`

Print the stopped job's status

```sh theme={"system"}
baseten train job stop --job-id p7qr9qv --yes --jq '.training_job.current_status'
```

### Output

**Text mode (`--output text`):** On success, prints the stopped job's ID to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.StopTrainingJobResponse`.

## recreate

```sh theme={"system"}
baseten train job recreate [OPTIONS]
```

Create a new training job from an existing job's configuration.

The original job is left as it is. The new job gets a new ID and starts from the beginning.

### Options

<ParamField body="--job-id" type="TEXT" required>
  ID of the training job.
</ParamField>

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

Rerun a job's configuration

```sh theme={"system"}
baseten train job recreate --job-id p7qr9qv
```

### Filter output with `--jq`

Print just the new job's ID

```sh theme={"system"}
baseten train job recreate --job-id p7qr9qv --jq '.training_job.id'
```

### Output

**Text mode (`--output text`):** On success, prints the new job's ID to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.RecreateTrainingJobResponse`.

## update

```sh theme={"system"}
baseten train job update [OPTIONS]
```

Update a queued training job's priority. Higher values are dequeued first.

Only jobs in the PENDING state can have their priority changed.

### Options

<ParamField body="--job-id" type="TEXT" required>
  ID of the training job.
</ParamField>

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--priority" type="INTEGER" required>
  New queue priority. Higher values are dequeued first.
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

Raise a queued job's priority

```sh theme={"system"}
baseten train job update --job-id p7qr9qv --priority 10
```

### Filter output with `--jq`

Print the job's new priority

```sh theme={"system"}
baseten train job update --job-id p7qr9qv --priority 10 --jq '.training_job.priority'
```

### Output

**Text mode (`--output text`):** On success, prints the job's ID and new priority to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.UpdateTrainingJobResponse`.

## download

```sh theme={"system"}
baseten train job download [OPTIONS]
```

Download the code archive that was uploaded with a training job as an uncompressed tar.

Exactly one of --out-file or --out-dir is required. --out-file writes the raw tar bytes; --out-dir extracts the tar into the directory. Use --overwrite to replace an existing file or write into a non-empty directory.

This is the job's input code, not its checkpoints; use 'baseten train checkpoint files' for those.

### Options

<ParamField body="--job-id" type="TEXT" required>
  ID of the training job.
</ParamField>

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="--out-dir" type="TEXT">
  Extract the artifact tar into this directory.

  Mutually exclusive with other flags in group `download-out`.
</ParamField>

<ParamField body="--out-file" type="TEXT">
  Save the artifact as an uncompressed tar file at this path.

  Mutually exclusive with other flags in group `download-out`.
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--overwrite" type="BOOL">
  Allow overwriting an existing file or non-empty directory.
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

Extract a job's code into a directory

```sh theme={"system"}
baseten train job download --job-id p7qr9qv --out-dir ./job-code
```

Save the archive as a tar file instead of extracting it

```sh theme={"system"}
baseten train job download --job-id p7qr9qv --out-file job.tar
```

### Filter output with `--jq`

Print just the destination path

```sh theme={"system"}
baseten train job download --job-id p7qr9qv --out-file job.tar --jq '.out_file'
```

### Output

**Text mode (`--output text`):** Writes the artifact to disk; prints progress and the final destination path to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `cmd.TrainJobDownloadResult`.

On success, stdout is a JSON object naming the job, with either out\_file or out\_dir set to the path written.
