Purpose of this post

This post publishes the source code used for the Othello AI. The code is loaded only when you open a file.

Models used

  • Gemma 4 E4B (mlx-community/gemma-4-e4b-it-4bit): the default model of the VLM server. It currently fails to load and is not used.
  • mlx-vlm: runs the model on Apple Silicon.
  • Local AI: not a trained model. The source has alpha-beta search; the deployed web has the one-move weighted AI.
  • There is no trained model yet.

Folder layout

  • src: Qt6 C++ app. Rule engine (othello_board), search AI (aiplayer), VLM client (tcpvlmclient)
  • vlm_server: OT88 TCP server, rules, Gemma 4 download
  • othello-web: Next.js web play. Rule engine (board.ts), search AI (ai.ts), game storage (db.ts), VLM relay (api/vlm/move, ot88Client.ts)

Server deployment settings, monitoring and automation scripts, and game data and logs are excluded from the release. Web operation code such as ads and the list of other games, and configuration files are also left out, so some imports point to unpublished files.

Full source

37 files · 5,381 lines — open a folder and click a file to load its code.

Project root1 file
CMakeLists.txttext · 30 lines · 677B

Loading code…

othello-web/19 files
othello-web/app/api/game/[code]/route.tstypescript · 56 lines · 2KB

Loading code…

othello-web/app/api/game/route.tstypescript · 23 lines · 801B

Loading code…

othello-web/app/api/vlm/move/route.tstypescript · 55 lines · 1KB

Loading code…

othello-web/app/globals.csscss · 48 lines · 864B

Loading code…

othello-web/app/layout.tsxtsx · 33 lines · 954B

Loading code…

othello-web/app/page.tsxtsx · 71 lines · 2KB

Loading code…

othello-web/app/play/page.tsxtsx · 689 lines · 20KB

Loading code…

othello-web/app/play/play.module.csscss · 209 lines · 3KB

Loading code…

othello-web/components/OthelloBoard.module.csscss · 111 lines · 2KB

Loading code…

othello-web/components/OthelloBoard.tsxtsx · 85 lines · 3KB

Loading code…

othello-web/lib/ai.tstypescript · 145 lines · 4KB

Loading code…

othello-web/lib/board.tstypescript · 209 lines · 5KB

Loading code…

othello-web/lib/db.tstypescript · 190 lines · 6KB

Loading code…

othello-web/lib/gameTypes.tstypescript · 42 lines · 798B

Loading code…

othello-web/lib/guest.tstypescript · 43 lines · 1KB

Loading code…

othello-web/lib/ot88Client.tstypescript · 181 lines · 5KB

Loading code…

othello-web/lib/renderBoardPng.tstypescript · 106 lines · 3KB

Loading code…

othello-web/lib/vlmClient.tstypescript · 103 lines · 3KB

Loading code…

othello-web/package.jsonjson · 22 lines · 489B

Loading code…

src/11 files
src/aiplayer.cppc++ · 167 lines · 5KB

Loading code…

src/aiplayer.hc++ · 17 lines · 334B

Loading code…

src/boardwidget.cppc++ · 205 lines · 7KB

Loading code…

src/boardwidget.hc++ · 48 lines · 1KB

Loading code…

src/main.cppc++ · 26 lines · 784B

Loading code…

src/mainwindow.cppc++ · 785 lines · 27KB

Loading code…

src/mainwindow.hc++ · 110 lines · 3KB

Loading code…

src/othello_board.cppc++ · 211 lines · 5KB

Loading code…

src/othello_board.hc++ · 99 lines · 3KB

Loading code…

src/tcpvlmclient.cppc++ · 469 lines · 15KB

Loading code…

src/tcpvlmclient.hc++ · 73 lines · 2KB

Loading code…

vlm_server/6 files
vlm_server/__init__.pypython · 3 lines · 69B

Loading code…

vlm_server/__main__.pypython · 92 lines · 3KB

Loading code…

vlm_server/download_gemma4.pypython · 68 lines · 2KB

Loading code…

vlm_server/othello_rules.pypython · 92 lines · 3KB

Loading code…

vlm_server/requirements.txttext · 7 lines · 195B

Loading code…

vlm_server/server.pypython · 458 lines · 15KB

Loading code…