Instructions to use datafreak/laya-chess with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use datafreak/laya-chess with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
LayaChess: Laya fine-tuned for chess
Laya (Convai Innovations, ModernBERT-large, 421M) is a System 1
decision model that had never seen a chessboard. This checkpoint fine-tunes it on 2 million Stockfish-rated moves from
DeepMind's ChessBench. For each legal move, a Laya score
question predicts the win chance of the side to move over 10 levels. The
LayaChess engine wraps it in a Monte Carlo tree search.
- Play it online: huggingface.co/spaces/datafreak/laya-chess
- Write-up: LayaChess: teaching a System 1 decision model to play chess
- Demo video: youtube.com/watch?v=bPpAlWArs7E
- Code: github.com/devroopsaha744/LayaChess
Results
| Base Laya | This checkpoint | |
|---|---|---|
| Picks Stockfish's best move (300 held-out positions) | 6% | 27% |
| Win-chance error (percentage points) | 28.6 | 8.2 |
Checkpoint final: step 32,000, 2,048,000 training examples. Encoding, levels and the question template are in
chess_meta.json. train_state.pt is the optimizer state for resuming training; inference doesn't need it.
Run it on your own machine
git clone https://github.com/devroopsaha744/LayaChess.git
cd LayaChess/engine
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python -m laya_chess.play # browser board at http://localhost:8000
The engine downloads this checkpoint on first start. Optional: install Stockfish (brew install stockfish or
sudo apt install stockfish) to see its preferred move next to Laya's. Full steps are in the
GitHub README.
Use it from Python
import chess
from laya_chess import LayaChessModel
model = LayaChessModel("datafreak/laya-chess")
for move, win in model.score_moves(chess.Board())[:5]:
print(move, f"{win:.0%}")
Credits
Laya by Convai Innovations (Apache 2.0) 路 ChessBench by Google DeepMind 路 Stockfish 路 python-chess
- Downloads last month
- 20
Model tree for datafreak/laya-chess
Base model
convaiinnovations/laya