Skip to content

BenSturgeon/ai-safety-camp-2024-model-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Safety Camp - Model Agents

Research on how to both identify optimization targets in model agents, and how to robustly influence agent behavior based on modifying those targets.

Prerequisites

  • Python 3.9 (specific version required)
  • Qt5 (for macOS users)
  • Git

Installation Options

Option 1: Using uv (Recommended for Speed)

# Install uv if you haven't already
pip install uv

# Create virtual environment with Python 3.9
uv venv --python=3.9

# Activate the environment
source .venv/bin/activate

# Install dependencies
uv pip install -r requirements.txt

# Install procgen from source (required)
git clone https://github.com/openai/procgen.git
cd procgen
git checkout 1d6dcd9f8ac5544c0f99d3b82c3a5ecb27e481f6  # version 0.10.7
python -m pip install -e .

# Install procgen-tools
python -m pip install git+https://github.com/UlisseMini/procgen-tools.git

Note when testing: it is critical to use gym and not gymnasium when running procgen.

Also, ensure that Qt5 is installed when building procgen from source

Option 2: Using poetry

# Install poetry if you haven't already
pip install poetry

# Configure poetry to use Python 3.9
poetry env use python3.9

# Install dependencies
poetry install

# Enter poetry shell
poetry shell

# Install procgen from source (required)
git clone https://github.com/openai/procgen.git
cd procgen
git checkout 1d6dcd9f8ac5544c0f99d3b82c3a5ecb27e481f6  # version 0.10.7
python -m pip install -e .

# Install procgen-tools
python -m pip install git+https://github.com/UlisseMini/procgen-tools.git

Option 3: Using pip

# Create virtual environment with Python 3.9
python3.9 -m venv .venv

# Activate virtual environment
source .venv/bin/activate

# Upgrade pip
python -m pip install --upgrade pip

# Install dependencies
python -m pip install -r requirements.txt

# Install procgen from source (required)
git clone https://github.com/openai/procgen.git
cd procgen
git checkout 1d6dcd9f8ac5544c0f99d3b82c3a5ecb27e481f6  # version 0.10.7
python -m pip install -e .

# Install procgen-tools
python -m pip install git+https://github.com/UlisseMini/procgen-tools.git

macOS Setup

macOS users need to install Qt5 before building procgen:

# Install Qt5
brew install qt@5

# Add Qt to your PATH (add this to your ~/.zshrc or ~/.bashrc)
export PATH="/usr/local/opt/qt@5/bin:$PATH"

Known Issues and Solutions

Procgen Build Issues

If you encounter build errors with procgen, modify CMakeLists.txt in the procgen source:

# Find this line:
# add_compile_options(-Wextra -Wshadow -Wall -Wformat=2 -Wundef -Wvla -Wmissing-include-dirs -Wnon-virtual-dtor -Werror)

# Replace it with:
add_compile_options(-Wextra -Wshadow -Wall -Wformat=2 -Wundef -Wvla -Wmissing-include-dirs -Wnon-virtual-dtor -Wno-unused-parameter -Wno-unused-variable)

Environment Issues

  • Always use python -m pip instead of just pip when not using uv or poetry
  • Verify your environment is correct:
which python
python --version  # should show Python 3.9.x

Version Conflicts

  • Use a fresh virtual environment if you encounter persistent issues
  • Make sure procgen is installed before procgen-tools
  • Verify you're using Python 3.9

Verifying Installation

After installation, verify everything works:

python
>>> import procgen_tools
>>> import procgen

Project Structure

.
├── requirements.txt          # Core dependencies
├── pyproject.toml           # Poetry configuration
├── .python-version          # Python version file
└── .gitignore              # Includes virtual environments and build artifacts

About

AI safety research on goal specification for model agents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages