Skip to main content
The trainer module provides high-level APIs for training agents using reinforcement learning with PPO.

AgentTrainer

Backend-agnostic wrapper for training agents with custom workflows or AgentFlows. As of the unified-trainer graduation, rllm.trainer.AgentTrainer resolves to rllm.trainer.unified_trainer.AgentTrainer.
For the full constructor reference (including sandbox auto-wiring, agent_flow / evaluator / hooks plumbing, and the verl / tinker backends), see the unified trainer page. A condensed view:

Constructor

Two ways to plug in your agent: pass either workflow_class (a Workflow subclass) or agent_flow (an AgentFlow built with the AgentSdk).
workflow_class
type | None
Workflow class to use for training (e.g., SimpleWorkflow, MultiTurnWorkflow).
workflow_args
dict | None
Arguments to pass to the workflow class.
config
dict | list[str] | None
Configuration overrides. Can be:
  • Dictionary with dot notation keys: {"data.train_batch_size": 8}
  • List of strings: ["data.train_batch_size=8", "trainer.total_epochs=3"]
train_dataset
Dataset | None
Training dataset.
val_dataset
Dataset | None
Validation dataset.
backend
Literal['verl', 'tinker']
default:"verl"
Training backend:
  • "verl": Distributed PPO via the verl framework
  • "tinker": LoRA training via tinker
agent_flow
Any | None
AgentFlow object (from the AgentSdk path). Use this or workflow_class, not both.
The verl-specific legacy trainer lives at rllm.trainer.agent_trainer.AgentTrainer. New code should prefer the unified from rllm.trainer import AgentTrainer.

Methods

train

Start the training process.

Configuration

The trainer uses Hydra for configuration management. Default config is at rllm/trainer/config/agent_ppo_trainer.yaml.

Common Config Overrides


Example: Training with SimpleWorkflow


Example: Config Overrides


Running Training

Run training scripts with Hydra CLI overrides: