Instructions to use DedeProGames/Checkmate-5M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DedeProGames/Checkmate-5M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DedeProGames/Checkmate-5M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DedeProGames/Checkmate-5M") model = AutoModelForCausalLM.from_pretrained("DedeProGames/Checkmate-5M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DedeProGames/Checkmate-5M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DedeProGames/Checkmate-5M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DedeProGames/Checkmate-5M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/DedeProGames/Checkmate-5M
- SGLang
How to use DedeProGames/Checkmate-5M 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 "DedeProGames/Checkmate-5M" \ --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": "DedeProGames/Checkmate-5M", "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 "DedeProGames/Checkmate-5M" \ --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": "DedeProGames/Checkmate-5M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use DedeProGames/Checkmate-5M with Docker Model Runner:
docker model run hf.co/DedeProGames/Checkmate-5M
|
Download README.md from DedeProGames/Checkmate-5M: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/DedeProGames/Checkmate-5M/resolve/main/README.md
- Command line
-
hf download hf://DedeProGames/Checkmate-5M/README.md
-
curl -L -o README.md https://huggingface.co/DedeProGames/Checkmate-5M/resolve/main/README.md
1.26 kB
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - chess | |
| - gpt_neox | |
| - pythia | |
| # Checkmate-5M | |
| A tiny chess move model built for the [Chess LLM Arena](https://huggingface.co/spaces/mlabonne/chessllm). | |
| - **Architecture:** Pythia / GPT-NeoX (6 layers, hidden size 128, 4 heads), trained from scratch. | |
| - **Parameters:** 4.8M | |
| - **Tokenizer:** move-level chess tokenizer: one token per SAN move (without `+`/`#`), plus the | |
| move-number prompt `1.` and single SAN characters. Every legal SAN move is a single token. | |
| - **Training:** the move-selection policy was optimized with reinforcement learning (policy | |
| gradient) on millions of simulated games against the models at the top of the arena | |
| leaderboard, then distilled into the network. | |
| - **Best used as White.** | |
| ## Usage in the arena | |
| Type `DedeProGames/Checkmate-5M` as the **White** model in the arena and press *Fight!*. | |
| ## Usage with transformers + outlines | |
| ```python | |
| import chess, re | |
| import outlines.models as models | |
| from outlines import generate | |
| model = models.transformers("DedeProGames/Checkmate-5M") | |
| board = chess.Board() | |
| legal = "|".join(re.escape(re.sub(r"[+#]", "", board.san(m))) for m in board.legal_moves) | |
| print(generate.regex(model, legal)("1.")) | |
| ``` | |