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

# Training

> Inspect post-training resources, sessions, and checkpoints, and prepare trained LoRA adapters for FP4 inference from your terminal.

The `tg training` commands list and inspect the model resources, training sessions, and checkpoints of [post-training](/docs/post-training/overview). They're read-only: to create or stop a resource or session, use the [Python SDK](/docs/post-training/model-resources) or the console.

The `tg training prepare-for-fp4-inference` commands, aliased `tg training fp4`, run [FP4 preparation jobs](/docs/post-training/prepare-for-fp4-inference). Each job merges a low-rank adapter (LoRA) from a post-training session into its base model and quantizes the result to FP4 for [dedicated model inference](/docs/dedicated-endpoints/overview).

<Note>
  Commands run against the [project](/docs/projects) your API key belongs to. Resources, sessions, checkpoints, adapters, and jobs in other projects aren't visible.
</Note>

## List model resources

List the model resources in your project, newest first.

```bash Shell theme={null}
tg training ls-resources --status ready
```

### Parameters

| Flag | Description |
| - | - |
| `--limit [integer]` | Maximum number of resources to return, from 1 to 100. |
| `--after [string]` | The cursor to start from, to page through a long list. |
| `--created-by [string]` | Only resources created by this user ID. Pass `me` for your own. |
| `--status [string]` | Only resources in this status: `pending`, `creating`, `ready`, `error`, `stopping`, or `stopped`. Pass one status per call, because the API rejects a request with more than one. |

## List training sessions

List the training sessions in your project, newest first.

```bash Shell theme={null}
tg training ls-sessions --created-by me
```

### Parameters

| Flag | Description |
| - | - |
| `--limit [integer]` | Maximum number of sessions to return, from 1 to 100. |
| `--after [string]` | The cursor to start from, to page through a long list. |
| `--created-by [string]` | Only sessions created by this user ID. Pass `me` for your own. |
| `--resources/--model-resources-id [string]` | Only sessions attached to this model resource. |
| `--status [string]` | Only sessions in this status: `creating`, `running`, `stopping`, `stopped`, `error`, or `expired`. Pass one status per call. |

## List checkpoints

List the training and inference checkpoints in your project, newest first.

```bash Shell theme={null}
tg training ls-checkpoints --type inference --session 2b7e4c1a-9d3f-4e6a-8c5b-1f0a7d9e3b42
```

For an inference checkpoint, the **Model** column shows the model registry ID (`ml_...`) of its registered adapter or merged model, which is the ID you [deploy](/docs/post-training/deployment) or [prepare for FP4 inference](#create-an-fp4-job).

### Parameters

| Flag | Description |
| - | - |
| `--limit [integer]` | Maximum number of checkpoints to return, from 1 to 100. |
| `--after [string]` | The cursor to start from, to page through a long list. |
| `--type [string]` | Only `training` or only `inference` checkpoints. |
| `--session/--session-id [string]` | Only checkpoints from this training session. |

## Get a resource, session, or checkpoint

Print the details of one model resource, training session, or checkpoint. The CLI works out which kind the ID belongs to.

```bash Shell theme={null}
tg training get 2b7e4c1a-9d3f-4e6a-8c5b-1f0a7d9e3b42
```

A session's details include its status, base model, current step, model resource, and checkpoint counts. A checkpoint's details include its type, session, step, and LoRA rank, but not its model registry IDs, so use [`ls-checkpoints`](#list-checkpoints) to find those.

### Parameters

| Flag | Description |
| - | - |
| `ID` | (**required**) A model resource ID, training session ID, or checkpoint ID. |

## Create an FP4 job

Start an FP4 preparation job for an adapter.

```bash Shell theme={null}
tg training fp4 create ml_abc123
```

Before it submits the job, the CLI estimates it, prints the price and expected running time, and asks for confirmation. If the price exceeds your available credit, the confirmation includes a warning, because the API rejects jobs your credit can't cover. On success, the CLI prints the job ID (`shp-quant-...`).

### Parameters

| Flag | Description |
| - | - |
| `ADAPTER-OBJECT-ID` | (**required**) The adapter's model registry ID (`ml_...`). See [Find the adapter ID](/docs/post-training/prepare-for-fp4-inference#find-the-adapter-id). |
| `--adapter-revision-id/-r [string]` | The adapter revision ID (`rv_...`) to prepare. Defaults to the adapter's current revision. |
| `--calibration-file/-c [string]` | A JSONL conversation dataset of at most 64 MiB, with `messages` and, optionally, `tools` in each row. The job uses it for half of the calibration corpus. Pass a Files API ID or a local path. The CLI uploads a local file with purpose `calibration`. See [Calibrate on your own data](/docs/post-training/prepare-for-fp4-inference#calibrate-on-your-own-data). |
| `--confirm/-y` | Skip the confirmation prompt. |
| `--watch/-w` | Wait for the job to finish, printing each status change and new event. See [Get an FP4 job](#get-an-fp4-job). |
| `--poll-interval [number]` | Seconds between status checks when `--watch` is set. Default: `10`. |

## Estimate an FP4 job

Estimate a job's price and running time without creating it.

```bash Shell theme={null}
tg training fp4 estimate ml_abc123
```

The running time excludes the wait for GPU capacity. If the price exceeds your available credit, the CLI prints a warning with your credit limit. A successful estimate also confirms that the adapter is eligible.

### Parameters

| Flag | Description |
| - | - |
| `ADAPTER-OBJECT-ID` | (**required**) The adapter's model registry ID (`ml_...`). |
| `--adapter-revision-id/-r [string]` | The adapter revision ID (`rv_...`) to price. Defaults to the adapter's current revision. |
| `--calibration-file/-c [string]` | A calibration dataset, as for `create`. The CLI checks the file and prices the job with it. |

## Get an FP4 job

Print a job's details: its status, the adapter and base model it resolved, and the prepared model's IDs once it completes.

```bash Shell theme={null}
tg training fp4 get shp-quant-1a2b3c4d-5e6f

# Wait for the job to finish
tg training fp4 get shp-quant-1a2b3c4d-5e6f --watch
```

With `--watch`, the CLI checks the job every `--poll-interval` seconds and prints each status change and new event. It exits when the job reaches `completed`, `cancelled`, `error`, or `user_error`. On `completed`, it prints the prepared model's ID and revision ID.

`--watch` retries connection failures, `5xx` errors, and rate limits with backoff. After five minutes of consecutive failures, it stops and prints the command to resume. Stopping the CLI doesn't stop the job.

With or without `--watch`, `get` exits with a non-zero code when the job's status is `error` or `user_error`.

`get` is an alias of `retrieve`.

### Parameters

| Flag | Description |
| - | - |
| `JOB-ID` | (**required**) The job ID (`shp-quant-...`). |
| `--watch/-w` | Wait for the job to reach a terminal status, printing each status change and new event. |
| `--poll-interval [number]` | Seconds between status checks when `--watch` is set. Default: `10`. |

## List FP4 jobs

List the FP4 preparation jobs in your project, newest first, 20 per page.

```bash Shell theme={null}
tg training fp4 ls
```

The table shows each job's ID, adapter, status, prepared model, and creation time. When more jobs remain, the CLI prints the command for the next page.

`ls` is an alias of `list`.

### Parameters

| Flag | Description |
| - | - |
| `--after [string]` | The job ID to start after, from the previous page's output. |

## List FP4 job events

List a job's events, such as the job's start, the end of each phase, and any errors.

```bash Shell theme={null}
tg training fp4 list-events shp-quant-1a2b3c4d-5e6f
```

A failed job ends with a `SHAPING_USER_ERROR` or `SHAPING_ERROR` event. A `SHAPING_USER_ERROR` event's message says how to fix the input.

### Parameters

| Flag | Description |
| - | - |
| `JOB-ID` | (**required**) The job ID (`shp-quant-...`). |

## Cancel an FP4 job

Cancel a job before it completes.

```bash Shell theme={null}
tg training fp4 cancel shp-quant-1a2b3c4d-5e6f
```

The CLI asks for confirmation first. The job moves to `cancel_requested` right away and to `cancelled` once the run stops. A job that's already in `cancel_requested` or a terminal status can't be cancelled.

### Parameters

| Flag | Description |
| - | - |
| `JOB-ID` | (**required**) The job ID (`shp-quant-...`). |
| `--force/-y` | Skip the confirmation prompt. |

## Global options

Every command also accepts the [global parameters](/reference/cli/getting-started#global-parameters), including `--json` for machine-readable output. The CLI turns `--json` on by default when it detects an AI agent.

In `--json` or `--non-interactive` mode, and whenever the CLI doesn't run in an interactive terminal (for example, in CI or with its output redirected), `create` and `cancel` don't ask for confirmation. Check the price with `estimate` before you script `create` or let an agent run it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.