> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/primeintellect-ai/verifiers/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install Verifiers and set up your development environment

## Requirements

Verifiers requires Python 3.10 or later (up to Python 3.13).

## Installation Methods

<Tabs>
  <Tab title="uv (Recommended)">
    Install Verifiers using `uv`, the fast Python package manager:

    ### Install uv

    If you don't have `uv` installed:

    ```bash theme={null}
    curl -LsSf https://astral.sh/uv/install.sh | sh
    ```

    ### Install Verifiers

    <CodeGroup>
      ```bash Core Package theme={null}
      uv add verifiers
      ```

      ```bash With Training (RL) theme={null}
      uv add 'verifiers[rl]'
      ```

      ```bash All Features theme={null}
      uv add 'verifiers[all]'
      ```
    </CodeGroup>

    ### Development Installation

    For contributing to Verifiers:

    ```bash theme={null}
    git clone https://github.com/PrimeIntellect-ai/verifiers.git
    cd verifiers

    # CPU-only development
    uv sync

    # GPU-based trainer development
    uv sync --all-extras && uv pip install flash-attn --no-build-isolation

    # Install pre-commit hooks
    uv run pre-commit install
    ```
  </Tab>

  <Tab title="pip">
    Install Verifiers using pip:

    <CodeGroup>
      ```bash Core Package theme={null}
      pip install verifiers
      ```

      ```bash With Training (RL) theme={null}
      pip install 'verifiers[rl]'
      ```

      ```bash All Features theme={null}
      pip install 'verifiers[all]'
      ```
    </CodeGroup>

    <Note>
      For best compatibility, use a virtual environment:

      ```bash theme={null}
      python -m venv .venv
      source .venv/bin/activate  # On Windows: .venv\Scripts\activate
      pip install verifiers
      ```
    </Note>
  </Tab>

  <Tab title="poetry">
    Install Verifiers using Poetry:

    <CodeGroup>
      ```bash Core Package theme={null}
      poetry add verifiers
      ```

      ```bash With Training (RL) theme={null}
      poetry add 'verifiers[rl]'
      ```

      ```bash All Features theme={null}
      poetry add 'verifiers[all]'
      ```
    </CodeGroup>

    In your `pyproject.toml`:

    ```toml theme={null}
    [tool.poetry.dependencies]
    verifiers = "^0.1.9"

    # Or with extras
    verifiers = { version = "^0.1.9", extras = ["rl"] }
    ```
  </Tab>
</Tabs>

## Optional Features

Verifiers includes several optional feature sets that can be installed as extras:

<CardGroup cols={2}>
  <Card title="rl" icon="brain">
    **Reinforcement Learning**

    Includes PyTorch, transformers, vLLM, and training utilities.

    ```bash theme={null}
    uv add 'verifiers[rl]'
    ```
  </Card>

  <Card title="rg" icon="dumbbell">
    **Reasoning Gym**

    Integration with reasoning-gym environments.

    ```bash theme={null}
    uv add 'verifiers[rg]'
    ```
  </Card>

  <Card title="ta" icon="gamepad">
    **TextArena**

    Text-based game environments.

    ```bash theme={null}
    uv add 'verifiers[ta]'
    ```
  </Card>

  <Card title="browser" icon="globe">
    **Browser Automation**

    Web browsing environments with Browserbase.

    ```bash theme={null}
    uv add 'verifiers[browser]'
    ```
  </Card>

  <Card title="openenv" icon="box">
    **OpenEnv**

    OpenEnv environment integration.

    ```bash theme={null}
    uv add 'verifiers[openenv]'
    ```
  </Card>
</CardGroup>

## Prime CLI Installation

The Prime CLI provides tools for environment management, evaluation, and training:

```bash theme={null}
# Install Prime CLI
uv tool install prime

# Verify installation
prime --version

# Log in to Prime Intellect
prime login
```

<Note>
  The Prime CLI is required for:

  * Environment initialization and publishing
  * Running evaluations
  * Managing training jobs
  * Accessing the Environments Hub
</Note>

## Verifying Installation

Verify your Verifiers installation:

```python theme={null}
import verifiers as vf

print(f"Verifiers version: {vf.__version__}")

# Test with a simple environment
from datasets import Dataset

def load_environment():
    dataset = Dataset.from_list([
        {"prompt": [{"role": "user", "content": "Hello!"}]}
    ])
    
    async def dummy_reward(completion) -> float:
        return 1.0
    
    rubric = vf.Rubric(funcs=[dummy_reward])
    return vf.SingleTurnEnv(dataset=dataset, rubric=rubric)

env = load_environment()
print(f"Environment loaded: {type(env).__name__}")
```

## Setting Up a Workspace

After installing Verifiers, set up a development workspace:

<Steps>
  <Step title="Navigate to Your Project Directory">
    ```bash theme={null}
    cd ~/dev/my-project
    ```
  </Step>

  <Step title="Run Workspace Setup">
    ```bash theme={null}
    prime lab setup
    ```

    This creates:

    * Python project structure (if needed)
    * Configuration directory (`configs/`)
    * Environment directory (`environments/`)
    * Example configuration files
  </Step>

  <Step title="Verify Setup">
    ```bash theme={null}
    ls -la
    # Should show: configs/, environments/, pyproject.toml, etc.
    ```
  </Step>
</Steps>

## Configuration

### API Endpoints

Configure API endpoints for model inference in `configs/endpoints.toml`:

```toml theme={null}
# Prime Inference (default)
[prime]
base_url = "https://api.primeintellect.ai/v1"
api_key_env = "PRIME_API_KEY"

# Custom OpenAI-compatible endpoint
[custom]
base_url = "https://your-api.com/v1"
api_key_env = "YOUR_API_KEY"

# Local vLLM server
[local]
base_url = "http://localhost:8000/v1"
```

### Environment Variables

Set up required environment variables:

```bash theme={null}
# Prime Intellect API key
export PRIME_API_KEY="your-prime-api-key"

# OpenAI API key (if using OpenAI models)
export OPENAI_API_KEY="your-openai-api-key"

# Anthropic API key (if using Claude)
export ANTHROPIC_API_KEY="your-anthropic-api-key"
```

<Tip>
  Store environment variables in a `.env` file and load them with:

  ```bash theme={null}
  export $(cat .env | xargs)
  ```
</Tip>

## Updating Verifiers

<Tabs>
  <Tab title="uv">
    ```bash theme={null}
    # Update to latest version
    uv add --upgrade verifiers

    # Update to specific version
    uv add verifiers==0.1.9
    ```
  </Tab>

  <Tab title="pip">
    ```bash theme={null}
    # Update to latest version
    pip install --upgrade verifiers

    # Update to specific version
    pip install verifiers==0.1.9
    ```
  </Tab>

  <Tab title="poetry">
    ```bash theme={null}
    # Update to latest version
    poetry update verifiers

    # Update to specific version
    poetry add verifiers==0.1.9
    ```
  </Tab>
</Tabs>

## Dependencies

### Core Dependencies

Verifiers includes these core dependencies:

* `anthropic` - Anthropic API client
* `datasets` - Hugging Face datasets
* `openai` - OpenAI API client
* `pydantic` - Data validation
* `rich` - Terminal formatting
* `textual` - Terminal UI
* `prime-sandboxes` - Sandboxed code execution
* `mcp` - Model Context Protocol support

### RL Dependencies (Optional)

With `verifiers[rl]`:

* `torch` - PyTorch deep learning framework
* `transformers` - Hugging Face transformers
* `vllm` - Fast LLM inference
* `accelerate` - Distributed training
* `peft` - Parameter-efficient fine-tuning
* `wandb` - Experiment tracking
* `deepspeed` - Training optimization
* `flash-attn` - Optimized attention

## GPU Support

For GPU-accelerated training:

<Steps>
  <Step title="Install CUDA Toolkit">
    Install CUDA 12.1 or later from [NVIDIA](https://developer.nvidia.com/cuda-downloads).
  </Step>

  <Step title="Install Verifiers with RL">
    ```bash theme={null}
    uv add 'verifiers[rl]'
    ```
  </Step>

  <Step title="Install Flash Attention (Optional)">
    For optimized attention:

    ```bash theme={null}
    uv pip install flash-attn --no-build-isolation
    ```
  </Step>

  <Step title="Verify GPU Access">
    ```python theme={null}
    import torch
    print(f"CUDA available: {torch.cuda.is_available()}")
    print(f"GPU count: {torch.cuda.device_count()}")
    ```
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Import errors after installation">
    Ensure you're in the correct virtual environment:

    ```bash theme={null}
    # Check Python location
    which python

    # Reinstall if needed
    uv add --reinstall verifiers
    ```
  </Accordion>

  <Accordion title="CUDA/GPU not detected">
    Check your CUDA installation:

    ```bash theme={null}
    # Check CUDA version
    nvcc --version

    # Check PyTorch CUDA
    python -c "import torch; print(torch.version.cuda)"
    ```

    Reinstall PyTorch with CUDA support if needed.
  </Accordion>

  <Accordion title="Version conflicts">
    Create a fresh virtual environment:

    ```bash theme={null}
    uv venv --python 3.12 .venv
    source .venv/bin/activate
    uv add verifiers
    ```
  </Accordion>

  <Accordion title="Prime CLI not found">
    Ensure `uv` tools are in your PATH:

    ```bash theme={null}
    # Add to ~/.bashrc or ~/.zshrc
    export PATH="$HOME/.local/bin:$PATH"

    # Reload shell
    source ~/.bashrc
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Quick Start Guide" icon="rocket" href="/quickstart">
    Create your first environment in minutes
  </Card>

  <Card title="Environment Guide" icon="book" href="/docs/environments">
    Learn about datasets, rubrics, and tools
  </Card>

  <Card title="Examples" icon="code" href="https://github.com/PrimeIntellect-ai/verifiers/tree/main/environments">
    Browse example environments
  </Card>

  <Card title="API Reference" icon="file-code" href="/docs/reference">
    Explore the complete API
  </Card>
</CardGroup>
