Prerequisites
Before starting, ensure you have Python 3.10 or later installed.Setup Your Workspace
Initialize Your Workspace
Set up a new workspace for developing environments:This command:
- Creates a Python project (if needed)
- Installs
verifiers - Creates the recommended workspace structure
- Downloads starter configuration files
Create Your First Environment
Initialize Environment Template
Create a new environment from the template:This creates a new module in
./environments/my_env/ with:Implement Your Environment
Edit
environments/my_env/my_env.py with your environment logic:The
load_environment function is the entry point for your environment. It must return an Environment instance and can accept custom arguments.Run Your First Evaluation
Run Local Evaluation
Evaluate your environment with any OpenAI-compatible model:This will:
- Load your environment
- Run rollouts with the specified model
- Calculate rewards and metrics
- Save results locally
By default, evaluations use Prime Inference. Configure custom API endpoints in
./configs/endpoints.toml.Working with Existing Environments
Environment Types
Verifiers supports multiple environment patterns:SingleTurnEnv
Simple Q&A tasks with a single model response
ToolEnv
Environments with stateless Python function tools
StatefulToolEnv
Tools requiring per-rollout state (sandboxes, sessions)
MultiTurnEnv
Custom multi-turn interactions, games, agents
Building Complex Environments
Adding Tools
Create tool-enabled environments for agent tasks:Using Sandboxes
For code execution tasks, use sandboxed environments:Publishing Your Environment
Next Steps
Environments Guide
Learn about datasets, rubrics, and custom protocols
Evaluation Guide
Deep dive into evaluation configurations
Training Guide
Train models with reinforcement learning
API Reference
Explore the complete API documentation
Common Patterns
Load dataset from Hugging Face
Load dataset from Hugging Face
Multiple reward functions
Multiple reward functions
Custom system prompts
Custom system prompts
Using API keys
Using API keys
Troubleshooting
Environment not found after install
Environment not found after install
Make sure you ran
prime env install <env-name> and the environment has a valid load_environment function.API endpoint errors
API endpoint errors
Configure your endpoints in
./configs/endpoints.toml. See the evaluation guide for details.Import errors
Import errors
Ensure all dependencies are listed in your environment’s
pyproject.toml and installed.