Play international chess against AI opponents powered by local LLMs
Project description
LLM Chess
Play international chess against AI opponents powered by local large language models (LLMs).
Features
- Interactive chess board with move highlighting and last-move indicators
- Pawn promotion dialog
- Undo moves support
- FEN display and SAN move history
- Dark theme Catppuccin-style UI
- Game status detection (checkmate, stalemate, draw, etc.)
Supported LLM Backends
Connects to any OpenAI-compatible API endpoint:
| Backend | Default URL | Notes |
|---|---|---|
| Ollama | http://localhost:11434 |
ollama serve |
| llama.cpp Server | http://localhost:8080 |
./llama-server -m model.gguf --port 8080 |
| LM Studio | http://localhost:1234 |
Enable "Local Server" in Developer tab |
| Custom | Any URL | Configure in Settings |
Installation
From DEB package (Ubuntu/Debian)
sudo dpkg -i llmchess_1.0.0_all.deb
llmchess
From source
# Install dependencies
pip install PyQt6 python-chess httpx
# Run
python3 main.py
Build DEB package
bash build_deb.sh
sudo dpkg -i llmchess_1.0.0_all.deb
Usage
- Start your LLM server (Ollama, llama.cpp, or LM Studio)
- Launch LLM Chess (
llmchessor from application menu) - Click Settings to configure your LLM connection
- Select White (you move first) or Black (AI moves first)
- Click a piece, then click the destination square to move
Settings
- Provider: Select your backend (Ollama, llama.cpp, LM Studio, or Custom)
- Base URL: API endpoint (auto-filled for presets)
- Model: Model name to use
- Temperature: Lower = more deterministic moves (default 0.3)
- Max Tokens: Maximum response length (default 512)
- Test Connection: Verify connectivity before playing
Project Structure
LLMChess/
├── main.py # Application entry point
├── requirements.txt # Python dependencies
├── build_deb.sh # DEB package build script
├── chess_app/
│ ├── board_widget.py # Chess board UI (PyQt6)
│ ├── llm_connector.py # LLM API connector
│ ├── game_controller.py # Main window & game controller
│ └── settings_dialog.py # LLM connection settings
└── deb_pkg/ # DEB packaging files
How It Works
- Each turn, the current board state is sent to the LLM as a FEN string plus a list of legal moves in UCI format
- The LLM is prompted to respond with only one UCI move (e.g.,
e2e4,g1f3) - The response is parsed to extract the UCI move and validated against legal moves
- If the LLM returns an invalid or empty response, the first legal move is used as fallback
Requirements
- Python 3.9+
- PyQt6
- python-chess
- httpx
- A running LLM server (Ollama, llama.cpp, or LM Studio)
License
MIT License
Project details
Release history Release notifications | RSS feed
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.0.0.tar.gz.
File metadata
- Download URL: llmchess-1.0.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34862bd544558e421ba30def20a5c14227dfa96b0baadd9f83e42a3be746829e
|
|
| MD5 |
d8bdf1743e9961d9feacf29026e142b7
|
|
| BLAKE2b-256 |
2a6eded4868c10da777589c543d85ee53900d93ba0d44bd4059d862d259687ef
|
Provenance
The following attestation bundles were made for llmchess-1.0.0.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.0.0.tar.gz -
Subject digest:
34862bd544558e421ba30def20a5c14227dfa96b0baadd9f83e42a3be746829e - Sigstore transparency entry: 1552225909
- Sigstore integration time:
-
Permalink:
oemoem12/LLMChess@f6b735456c340a0e23b377e3b00c47347378337a -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/oemoem12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6b735456c340a0e23b377e3b00c47347378337a -
Trigger Event:
release
-
Statement type:
File details
Details for the file llmchess-1.0.0-py3-none-any.whl.
File metadata
- Download URL: llmchess-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b697f16aeff7a0215229af8c40473e123fe93fa0005e4a25ea4656fc3fed27ba
|
|
| MD5 |
fc99be8490729a3a74189bc5c03af94a
|
|
| BLAKE2b-256 |
dcacae6272fedda4c15862adeb0375a61ecde3768b11318c8a459ca0cc4c4ccc
|
Provenance
The following attestation bundles were made for llmchess-1.0.0-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.0.0-py3-none-any.whl -
Subject digest:
b697f16aeff7a0215229af8c40473e123fe93fa0005e4a25ea4656fc3fed27ba - Sigstore transparency entry: 1552225926
- Sigstore integration time:
-
Permalink:
oemoem12/LLMChess@f6b735456c340a0e23b377e3b00c47347378337a -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/oemoem12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6b735456c340a0e23b377e3b00c47347378337a -
Trigger Event:
release
-
Statement type: