Skip to content

Repository files navigation

Da Vinci Code — Game Server

CI License: MIT

Play the board game Da Vinci Code against a trained AI. The model is trained in davinci-code-agent.

Play in your browser →

This repository serves the game in two ways.

Browser demo

docs/ is a static page: the game rules are in JavaScript and the model runs in the browser with ONNX Runtime Web. There is no backend. It is published with GitHub Pages.

To update the model:

python scripts/export_onnx.py <checkpoint.pt> docs/model.onnx --int8

Server

A FastAPI server with vs-AI and player-vs-player games; events are pushed over SSE.

docker run -d --gpus all -p 6000:6000 ghcr.io/rocknroll17/davinci-code-server:latest

Open http://localhost:6000. The image includes the model; drop --gpus all to run on CPU.

To run from source (Python 3.10):

pip install -r requirements.txt
oras pull ghcr.io/rocknroll17/davinci-model:latest -o checkpoints
python run.py

API reference: http://localhost:6000/docs. Settings (PORT, CHECKPOINT_PATH, ...) are in app/core/config.py.

License

MIT

Releases

Packages

Contributors

Languages