Quick start
Why use GCP?
GCP provides several advantages over the default Modal backend:Scalability
Run hundreds of parallel evaluations using GCP Batch API
Cost control
Use your own GCP credits and quotas with transparent pricing
Data locality
Keep all data and results in your GCP project
Customization
Use custom VM images, networks, and machine types
Prerequisites
GCP account
You need a Google Cloud Platform account:- Sign up at cloud.google.com
- Create a project at console.cloud.google.com/projectcreate
- Enable billing at console.cloud.google.com/billing
GCP free tier includes $300 credit for new users - enough to run thousands of tasks!
gcloud CLI
Install the Google Cloud SDK:- macOS
- Linux
- Windows
Setup
Interactive configuration (recommended)
Run the setup wizard:Check dependencies
The wizard verifies:
- ✓ gcloud CLI is installed
- ✓ GCP Python packages are available
- ✓ Configuration directory is writable
Authenticate
The wizard runs two authentication commands:Both open a browser for Google account login.
Select project, region, and zone
The wizard prompts for:Project ID: Your GCP project (e.g.,
my-cooperbench-project)Region: Geographic region for VMs:us-central1(Iowa) - recommended for USeurope-west1(Belgium) - recommended for Europeasia-east1(Taiwan) - recommended for Asia
us-central1-a)Validate APIs
The wizard tests access to required APIs:
- Compute Engine API
- Cloud Batch API
- Cloud Storage API
Skip validation (faster)
For faster setup without API testing:- You’ve already enabled the required APIs
- You want to configure quickly and test later
- You’re re-running configuration
Manual configuration (alternative)
If you prefer manual setup:Required APIs
The wizard validates these APIs (and provides links to enable them):Compute Engine
For running VMsEnable API
Cloud Batch
For parallel evaluationEnable API
Cloud Storage
For storing resultsEnable API
Usage
Run experiments
Evaluate results
Complete example
Architecture
Agent execution
Each task runs in an isolated VM:- Machine type: e2-medium (2 vCPU, 4GB RAM)
- OS: Container-Optimized OS
- Lifecycle: Created per task, auto-deleted after completion
- Access: SSH via gcloud CLI
Evaluation (GCP Batch)
Evaluation uses GCP’s managed batch service:- Single job submission for all evaluations
- Automatic VM scheduling and lifecycle
- Parallel execution across VMs
- Results persisted to Cloud Storage
- Auto-cleanup after completion
Git server (optional)
For multi-agent git collaboration:--git flag in cooperative mode.
Cost estimation
Using default settings in us-central1:Agent execution
| Resource | Spec | Cost | Typical usage | Per task |
|---|---|---|---|---|
| VM | e2-medium (2 vCPU, 4GB) | ~$0.03/hour | 5-30 min | 0.015 |
Evaluation
| Resource | Spec | Cost | Notes |
|---|---|---|---|
| VM | 4 vCPU, 16GB RAM | ~$0.15/hour/VM | Per batch worker |
| Parallelism | 50 VMs | ~$7.50/hour | Typical configuration |
| Storage | GCS Standard | ~$0.02/GB/month | Auto-delete after 7 days |
Example costs
- Small run
- Medium run
- Large run
10 tasks
- Agent runs: 10 × 0.10
- Evaluation: ~$0.05
- Total: ~$0.15
Advanced configuration
Custom VM images (optional)
Pre-build VM images with Docker images cached to reduce startup time:- Creates a temporary VM with Container-Optimized OS
- Pulls all CooperBench Docker images
- Creates a VM image snapshot (family:
cooperbench-eval) - Deletes the temporary VM
- ✓ Large evaluation runs (100+ tasks)
- ✓ Repeated evaluations where startup time matters
- ✗ Small runs (< 100 tasks) - not worth the build time
- ✗ First-time setup - use defaults first
Custom VPC network (optional)
For multi-agent git collaboration:VPC networking is only required for git-based collaboration. Redis-based messaging works with the default network.
Region selection
Choose regions based on your location: US:us-central1(Iowa) - recommendedus-east1(South Carolina)us-west1(Oregon)
europe-west1(Belgium) - recommendedeurope-west4(Netherlands)europe-north1(Finland)
asia-east1(Taiwan) - recommendedasia-southeast1(Singapore)asia-northeast1(Tokyo)
Troubleshooting
gcloud not found
gcloud not found
Error:Solution:
Not authenticated
Not authenticated
Error:Solution:You need both types of authentication:Why both?
gcloud auth login: For gcloud CLI commandsgcloud auth application-default login: For GCP Python libraries
API not enabled
API not enabled
Error:Solution:Enable required APIs:Or enable via console:
Permission denied
Permission denied
Error:Solution:
- Ensure billing is enabled: console.cloud.google.com/billing
- Check IAM permissions: console.cloud.google.com/iam-admin/iam
- Required roles:
roles/compute.instanceAdmin.v1(Compute Instance Admin)roles/batch.jobsEditor(Batch Job Editor)roles/storage.admin(Storage Admin)
Quota exceeded
Quota exceeded
Error:Solution:
- Check quotas: console.cloud.google.com/iam-admin/quotas
- Request quota increase (usually approved within hours)
- Reduce
--concurrencyparameter to use fewer VMs:
Python package missing
Python package missing
Error:Solution:Or install packages individually:
Migration from Modal
To switch from Modal to GCP:Comparison: Modal vs GCP
| Feature | Modal (Default) | GCP |
|---|---|---|
| Setup | modal setup | cooperbench config gcp |
| Account | Modal account | GCP account |
| Cost | Modal credits | Pay-as-you-go |
| Scale | Auto-scaling | Up to quotas |
| Free tier | Limited | $300 credit |
| Data location | External service | Your GCP project |
| Customization | Limited | Full control |
| Parallelism | 50-100 | 100+ |
Next steps
Running experiments
Learn how to run experiments with GCP backend
Evaluation
Understand the evaluation process
Backends
Compare all execution backends