Function approximation benchmark arena. Plug in a model (fit / predict), configure a task, and compare against baselines with clear metrics, battle cards, tournaments, and a playable Graphwar battlefield in the browser.
Inspired by classic Graphwar — here contestants learn to approximate hidden curves instead of only shooting lines.
pip install graphwar
# optional extras
pip install "graphwar[sklearn,plotly,scipy,dev]"From source:
git clone https://github.com/AvoCahDoe/GraphWarBenchmark.git
cd GraphWarBenchmark
python -m venv .venv
# Windows
.venv\Scripts\activate
pip install -e ".[dev]"# Team fight (2–3 teams, each with a model)
graphwar fight --config configs/fight.example.yamlHome screen is Fight: pick 2–3 teams, each chooses a built-in or custom model, pick battlefield functions, hit Fight.
uvicorn graphwar.api.app:app --reload --host 127.0.0.1 --port 8000
cd frontend && npm install && npm run dev| Service | URL |
|---|---|
| Frontend (Vercel) | https://graphwar-sooty.vercel.app |
| API (Render) | https://graphwar-api.onrender.com |
The Vercel build sets VITE_API_URL=https://graphwar-api.onrender.com so the SPA calls the Render API cross-origin (CORS enabled). Play Graphwar runs fully in the browser; Fight / Tournament / Leaderboard use the API.
Render free tier spins down after ~15 minutes idle (first request may be slow). Custom contestant file uploads via path do not work on Render’s ephemeral filesystem — use built-in models or deploy with persistent storage.
Config: render.yaml (API), frontend/vercel.json (SPA).
graphwar fight --config configs/fight.example.yaml
graphwar test-my-model --path examples/my_contestant.py --config configs/quick.yaml
graphwar list-functions --difficulty easy
graphwar run --config configs/default.yaml --out results/Copy examples/my_contestant.py and implement fit / predict. Point YAML contestant_path or the dashboard custom path at your file.
configs/quick.yaml— fast smokeconfigs/default.yaml— broader suiteconfigs/custom.example.yaml— your model + baselinesconfigs/fight.example.yaml— multi-team fight
| Artifact | Location |
|---|---|
| GitHub releases | Releases |
| Python package | PyPI — graphwar |
| Frontend | Private npm package in frontend/ (built with Vite; served via dev server or static dist/) |
Tag a release to publish:
git tag v0.1.0
git push origin v0.1.0The release workflow builds sdist/wheel, creates a GitHub release, and uploads to PyPI when PYPI_API_TOKEN is configured in repository secrets.
- Repository: https://github.com/AvoCahDoe/GraphWarBenchmark
- Issues: https://github.com/AvoCahDoe/GraphWarBenchmark/issues
- Changelog: CHANGELOG.md
MIT — see LICENSE.