Instructions to use LLM-course/square_chess with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LLM-course/square_chess with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LLM-course/square_chess")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("LLM-course/square_chess", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LLM-course/square_chess with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LLM-course/square_chess" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM-course/square_chess", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LLM-course/square_chess
- SGLang
How to use LLM-course/square_chess 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 "LLM-course/square_chess" \ --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": "LLM-course/square_chess", "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 "LLM-course/square_chess" \ --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": "LLM-course/square_chess", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LLM-course/square_chess with Docker Model Runner:
docker model run hf.co/LLM-course/square_chess
| { | |
| "architectures": [ | |
| "ChessForCausalLM" | |
| ], | |
| "bos_token_id": 1, | |
| "dropout": 0.05, | |
| "dtype": "float32", | |
| "eos_token_id": 2, | |
| "id_to_token_text": [ | |
| "", | |
| "", | |
| "", | |
| "", | |
| "a1", | |
| "b1", | |
| "c1", | |
| "d1", | |
| "e1", | |
| "f1", | |
| "g1", | |
| "h1", | |
| "a2", | |
| "b2", | |
| "c2", | |
| "d2", | |
| "e2", | |
| "f2", | |
| "g2", | |
| "h2", | |
| "a3", | |
| "b3", | |
| "c3", | |
| "d3", | |
| "e3", | |
| "f3", | |
| "g3", | |
| "h3", | |
| "a4", | |
| "b4", | |
| "c4", | |
| "d4", | |
| "e4", | |
| "f4", | |
| "g4", | |
| "h4", | |
| "a5", | |
| "b5", | |
| "c5", | |
| "d5", | |
| "e5", | |
| "f5", | |
| "g5", | |
| "h5", | |
| "a6", | |
| "b6", | |
| "c6", | |
| "d6", | |
| "e6", | |
| "f6", | |
| "g6", | |
| "h6", | |
| "a7", | |
| "b7", | |
| "c7", | |
| "d7", | |
| "e7", | |
| "f7", | |
| "g7", | |
| "h7", | |
| "a8", | |
| "b8", | |
| "c8", | |
| "d8", | |
| "e8", | |
| "f8", | |
| "g8", | |
| "h8", | |
| "q", | |
| "r", | |
| "b", | |
| "n" | |
| ], | |
| "layer_norm_epsilon": 1e-05, | |
| "mask_invalid_moves": true, | |
| "model_type": "chess_transformer", | |
| "n_ctx": 256, | |
| "n_embd": 128, | |
| "n_head": 4, | |
| "n_inner": 384, | |
| "n_layer": 5, | |
| "pad_token_id": 0, | |
| "tie_weights": true, | |
| "transformers_version": "4.57.5", | |
| "unk_token_id": 3, | |
| "vocab_size": 72 | |
| } | |