Play the board game Da Vinci Code against a trained AI. The model is trained in davinci-code-agent.
This repository serves the game in two ways.
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 --int8A 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:latestOpen 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.pyAPI reference: http://localhost:6000/docs. Settings (PORT, CHECKPOINT_PATH, ...) are in
app/core/config.py.