# clawd-local-ai-chess Two large local LLMs playing chess against each other on a single Mac, refereed by `python-chess`. **Step-3.7-Flash** (198B MoE, ~11B active) plays White against **DeepSeek-V4-Flash** as Black, both running locally via `llama.cpp` with Metal. Neither model fits alongside the other in 128GB of RAM, so the arena loads each engine **one-shot per move** (load → get move → exit → free RAM). `python-chess` is the sole source of truth: it builds the prompt, enforces legality, and decides the result. The models never trust each other's moves. ## Files - `chess/arena.py` — the referee / match runner - `chess/game.pgn` — last game in PGN - `chess/game.log` — full move-by-move log of the last game - `chat.sh` — interactive chat with Step-3.7-Flash via `llama-cli` - `models/chat_template.jinja` — Step-3.7-Flash chat template - `models/chat_template_nothink.jinja` — variant with thinking disabled ## Last result ``` Event: Local LLM Heavyweight Match White: Step-3.7-Flash Black: DeepSeek-V4-Flash Result: 1-0 (White wins) ``` ## Setup (not committed here) The model weights (~98GB of GGUF shards) and the `stepfun-ai/llama.cpp` fork are intentionally **not** in this repo — see `.gitignore`. To reproduce: 1. Build the StepFun llama.cpp fork: 2. Download the GGUF weights for Step-3.7-Flash and DeepSeek-V4-Flash. 3. Fix up the absolute paths in `chess/arena.py` and `chat.sh`. 4. Run the arena: ```bash uv run --with chess python chess/arena.py ```