-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
Abhishek Gahlot edited this page Mar 27, 2026
·
1 revision
pip install deepgympip install deepgym[daytona]git clone https://github.com/DeepGym/deepgym.git
cd deepgym
pip install -e ".[all]"| Extra | What it adds |
|---|---|
daytona |
Daytona SDK for sandboxed execution |
dev |
pytest, pytest-asyncio, ruff, mypy |
hf |
huggingface_hub, datasets |
lm-eval |
lm-eval harness integration |
all |
Everything above |
from deepgym import DeepGym, load_environment
# Create a client in local mode (no Daytona needed)
dg = DeepGym(mode='local')
# Load a built-in environment
env = load_environment('coin_change')
# Write a solution
solution = '''
def coin_change(coins, amount):
dp = [float('inf')] * (amount + 1)
dp[0] = 0
for coin in coins:
for x in range(coin, amount + 1):
dp[x] = min(dp[x], dp[x - coin] + 1)
return dp[amount] if dp[amount] != float('inf') else -1
'''
# Run and get a score
result = dg.run(env, model_output=solution)
print(f'Score: {result.score}') # 1.0
print(f'Passed: {result.passed}') # True
print(f'Time: {result.execution_time_ms:.0f}ms')dg.run() returns a RunResult:
| Field | Type | What it is |
|---|---|---|
score |
float |
0.0 to 1.0 |
passed |
bool |
Whether all tests passed |
output |
str |
Verifier stdout |
stderr |
str |
Verifier stderr |
exit_code |
int |
0=pass, 1=fail, 2=error |
execution_time_ms |
float |
Wall-clock time |
reward_components |
dict |
Shaped rewards (correctness, efficiency, etc.) |
cases |
list[CaseResult] |
Per-test breakdown |
error_type |
str |
timeout, verifier_error, sandbox_error, or None
|
# Local: fast, no isolation, fine for dev
dg = DeepGym(mode='local')
# Daytona: full container isolation, use for untrusted code
dg = DeepGym(mode='daytona')
# Auto (default): tries Daytona if DAYTONA_API_KEY is set, falls back to local
dg = DeepGym(mode='auto')More details in Sandbox Modes.
git clone https://github.com/daytonaio/daytona
cd daytona
docker compose -f docker/docker-compose.yaml up -dDashboard at http://localhost:3000 (dev@daytona.io / password).
export DAYTONA_API_URL=http://localhost:3000
export DAYTONA_API_KEY=your-local-key- Sign up at app.daytona.io
- Grab your API key from the dashboard
export DAYTONA_API_KEY=your-cloud-key- Browse Environments to see all 24 built-in problems
- Read Verifier Protocol to write custom verifiers
- Set up Integrations with your training framework
- Try Advanced Usage for batch GRPO scoring and multi-turn episodes