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

AgentTrainer

Wrapper class for training agents with custom environments using various backends.

Constructor

Two ways to plug in your agent: pass either workflow_class (a Workflow subclass) or agent_run_func (a plain rollout function for the AgentSdk path).
type | None
Workflow class to use for training (e.g., SimpleWorkflow, MultiTurnWorkflow).
dict | None
Arguments to pass to the workflow class.
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"]
Dataset | None
Training dataset.
Dataset | None
Validation dataset.
Literal['verl', 'fireworks', 'tinker']
default:"verl"
Training backend:
  • "verl": Standard distributed PPO via the verl framework
  • "fireworks": Pipeline-based variant (workflow-only) for the Fireworks workflow API
  • "tinker": Single-machine LoRA training via tinker (workflow-only)
Callable | None
Plain rollout function — drives the AgentSdk path. Use this or workflow_class, not both.
The legacy agent_class + env_class parameters that drove the AgentExecutionEngine rollout have been removed. Port your agent to either a Workflow or an AgentFlow — see the cookbooks/ directory for examples.

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: