an environment is the specification of a task you want to train a model on. it defines three things:
- tools: what the model can do (search a corpus, call an API, execute code, modify a file)
- rewards: how the model’s output is scored (exact match, LLM judge, programmatic check)
- dataset: how your raw data maps to prompts and per-example data
during training, the model interacts with your environment thousands of times. each interaction is a rollout: the model receives a prompt, generates a response (optionally calling tools), and your reward function scores the result. the model updates its weights to produce higher-scoring responses over time.
choosing a base class
benchmax exposes the environment stack at three levels. BaseEnv is the default; the other two exist for tasks it doesn’t fit.
| base class | what it is | when to use it |
|---|---|---|
BaseEnv | the standard chat/tool loop: you implement the dataset, rewards, and optionally tools | the default choice for new environments. see base env |
HarborEnv | an adapter that runs harbor agents, sandboxes, and verifiers | you have an existing harbor task, or an agent harness that owns its own loop. see harbor env |
Environment | the abstract base that BaseEnv and HarborEnv extends from | need full control of the rollout behavior that can’t be done with BaseEnv |
testing and logging apply to any environment, whichever base class you pick.