Instructions to use sruly/human-chess-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use sruly/human-chess-mlx with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("sruly/human-chess-mlx") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use sruly/human-chess-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "sruly/human-chess-mlx" --prompt "Once upon a time"
- Atomic Chat
Human Chess MLX
An autoregressive MLX model trained on complete human chess-game histories. Moves are atomic UCI tokens. Metadata and padding may be input context, but training and validation loss are calculated only for human move targets.
The checkpoint was trained on 27,971,437 chronological January 2025 Lichess games (45.6% of one shuffled epoch). Lichess database exports are CC0.
Configuration
- Context length:
256tokens - Vocabulary size:
2075 - Transformer layers:
6 - Embedding width:
384 - Validation bits per human move:
4.098970 - Out-of-time test bits per human move:
4.114732 - Raw exact next-move accuracy:
27.68% - Raw top-1 legal-move rate:
87.29% - Legal-masked top-1 accuracy:
30.97% - Legal-masked top-5 accuracy:
66.82%
Metrics use fixed 8,192-game chronological holdouts. The test split was evaluated only after training stopped.
Loading
import mlx.core as mx
from chess_model import ChessTokenizer, load_model
model = load_model(".")
tokenizer = ChessTokenizer.from_pretrained(".")
tokens = mx.array([tokenizer.encode_tokens(["BOS"])])
logits = model(tokens)
This is a custom MLX architecture, not a Transformers AutoModelForCausalLM checkpoint. The repository includes chess_model.py for loading.
Legal-move-masked inference is available through legal_inference.py; it reconstructs the board from the full supplied move history before scoring only legal continuations.
Source code: https://github.com/SrulyRosenblat/human-chess-mlx
License
AGPL-3.0. See LICENSE.
- Downloads last month
- 242
Quantized