LLM Chess ๏ธ๐ค
Play chess against local LLMs, or watch two AIs battle each other โ all in a beautiful dark-themed GUI.
LLM Chess is a desktop application that lets you play international chess against AI opponents powered by local or cloud large language models. Supports Ollama, llama.cpp, LM Studio, OpenAI GPT, DeepSeek, and any OpenAI-compatible API.
โจ Features
๐ฎ Game Modes
- Human vs AI โ Classic mode. Play as White or Black against an LLM.
- AI vs AI โ Watch two LLMs play each other with configurable speed control (pause/resume/step).
- Each side can use a different model, different backend, different temperature.
๐ญ AI Thinking Display
- See the AI's reasoning process for every move
- Color-coded by side (blue for White, pink for Black)
- Parses
Reasoning:andMove:format with fallback handling
๐ญ AI Personas
Choose the AI's "personality" โ affects its playing style and reasoning tone:
- Default โ Calm, professional engine
- Aggressive โ Loves attacks and sacrifices
- Defensive โ Values king safety and solid positions
- Creative โ Unusual openings and tactical surprises
- Teacher โ Explains reasoning clearly, great for learning
๐จ UI Highlights
- Dark Catppuccin-themed PyQt6 interface
- Click-to-move with legal-move highlighting
- Last-move markers (yellow) and check indicators (red)
- Full move history in SAN notation
- Real-time FEN display
- Promotion dialog (queen/rook/bishop/knight)
- Undo moves
๐ฆ Installation
Option 1: pip (recommended)
pip install llmchess
llmchess
Or run as a module:
python -m llmchess
Option 2: npm (Node.js)
npm install -g llmchess
llmchess
The npm wrapper will auto-install the Python llmchess package on first run.
Option 3: DEB package (Ubuntu/Debian)
sudo dpkg -i llmchess_1.5.5_all.deb
The launcher will auto-install missing Python dependencies (PyQt6, python-chess, httpx).
Option 4: From source
git clone https://github.com/oemoem12/LLMChess.git
cd LLMChess
pip install -e .
python main.py
๐ง Setup LLM Backend
LLM Chess is backend-agnostic โ it speaks OpenAI-compatible HTTP API. Pick any one:
Ollama (easiest)
# Install from https://ollama.com
ollama pull qwen2.5:7b
ollama serve # default: http://localhost:11434
llama.cpp
./llama-server -m model.gguf --port 8080
LM Studio
Open LM Studio โ Developer tab โ Start Local Server (default: http://localhost:1234)
๐ Quick Start
- Start your LLM server (Ollama/llama.cpp/LM Studio)
- Launch LLM Chess:
llmchess - Open Settings โ select your backend โ click Test Connection
- Choose a model in the connection settings
- Pick a game mode (Human vs AI / AI vs AI) and a persona
- Click a piece โ click target square to move
- Watch the AI Thinking panel to see your opponent's reasoning
๐ฌ Screenshots
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โ Game Mode โ Move History โ
โ [Human vs AI โผ] โ 1. e4 e5 โ
โ [White (first) โผ] โ 2. Nf3 Nc6 โ
โ โ 3. Bb5 a6 โ
โ โ โ โ โ โ โ โ ... โ
โ โโโโโโโโโโโโโโโโโ โ โ
โ Chess Board โ AI Thinking โ
โ (8ร8) โ โโโ White AI โโ โ
โ โโโโโโโโโโโโโโโโโ โ Move: e2e4 โ
โ [New Game] [โ Set] โ Reasoning: โ
โ โ Classical king โ
โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ
๐ ๏ธ Tech Stack
- PyQt6 โ Cross-platform GUI
- python-chess โ Chess rules, FEN/PGN handling
- httpx โ OpenAI-compatible HTTP client
- setuptools + Trusted Publisher โ Zero-token PyPI release
๐ Architecture
chess_app/
โโโ __init__.py # Package entry, version, main()
โโโ __main__.py # python -m chess_app support
โโโ main.py # GUI entry point
โโโ board_widget.py # Chess board renderer (PyQt6)
โโโ game_controller.py # Main window + game flow + AI vs AI logic
โโโ llm_connector.py # OpenAI-compatible LLM client + persona prompts
โโโ settings_dialog.py # Tabbed config UI (White/Black sides)
๐ค Contributing
PRs welcome! Some ideas:
- Save/load PGN files
- Tournament mode (round-robin between N models)
- Stockfish-LLM hybrid (use Stockfish for blunders, LLM for variety)
- Post-game analysis with LLM commentary
- Online multiplayer via WebSocket
๐ License
MIT โ do whatever you want, just don't blame me if the AI hangs your king.
๐ Links
- PyPI: https://pypi.org/project/llmchess/
- GitHub: https://github.com/oemoem12/LLMChess
- Issues: https://github.com/oemoem12/LLMChess/issues
- ไธญๆ README: README_zh.md
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llmchess-1.5.6.tar.gz.
File metadata
- Download URL: llmchess-1.5.6.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c198d6076c0a96f9f935335dc67f95134dc860ea17eb01b25867fd550384ef60
|
|
| MD5 |
229c0ace1508bcb162e2e75470032162
|
|
| BLAKE2b-256 |
84fbb3109d9cccd072a4282ebbe4b6737fb1c9c425ce2527b2e3e084a9ca60d4
|
Provenance
The following attestation bundles were made for llmchess-1.5.6.tar.gz:
Publisher:
publish.yml on oemoem12/LLMChess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llmchess-1.5.6.tar.gz -
Subject digest:
c198d6076c0a96f9f935335dc67f95134dc860ea17eb01b25867fd550384ef60 - Sigstore transparency entry: 2356592112
- Sigstore integration time:
-
Permalink:
oemoem12/LLMChess@d77be1da8d3482c65bfd35f16a07ff1d56af424c -
Branch / Tag:
refs/tags/v1.5.6 - Owner: https://github.com/oemoem12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d77be1da8d3482c65bfd35f16a07ff1d56af424c -
Trigger Event:
release
-
Statement type:
File details
Details for the file llmchess-1.5.6-py3-none-any.whl.
File metadata
- Download URL: llmchess-1.5.6-py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d76849251045592719b37a6662b47f99830336bc0a78103d5d0e4a4688926727
|
|
| MD5 |
b146c8e5829519e7c330db0ba12f02d3
|
|
| BLAKE2b-256 |
9b8a4bb201552db31ae51200738ee931a7ee22fdeb80cee12dcfb5d98efa5968
|
Provenance
The following attestation bundles were made for llmchess-1.5.6-py3-none-any.whl:
Publisher:
publish.yml on oemoem12/LLMChess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llmchess-1.5.6-py3-none-any.whl -
Subject digest:
d76849251045592719b37a6662b47f99830336bc0a78103d5d0e4a4688926727 - Sigstore transparency entry: 2356592870
- Sigstore integration time:
-
Permalink:
oemoem12/LLMChess@d77be1da8d3482c65bfd35f16a07ff1d56af424c -
Branch / Tag:
refs/tags/v1.5.6 - Owner: https://github.com/oemoem12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d77be1da8d3482c65bfd35f16a07ff1d56af424c -
Trigger Event:
release
-
Statement type: