# thomasahle/sunfish

Sunfish: a Python Chess Engine in 111 lines of code

Repository: https://github.com/thomasahle/sunfish
Canonical: https://ross.abutalabs.com/products/sunfish
Homepage: https://www.chessprogramming.org/Sunfish
Language: Python
License: NOASSERTION
License Family: other
Topics: sunfish, python, chess-engine, chess-ai, ai, chess
Last push: 2026-08-26T12:45:52+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 65, longevity 100
- inputs: {"age_days": 4587, "days_push": 7, "days_rel": 22, "gap_med": null, "n_releases_24m": 1}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3271, forks 583 (observed 2026-08-28T04:07:53.087571+00:00)

## What it is
Sunfish is a simple but strong chess engine written in Python in roughly 111 lines of code, using MTD-bi search with piece-square table evaluation, plus a small NNUE variant. It speaks the UCI protocol so it can be played in a terminal, via GUIs like Arena or Cute Chess, or on Lichess.

## Use cases
- play chess against an engine in the terminal
- hook a chess engine into a UCI GUI or tournament tool
- learn how a chess engine works by reading minimal code
- experiment with search algorithms and evaluation functions
- build a deep learning chess program on a simple base
- run engine matches with fastchess or cutechess-cli

## When to choose
- you want a tiny, readable chess engine to study or modify
- you need a lightweight UCI engine for casual play or testing
- you want a platform for experimenting with chess AI research

## When to avoid
- you need maximum playing strength comparable to Stockfish
- you need a production engine with extensive opening books and tablebase support
- you need a non-GPL-licensed engine

## Facets
- artifact type: application
- maturity: active
- function: game-engine, cli, machine-learning
- domain: artificial-intelligence, gaming-tools
- platform: python, cli, cross-platform
- tags: chess, chess-engine, uci, nnue, minimalist, didactic, game-development

## Member repositories
- thomasahle/sunfish (main) score 87

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:53.087571+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:23:08.927045+00:00, confidence not recorded.
  - readme: https://github.com/thomasahle/sunfish (fetched 2026-08-28T04:07:53.087571+00:00, sha bc0a786c7a89)
  - homepage: https://www.chessprogramming.org/Sunfish (fetched 2026-08-29T09:36:34.678784+00:00, sha e211b5059f49)
  - registry_pypi: https://pypi.org/pypi/sunfish/json (fetched 2026-08-29T09:36:34.688421+00:00, sha 18bfb9b6cbc6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
