Instructions to use FlameF0X/ChessSLM-PM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FlameF0X/ChessSLM-PM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FlameF0X/ChessSLM-PM")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FlameF0X/ChessSLM-PM") model = AutoModelForCausalLM.from_pretrained("FlameF0X/ChessSLM-PM") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FlameF0X/ChessSLM-PM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FlameF0X/ChessSLM-PM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FlameF0X/ChessSLM-PM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FlameF0X/ChessSLM-PM
- SGLang
How to use FlameF0X/ChessSLM-PM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "FlameF0X/ChessSLM-PM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FlameF0X/ChessSLM-PM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "FlameF0X/ChessSLM-PM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FlameF0X/ChessSLM-PM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FlameF0X/ChessSLM-PM with Docker Model Runner:
docker model run hf.co/FlameF0X/ChessSLM-PM
| license: apache-2.0 | |
| datasets: | |
| - mlabonne/chessllm | |
| library_name: transformers | |
| tags: | |
| - chess | |
| pipeline_tag: text-generation | |
| base_model: | |
| - FlameF0X/ChessSLM | |
| <div align="center"> | |
| <img src="https://cdn-uploads.huggingface.co/production/uploads/6615494716917dfdc645c44e/IEb4W62mlcCFKom7Fd4qi.jpeg" alt="NanoRS Banner" style="width: 100%; max-width: 100%; height: auto; display: inline-block; margin-bottom: 0.5em; margin-top: 0.5em; reading-order: 20px; border-radius: 20px;"/> | |
| </div> | |
| <br> | |
| # ChessSLM | |
| **ChessSLM-PM** is a small language model build on top of **ChessSLM**, designed to play chess using natural language move generation. | |
| Despite having only **30M parameters**, it is capable of competing with and occasionally outperforming larger language models in chess-playing tasks. | |
| The model is based on the **ChessSLM** and was *fine-tuned* on **441,000 chess games** rated over 2000 elo from the `mlabonne/chessllm` dataset using **SAN (Standard Algebraic Notation)**. | |
| Play against ChessSLM [here](https://flamef0x.github.io/other/chess). | |
| --- | |
| ## Overview | |
| - **Architecture:** GPT-2 | |
| - **Parameters:** ~30M | |
| - **Training data:** 441k chess games rated over 2000 elo | |
| - **Notation:** SAN (Standard Algebraic Notation) | |
| - **Task:** Autoregressive chess move generation | |
| ChessSLM demonstrates that **specialized small language models can perform competitively in narrow domains** such as chess. | |
| --- | |
| ## Capabilities | |
| ChessSLM can play chess by generating moves sequentially in SAN notation. | |
| It has been evaluated in matches against several language models, including: | |
| - Claude [Won against it] | |
| - Gemini [Lost again it] | |
| - Qwen | |
| - GPT-2 | |
| - GPT-Neo | |
| - Pythia | |
| - LLaMA | |
| - Mistral | |
| - other small chess-oriented models | |
| The model achieves an averaging rating of **around {tba} Elo** against other language models despite its small size. | |
| --- | |
| | Model | Elo Rating | | |
| | ------------------------------ | ---------- | | |
| | **FlameF0X/ChessSLM** | 1154 | | |
| | DedeProGames/mini-chennus | 1114 | | |
| | EleutherAI/pythia-70m-deduped | 1099 | | |
| | nlpguy/smolchess-v2 | 1092 | | |
| | DedeProGames/dialochess | 1078 | | |
| | nlpguy/amdchess-v9 | 1073 | | |
| | mlabonne/grandpythia-200k-70m | 1065 | | |
| | **FlameF0X/ChessSLM-PM** | 1055 | | |
| | DedeProGames/Chesser-248K-Mini | 1050 | | |
| | bharathrajcl/chess_llama_68m | 1048 | | |
| | **FlameF0X/ChessSLM-RL** | 1047 | | |
| | distilbert/distilgpt2 | 1047 | | |
| | Mattimax/EliaChess-70m | 1047 | | |
| | HuggingFaceTB/SmolLM2-135M | 1042 | | |
| | nlpguy/amdchess-v5 | 1041 | | |
| | facebook/opt-125m | 1041 | | |
| | EleutherAI/pythia-14m | 1037 | | |
| | DedeProGames/chennus | 1034 | | |
| | Smilyai-labs/Smily-ultra-1 | 1034 | | |
| | huyvux3005/chessllm_FPT | 1034 | | |
| --- | |
| ## Limitations | |
| Like many language-model-based chess systems, ChessSLM has several limitations: | |
| - **Illegal move hallucinations:** The model may occasionally generate moves that violate chess rules. | |
| - **No board-state verification:** Moves are generated purely from learned patterns rather than a validated game state. | |
| - **Limited strategic depth:** While competitive at lower Elo levels, it cannot match dedicated chess engines. | |
| These limitations are common for **pure language-model chess agents** that do not use external rule engines. | |
| ## Summary | |
| ChessSLM shows that **very small language models can achieve meaningful chess performance** when trained on domain-specific data. | |
| It serves as a lightweight baseline for exploring **LLM-based chess agents** and **specialized small language models (SLMs)**. |