Skip to main content

LLM Chess ️🤖

Play chess against local LLMs, or watch two AIs battle each other — all in a beautiful dark-themed GUI.

PyPI version npm version Python License: MIT GitHub release

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: and Move: 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

  1. Start your LLM server (Ollama/llama.cpp/LM Studio)
  2. Launch LLM Chess: llmchess
  3. Open Settings → select your backend → click Test Connection
  4. Choose a model in the connection settings
  5. Pick a game mode (Human vs AI / AI vs AI) and a persona
  6. Click a piece → click target square to move
  7. 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

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)

Source distribution for llmchess 1.5.6
File Size Uploaded
llmchess-1.5.6.tar.gz 25.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llmchess 1.5.6
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

1.5.6 This release

2 release files

1.5.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page