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
Metadata
Release files for llmchess 1.5.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llmchess-1.5.6.tar.gz | 25.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llmchess-1.5.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.0 kB
Release files / llmchess-1.5.6.tar.gz
| Download URL | llmchess-1.5.6.tar.gz |
|---|---|
| Size | 25.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c198d6076c0a96f9f935335dc67f95134dc860ea17eb01b25867fd550384ef60
|
|
BLAKE2b-256 checksum How to use checksums |
84fbb3109d9cccd072a4282ebbe4b6737fb1c9c425ce2527b2e3e084a9ca60d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / llmchess-1.5.6-py3-none-any.whl
| Download URL | llmchess-1.5.6-py3-none-any.whl |
|---|---|
| Size | 24.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d76849251045592719b37a6662b47f99830336bc0a78103d5d0e4a4688926727
|
|
BLAKE2b-256 checksum How to use checksums |
9b8a4bb201552db31ae51200738ee931a7ee22fdeb80cee12dcfb5d98efa5968
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency log