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

# Command Structure

> Understanding the AITraining CLI syntax

# Command Structure

The AITraining CLI follows a consistent pattern for all commands.

## Basic Syntax

```bash theme={null}
aitraining <command> [options]
```

## Available Commands

| Command                 | Description                                            |
| ----------------------- | ------------------------------------------------------ |
| `llm`                   | Train large language models (LLMs)                     |
| `chat`                  | Launch chat interface for inference                    |
| `api`                   | Start the training API server                          |
| `text-classification`   | Train text classification models                       |
| `text-regression`       | Train text regression models                           |
| `image-classification`  | Train image classification models                      |
| `image-regression`      | Train image regression models                          |
| `token-classification`  | Train NER/token classification                         |
| `seq2seq`               | Train sequence-to-sequence models                      |
| `tabular`               | Train tabular data models                              |
| `sentence-transformers` | Train sentence embedding models                        |
| `object-detection`      | Train object detection models                          |
| `vlm`                   | Train vision-language models                           |
| `extractive-qa`         | Train extractive QA models                             |
| `tools`                 | Utility tools: `merge-llm-adapter`, `convert_to_kohya` |
| `setup`                 | Initial setup and configuration                        |
| `spacerunner`           | Run training on Hugging Face Spaces                    |

<Note>
  **SpaceRunner requirements**: The `spacerunner` command requires `--project-name`, `--script-path`, `--username`, `--token`, and `--backend` to be specified.
</Note>

## Getting Help

### General Help

```bash theme={null}
aitraining --help
```

### Command-Specific Help

```bash theme={null}
aitraining llm --help
```

### Trainer-Specific Help

For LLM training, see parameters for a specific trainer:

```bash theme={null}
aitraining llm --trainer sft --help
aitraining llm --trainer dpo --help
aitraining llm --trainer orpo --help
aitraining llm --trainer ppo --help
```

Or use preview mode:

```bash theme={null}
aitraining llm --preview-trainer dpo --help
```

## Global Options

These options are truly global (work at the top level):

| Option            | Description                |
| ----------------- | -------------------------- |
| `--help`, `-h`    | Show help message          |
| `--version`, `-v` | Show version               |
| `--config`        | Load from YAML config file |

<Note>
  The `--backend` option is available on most training commands but is registered per-command, not globally. See [Global Options](/cli/global-options) for backend details.
</Note>

## Config File Usage

Instead of command-line arguments, use a YAML config:

```bash theme={null}
aitraining --config training_config.yaml
```

## Examples

### Basic LLM Training

```bash theme={null}
aitraining llm --train \
  --model google/gemma-3-270m \
  --data-path ./data \
  --project-name my-model \
  --trainer sft
```

### With LoRA

```bash theme={null}
aitraining llm --train \
  --model meta-llama/Llama-3.2-1B \
  --data-path ./data \
  --project-name my-lora-model \
  --peft \
  --lora-r 16 \
  --lora-alpha 32
```

### Text Classification

```bash theme={null}
aitraining text-classification \
  --model bert-base-uncased \
  --data-path ./reviews.csv \
  --text-column text \
  --target-column label \
  --project-name sentiment-model
```

## Interactive Mode

Run without arguments to start the interactive wizard:

```bash theme={null}
aitraining
```

Or explicitly:

```bash theme={null}
aitraining llm --interactive
```

## Next Steps

<CardGroup cols={2}>
  <Card title="LLM Training" href="/cli/llm-training">
    Full guide to training LLMs
  </Card>

  <Card title="YAML Configs" href="/cli/yaml-configs">
    Using configuration files
  </Card>
</CardGroup>
