This guide walks you through setting up and running AgentBench with Azure OpenAI on Windows using WSL2.
- Use Ubuntu
- Windows 10/11 with WSL2 enabled
- Docker Desktop for Windows with WSL2 integration enabled
- An Azure OpenAI resource with a deployed model (e.g.,
gpt-4o-mini)
- Open Docker Desktop
- Go to Settings → Resources → WSL Integration
- Enable integration with your WSL2 distro (e.g., Ubuntu)
- Click Apply & Restart
# In WSL2 terminal
cd ~
git clone https://github.com/Jay-Dev01/AgentBench.git
cd AgentBench
git checkout ubuntu-azure-setup# Install Python 3.11 if not available
sudo apt update
sudo apt install -y python3.11 python3.11-venv python3.11-dev
# Create virtual environment
python3.11 -m venv venv
source venv/bin/activate
# Install dependencies
pip install --upgrade pip
pip install -r requirements.txtSet your Azure OpenAI API key as an environment variable:
export AZURE_OPENAI_API_KEY="your-azure-api-key-here"To make it persistent, add it to your ~/.bashrc:
echo 'export AZURE_OPENAI_API_KEY="your-azure-api-key-here"' >> ~/.bashrc
source ~/.bashrc- Go to Azure Portal
- Navigate to your Azure OpenAI resource
- Click Keys and Endpoint
- Copy Key 1 or Key 2
The configuration file (configs/agents/openai-chat.yaml) is already set up to use:
- Endpoint:
https://algoverse-ab.openai.azure.com/ - Deployment:
gpt-4o-mini - API Version:
2024-08-01-preview
If your Azure resource is different, update the URL in configs/agents/openai-chat.yaml.
cd ~/AgentBench/extra
# Start the controller, redis, and alfworld worker
docker compose up -d controller redis alfworld-std
# Wait for services to initialize (~30-60 seconds)
# Verify services are running
docker compose ps
# Check that the worker registered
curl http://localhost:5020/api/list_workersYou should see output showing alfworld-std with workers registered.
curl http://localhost:5021/api/get_sessionsThis should return [] or a list of sessions.
cd ~/AgentBench
source venv/bin/activate
# Make sure API key is set
echo $AZURE_OPENAI_API_KEY
# Run the assigner
python -m src.assignerTaskClient created: alfworld-std (http://localhost:5020/api)
-> Using direct worker address: http://localhost:5021/api
Message: 109 samples remaining.
Agent "gpt-4o-mini" needs to run 1 tasks with total 109 samples:
Task "alfworld-std": 109
Running Count: 0
Assigned gpt-4o-mini/alfworld-std#108
...
The benchmark will run through 109 ALFWorld tasks. Results are saved to the outputs/ directory.
If you see RateLimitReached errors, the concurrency is set to 1 in configs/assignments/default.yaml to minimize this. You can:
- Wait and retry (the error message tells you how long)
- Increase your Azure quota at aka.ms/oai/quotaincrease
If you get connection errors:
# Check Docker services are running
docker compose ps
# Check controller logs
docker logs agentrl-controller --tail 50
# Check worker logs
docker logs agentbench-fc-alfworld-std-1 --tail 50
# Restart services
docker compose down
docker compose up -d controller redis alfworld-stdIf curl http://localhost:5020/api/list_workers shows empty workers:
# Check worker logs for errors
docker logs agentbench-fc-alfworld-std-1 --tail 100
# Rebuild and restart
docker compose down
docker compose build alfworld-std
docker compose up -d controller redis alfworld-std| File | Purpose |
|---|---|
configs/agents/openai-chat.yaml |
Azure OpenAI endpoint and API key |
configs/agents/api_agents.yaml |
Agent definitions (gpt-4o-mini) |
configs/assignments/default.yaml |
Task assignments and concurrency |
configs/assignments/definition.yaml |
Controller address (port 5020) |
extra/docker-compose.yml |
Docker service definitions |
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Python │ │ Controller │ │ Task │
│ Assigner │────▶│ (port 5020) │────▶│ Workers │
│ │ │ │ │ (ports 5021+) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │
│ (direct communication - bypasses controller) │
└─────────────────────────────────────────────────┘
│
▼
┌─────────────────┐
│ Azure OpenAI │
│ (gpt-4o-mini) │
└─────────────────┘
Note: The Python client talks directly to the worker because the controller has a bug that prevents proper /interact forwarding.
cd ~/AgentBench/extra
docker compose downAgentBench includes multiple benchmark tasks across different domains:
| Task | Description | Docker Service | Host Port |
|---|---|---|---|
| alfworld-std | Household tasks (ALFWorld) | alfworld-std |
5021 |
| dbbench-std | Database benchmark | dbbench-std |
5022 |
| os-std | OS interaction tasks | os_interaction-std |
5023 |
| kg-std | Knowledge graph (KGQA) | knowledgegraph-std |
5024 |
| webshop-std | Web shopping tasks | webshop-std |
5025 |
| Task | Description | Docker Service | Host Port |
|---|---|---|---|
| toolemu-std | Standard tool emulation | toolemu-std |
5026 |
| toolemu-adv | Adversarial mode (30% failure) | toolemu-adv |
5027 |
| toolemu-stress | Stress mode (50% failure) | toolemu-stress |
5028 |
| toolemu-safety | Safety-focused evaluation | toolemu-safety |
5029 |
| Task | Description | Docker Service | Host Port |
|---|---|---|---|
| m2w-std | Mind2Web standard | mind2web-std |
5030 |
| m2w-dev | Mind2Web dev set | mind2web-dev |
5031 |
| cg-std | Card Game (Aquawar) standard | card_game-std |
5032 |
| cg-dev | Card Game dev set | card_game-dev |
5033 |
| ltp-std | Lateral Thinking Puzzles std | ltp-std |
5034 |
| ltp-dev | Lateral Thinking Puzzles dev | ltp-dev |
5035 |
| avalon-dev-naive | Avalon naive mode | avalon-dev-naive |
5036 |
| avalon-dev-single | Avalon single mode | avalon-dev-single |
5037 |
Uncomment the task you want to run:
task:
# - alfworld-std # House-holding tasks
- dbbench-std # Database tasks (uncomment this one)
# - os-std # OS interaction tasks
# ... etccd ~/AgentBench/extra
# For core tasks (build from source)
docker compose up -d controller redis <service-name>
# For pre-built tasks (pull from Docker Hub)
docker compose up -d controller redis <service-name>cd ~/AgentBench
source venv/bin/activate
python -m src.assignerchmod +x run_task.sh
./run_task.sh alfworld-std # or any other task namedocker compose up -d controller redis alfworld-stddocker compose up -d controller redis dbbench-stdBuild the required Docker images first:
cd ~/AgentBench
docker build -t local-os/default -f data/os_interaction/res/dockerfiles/default data/os_interaction/res/dockerfiles
docker build -t local-os/packages -f data/os_interaction/res/dockerfiles/packages data/os_interaction/res/dockerfiles
docker build -t local-os/ubuntu -f data/os_interaction/res/dockerfiles/ubuntu data/os_interaction/res/dockerfilesThen start:
docker compose up -d controller redis os_interaction-stdRequires Freebase data:
- Download data from Freebase-Setup
- Extract and place at
./extra/virtuoso_db/virtuoso.db - Start with:
docker compose up -d controller redis knowledgegraph-std freebase- Requires ~16GB RAM
- Takes ~3 minutes to start
docker compose up -d controller redis webshop-std# Standard mode
docker compose up -d controller redis toolemu-std
# Adversarial mode (30% failure injection)
docker compose up -d controller redis toolemu-adv
# Stress mode (50% failure injection)
docker compose up -d controller redis toolemu-stress
# Safety-focused evaluation
docker compose up -d controller redis toolemu-safety# Standard set
docker compose up -d controller redis mind2web-std
# Dev set
docker compose up -d controller redis mind2web-dev# Standard set
docker compose up -d controller redis card_game-std
# Dev set
docker compose up -d controller redis card_game-dev# Standard set
docker compose up -d controller redis ltp-std
# Dev set
docker compose up -d controller redis ltp-dev# Naive mode
docker compose up -d controller redis avalon-dev-naive
# Single mode
docker compose up -d controller redis avalon-dev-single| Task | Host Port | Internal Port |
|---|---|---|
| Controller | 5020 | 5020 |
| Redis | 6379 | 6379 |
| alfworld-std | 5021 | 5021 |
| dbbench-std | 5022 | 5021 |
| os-std | 5023 | 5021 |
| kg-std | 5024 | 5021 |
| webshop-std | 5025 | 5021 |
| toolemu-std | 5026 | 5021 |
| toolemu-adv | 5027 | 5021 |
| toolemu-stress | 5028 | 5021 |
| toolemu-safety | 5029 | 5021 |
| m2w-std | 5030 | 5021 |
| m2w-dev | 5031 | 5021 |
| cg-std | 5032 | 5021 |
| cg-dev | 5033 | 5021 |
| ltp-std | 5034 | 5021 |
| ltp-dev | 5035 | 5021 |
| avalon-dev-naive | 5036 | 5021 |
| avalon-dev-single | 5037 | 5021 |
Apache-2.0 - See LICENSE for details.