Skip to main content

LLM Training API

Complete API reference for LLM training.

LLMTrainingParams

The main configuration class for LLM training.

Basic Parameters

Trainer Selection

Training Hyperparameters

PEFT/LoRA Configuration

Data Processing

model_max_length Auto-Detection: This parameter is now auto-detected from the model’s config. For example, Gemma 2 (8192 tokens) and Gemma 3 (32K-128K tokens depending on variant) will automatically use their native context lengths. The default 2048 is only used as a fallback when auto-detection fails. Set explicitly to override.

DPO Parameters

ORPO Parameters

GRPO Parameters

GRPO does not require data_path — the dataset is built by the environment’s build_dataset() method. Install pip install aitraining[vllm] for vLLM support.
See GRPO Training for the full environment interface (build_dataset, score_episode, get_tools).

Knowledge Distillation

Logging & Saving

Hub Integration

Running Training

Complete Example

Next Steps

Python SDK

Full SDK reference

DPO Training

DPO deep dive