{"id":13467481,"url":"https://github.com/lichess-org/lila-tablebase","last_synced_at":"2025-04-06T13:12:26.068Z","repository":{"id":38456903,"uuid":"129384851","full_name":"lichess-org/lila-tablebase","owner":"lichess-org","description":"Tablebase server","archived":false,"fork":false,"pushed_at":"2025-03-17T22:05:40.000Z","size":820,"stargazers_count":86,"open_issues_count":1,"forks_count":15,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-30T12:09:02.295Z","etag":null,"topics":["chess","http-api","lichess","rust","syzygy","tablebase"],"latest_commit_sha":null,"homepage":"https://tablebase.lichess.ovh","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lichess-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-13T10:07:08.000Z","updated_at":"2025-03-17T22:05:43.000Z","dependencies_parsed_at":"2024-05-19T16:26:54.164Z","dependency_job_id":"705b8379-eb1b-4f13-a19a-89bc68ae6680","html_url":"https://github.com/lichess-org/lila-tablebase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-tablebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-tablebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-tablebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-tablebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lichess-org","download_url":"https://codeload.github.com/lichess-org/lila-tablebase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485290,"owners_count":20946398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chess","http-api","lichess","rust","syzygy","tablebase"],"created_at":"2024-07-31T15:00:57.096Z","updated_at":"2025-04-06T13:12:26.044Z","avatar_url":"https://github.com/lichess-org.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"lila-tablebase\n==============\n\nTablebase server for [lichess.org](https://tablebase.lichess.ovh),\nbased on [shakmaty-syzygy](https://crates.io/crates/shakmaty-syzygy).\n\nBlog posts\n----------\n\n- [Optimizing the tablebase server](https://lichess.org/@/revoof/blog/optimizing-the-tablebase-server/MetV0ZQd)\n- [7 piece tablebases are complete](https://lichess.org/@/lichess/blog/7-piece-syzygy-tablebases-are-complete/W3WeMyQA)\n\nUsage\n-----\n\n```\ncargo run --release -- --help\n```\n\nHTTP API\n--------\n\n### `GET /standard`\n\n```\ncurl http://tablebase.lichess.ovh/standard?fen=4k3/6KP/8/8/8/8/7p/8_w_-_-_0_1\n```\n\nname | type | default | description\n--- | --- | --- | ---\n**fen** | string | *required* | FEN of the position. Underscores allowed.\n\n```javascript\n{\n  \"dtz\": 1, // dtz50'' with rounding or null if unknown\n  \"precise_dtz\": 1, // dtz50'' (only if guaranteed to be not rounded) or null if unknown\n  \"dtc\": null, // depth to conversion or null if unknown\n  \"dtm\": 17, // depth to mate or null if unknown\n  \"dtw\": null, // depth to antichess win or null if unknown\n  \"checkmate\": false,\n  \"stalemate\": false,\n  \"variant_win\": false, // only in chess variants (atomic, antichess)\n  \"variant_loss\": false, // only in chess variants\n  \"insufficient_material\": false,\n  \"category\": \"win\", // win, unknown, syzygy-win, maybe-win, cursed-win, draw, blessed-loss, maybe-loss, syzygy-loss, loss\n  \"moves\": [ // information about legal moves, best first\n    {\n      \"uci\": \"h7h8q\",\n      \"san\": \"h8=Q+\",\n      \"dtz\": -2,\n      \"precise_dtz\": -2,\n      \"dtc\": null,\n      \"dtm\": -16,\n      \"dtw\": null,\n      \"zeroing\": true,\n      \"checkmate\": false,\n      \"stalemate\": false,\n      \"variant_win\": false,\n      \"variant_loss\": false,\n      \"insufficient_material\": false,\n      \"category\": \"loss\" // loss, unknown, syzygy-loss, maybe-loss, blessed-loss, draw, cursed-win, maybe-win, syzygy-win, win\n    },\n    // ...\n  ]\n}\n```\n\n### `GET /standard/mainline`\n\n```\ncurl http://tablebase.lichess.ovh/standard/mainline?fen=4k3/6KP/8/8/8/8/7p/8_w_-_-_0_1\n```\n\nname | type | default | description\n--- | --- | --- | ---\n**fen** | string | *required* | FEN of the position. Underscores allowed.\n\n```javascript\n{\n  \"dtz\": 1,\n  \"mainline\": [ // dtz mainline or empty if drawn\n    { \"uci\": \"h7h8q\", \"san\": \"h8=Q+\", \"dtz\": -2 },\n    { \"uci\": \"e8d7\", \"san\": \"Kd7\", \"dtz\": 1 },\n    { \"uci\": \"h8h2\", \"san\": \"Qxh2\", \"dtz\": -14 },\n    { \"uci\": \"d7c6\", \"san\": \"Kc6\", \"dtz\": 13 },\n    { \"uci\": \"h2e5\", \"san\": \"Qe5\", \"dtz\": -12 },\n    { \"uci\": \"c6b6\", \"san\": \"Kb6\", \"dtz\": 11 },\n    { \"uci\": \"g7f6\", \"san\": \"Kf6\", \"dtz\": -10 },\n    { \"uci\": \"b6a6\", \"san\": \"Ka6\", \"dtz\": 9 },\n    { \"uci\": \"e5b2\", \"san\": \"Qb2\", \"dtz\": -8 },\n    { \"uci\": \"a6a5\", \"san\": \"Ka5\", \"dtz\": 7 },\n    { \"uci\": \"f6e5\", \"san\": \"Ke5\", \"dtz\": -6 },\n    { \"uci\": \"a5a4\", \"san\": \"Ka4\", \"dtz\": 5 },\n    { \"uci\": \"e5d4\", \"san\": \"Kd4\", \"dtz\": -4 },\n    { \"uci\": \"a4a5\", \"san\": \"Ka5\", \"dtz\": 3 },\n    { \"uci\": \"d4c5\", \"san\": \"Kc5\", \"dtz\": -2 },\n    { \"uci\": \"a5a4\", \"san\": \"Ka4\", \"dtz\": 1 },\n    { \"uci\": \"b2a2\", \"san\": \"Qa2#\", \"dtz\": -1 }\n  ],\n  \"winner\": \"w\" // (w) white, (b) black, (null) draw\n}\n```\n\nClaims draw by 50-move rule as soon as possible and ends the mainline.\nError 404 if not a tablebase position or required tables not present.\n\n### `GET /atomic`\n\n### `GET /antichess`\n\nAcknowledgements\n----------------\n\nThanks to Ronald de Man for his [Syzygy endgame tables](https://github.com/syzygy1/tb).\nThanks to Bojun Guo for generating and [sharing](http://www.talkchess.com/forum/viewtopic.php?t=66797) 7-piece tables.\n\nLicense\n-------\n\nlila-tablebase is licensed under the GNU Affero General Public License 3.0 (or any later version at your\noption). See the COPYING file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flichess-org%2Flila-tablebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flichess-org%2Flila-tablebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flichess-org%2Flila-tablebase/lists"}