-
Notifications
You must be signed in to change notification settings - Fork 1
API Server
Abhishek Gahlot edited this page Mar 27, 2026
·
1 revision
DeepGym includes a FastAPI server for remote scoring.
DEEPGYM_NO_AUTH=true deepgym serve \
--host 127.0.0.1 \
--port 8000 \
--reload \
--allow-local-execDEEPGYM_API_KEY=your-secret-key \
DAYTONA_API_KEY=your-daytona-key \
deepgym serve --port 8000All production requests need an X-API-Key header:
curl -H "X-API-Key: your-secret-key" \
-X POST http://localhost:8000/v1/run \
-H "Content-Type: application/json" \
-d '{"task": "...", "verifier_code": "...", "model_output": "..."}'| Env var | What |
|---|---|
DEEPGYM_API_KEY |
Required for production |
DEEPGYM_NO_AUTH |
true disables auth (dev only) |
DEEPGYM_ALLOW_LOCAL_EXEC |
true enables local execution |
Run a single solution.
// Request
{
"task": "Write a function coin_change...",
"verifier_code": "import importlib.util...",
"model_output": "def coin_change(coins, amount): ...",
"timeout": 30
}
// Response
{
"score": 1.0,
"passed": true,
"output": "{\"schema_version\": \"1.0\", ...}",
"execution_time_ms": 142.5,
"cases": [...]
}Run multiple solutions.
// Request
{
"task": "...",
"verifier_code": "...",
"model_outputs": ["solution1", "solution2", "solution3"],
"max_parallel": 10
}
// Response
{
"results": [...],
"total": 3,
"passed": 2,
"failed": 1,
"avg_score": 0.67,
"execution_time_ms": 450.0
}Submit an async job. Returns a job ID.
// Response
{"job_id": "abc-123", "status": "pending"}Poll for result.
{"job_id": "abc-123", "status": "completed", "result": { ... }}Health check (no auth).
{"status": "ok"}