# Verifiers

> Build verifiable-reward environments to train and evaluate LLMs with reinforcement learning

- Category: Training & Fine-Tuning / RLHF & Alignment
- Language: Python
- Repository: https://github.com/PrimeIntellect-ai/verifiers
- Canonical page: https://ai-tldr.dev/tools/verifiers/

## In short

Verifiers is a Python library from Prime Intellect for creating environments that train and evaluate large language models. It sits in the RLHF & Alignment category of the Training & Fine-Tuning tools and is open-source, written in Python. To get started: install uv and the prime CLI.

## Overview

Verifiers is a Python library from Prime Intellect for creating environments that train and evaluate large language models. An environment bundles everything a task needs: a dataset of inputs, a harness that gives the model its tools and context, and a rubric (reward function) that scores how well the model did.

It is aimed at researchers and engineers working on reinforcement-learning fine-tuning and alignment. Because the reward is defined as code you control, the same environment can be reused for RL training, capability evaluation, synthetic-data generation, and experimenting with agent harnesses.

Within the RLHF and alignment space, Verifiers focuses on the environment and reward side rather than the trainer. It integrates with Prime Intellect's Environments Hub and the prime-rl training framework, and environments are self-contained Python modules you can share and run.

## What it does

- Environments bundle a dataset, a model harness (tools, sandboxes, context management), and a rubric reward function
- Environments are self-contained Python modules that expose a load_environment function
- Works for RL training, evaluation, synthetic-data generation, and agent-harness experiments
- prime CLI scaffolds workspaces and environment templates (prime lab setup, prime env init)
- Integrates with the Environments Hub and the prime-rl training framework
- Includes a nano RL trainer (vf.RLTrainer) and multi-turn environment support

## Getting started

Verifiers uses uv for dependencies and the prime CLI to set up workspaces and scaffold environments.

1. Install uv and the prime CLI

   Install the uv package manager, then install and log in to the prime CLI.

```bash
# install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# install the prime CLI
uv tool install prime
# log in to the Prime Intellect platform
prime login
```

2. Set up a workspace

   Create a workspace, which sets up a uv project and installs verifiers. To add verifiers to an existing project instead, run uv add verifiers && prime lab setup --skip-install.

```bash
prime lab setup
```

3. Initialize an environment template

   Scaffold a new self-contained environment module under environments/.

```bash
prime env init my-env
```

4. Define load_environment

   Each environment module exposes a load_environment function that returns an environment object.

```python
# my_env.py
import verifiers as vf

def load_environment(dataset_name: str = 'gsm8k') -> vf.Environment:
    dataset = vf.load_example_dataset(dataset_name)
    ...
```

## When to use it

- Fine-tune an LLM with reinforcement learning against a custom, code-defined reward
- Build a reusable benchmark to evaluate model capabilities on a specific task
- Generate synthetic training data by running models through a task environment
- Prototype and test agent harnesses with tools and sandboxes before training
