Instructions to use l898974766/gomoku with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use l898974766/gomoku with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="l898974766/gomoku") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("l898974766/gomoku") model = AutoModelForCausalLM.from_pretrained("l898974766/gomoku", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use l898974766/gomoku with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf l898974766/gomoku:F32 # Run inference directly in the terminal: llama cli -hf l898974766/gomoku:F32
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf l898974766/gomoku:F32 # Run inference directly in the terminal: llama cli -hf l898974766/gomoku:F32
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf l898974766/gomoku:F32 # Run inference directly in the terminal: ./build/bin/llama cli -hf l898974766/gomoku:F32
Use Docker
docker model run hf.co/l898974766/gomoku:F32
- Llama new
- LM Studio
- Jan
- vLLM
How to use l898974766/gomoku with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "l898974766/gomoku" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "l898974766/gomoku", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/l898974766/gomoku:F32
- SGLang
How to use l898974766/gomoku 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 "l898974766/gomoku" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "l898974766/gomoku", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "l898974766/gomoku" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "l898974766/gomoku", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use l898974766/gomoku with Ollama:
ollama run hf.co/l898974766/gomoku:F32
- Unsloth Desktop
- Docker Model Runner
How to use l898974766/gomoku with Docker Model Runner:
docker model run hf.co/l898974766/gomoku:F32
- Lemonade
How to use l898974766/gomoku with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull l898974766/gomoku:F32
Run and chat with the model
lemonade run user.gomoku-F32
List all available models
lemonade list
- Atomic Chat
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf l898974766/gomoku:F32# Run inference directly in the terminal:
llama cli -hf l898974766/gomoku:F32Build from source code
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-app# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama serve -hf l898974766/gomoku:F32# Run inference directly in the terminal:
./build/bin/llama cli -hf l898974766/gomoku:F32Use Docker
docker model run hf.co/l898974766/gomoku:F32Gomoku — Compact Functional MoE
15×15自由五子棋专用解码模型:完整棋盘作为上下文,生成落子坐标。五个及以上连线获胜,不含禁手。标准 MixtralForCausalLM,1,988,096参数,F32,无量化。相比上次默认发布的10,809,984参数模型,参数减少 **81.6%**。
六层、隐藏维度64、四个注意力头、专家FFN维度96,每层八专家全部参与计算,词表15,643,上下文2048。七组训练功能目标为棋形关系、位置、优先级、风险、方向棋形证据、防守、主动性;第八路用于综合决策。专家名表示监督目标,不代表已经证明严格独立分工。没有运行时教师、搜索、合法动作掩码或错误修复。
上次发布与本次训练
上次发布提供约1081万参数的Dense Llama和稀疏Mixtral MoE。本次在较小的棋盘词表和64维结构上,使用七组功能监督,并追加256次局面奖励优化与监督回放,按验证保留第256次更新的检查点。16个动作从完整词表在线采样,非法动作奖励-8,立即成五、唯一堵四与可验证强杀获得正奖励;另有精确期望奖励、教师最终策略和监督回放。它是局面奖励与监督混合训练,不是完整对局PPO。
训练整理了2,048个过去对局的新回放局面,重点抽取非法落点及其前几手;另留128个困难验证局面。所有教师和规则只用于训练、标注和裁判,不分发到推理包中。训练辅助读出也不参与部署。
本次减少参数来自词表和网络结构变化,不是降低数值精度。八路全部计算不意味着比稀疏模型更快,实际CPU耗时见下表。
| 模型 | 参数量 | 即时战术 | 三步逻辑 | 五手证书走法 | 合法输出 | 历史局面复测 |
|---|---|---|---|---|---|---|
| 上次发布 Dense | 10,809,984 | 477/512 | 128/128 | 106/128 | 766/768 | 153/224 |
| 上次发布稀疏 MoE | 10,813,056 | 463/512 | 128/128 | 105/128 | 767/768 | 151/224 |
| 本次功能 MoE | 1,988,096 | 495/512 | 125/128 | 127/128 | 768/768 | 164/224 |
| 完整对局 | 本次胜 | 本次负 | 本次非法负 | 对手非法负 | 和棋/截断 |
|---|---|---|---|---|---|
| 本次对上次发布 Dense | 43 | 21 | 3 | 7 | 0/0 |
| 本次对上次发布稀疏 MoE | 43 | 21 | 4 | 6 | 0/0 |
| CPU 原生Ollama、F32、2线程 | 中位计算耗时(不含加载) |
|---|---|
| 上次发布 Dense | 162.9 ms |
| 上次发布稀疏 MoE | 99.0 ms |
| 本次功能 MoE | 185.9 ms |
新测试包含512个即时战术、128个三步逻辑、128个五手证书局面;棋盘实例按旋转镜像与已知数据去重,但训练、测试共享有限战术模板。五手命中是充分强杀证书走法的一致率,不是穷举最优策略正确率。历史224局面是与标注走法的一致率复测,其他走法未必错误,不能当作全新泛化证据。
对局为32个新中心区域四手开局,交换颜色,每组64局。胜负包含对手非法输出判负,表中单独列出双方非法负;这不是Elo或专业棋力评级。本次仍可能漏防或生成非法落点。本次通过预先设定的静态和实战质量检查,按参数显著减少这一条件发布。 不据此宣称棋力远超上次。
全部权重通过F32位级转换核对,原生Ollama抽测96/96个完整输出与HF一致。耗时使用同一CPU、2线程、相同8个棋盘,各自使用所需协议;每次显式卸载清空缓存,表中为不含加载的中位计算耗时。
下载与更新
hf download l898974766/gomoku --local-dir gomoku-small --exclude 'moe/*'
cd gomoku-small
本次更换了词表和棋盘文本协议。 请将权重、tokenizer和客户端一起下载到新目录;旧客户端手写的棋盘字符串不能直接用于本次模型。Python的 messages(board) 接口保持一致,请使用本包的 pointer_protocol.py 编码完整棋盘。
上次Dense及完整文件可从上次发布修订下载;上次稀疏MoE继续保留在 moe/,其包内文档描述的是上次发布。
点击棋盘
在下载的完整目录中使用Python 3.10:
pip install -r requirements.txt
python play_terminal.py
# 执白:
python play_terminal.py --human white
终端建议至少80列×26行。左键落子,方向键和回车也可操作;U悔棋、R重开、Q退出。Windows另装 requirements-terminal.txt。默认加载本目录HF权重,非法输出会停局。
原生Ollama
启动Ollama后,在本目录运行:
ollama create gomoku-small -f Modelfile
python play_terminal.py --backend ollama
# 逐回合输入H8等坐标:
python play.py
默认地址 http://127.0.0.1:11434,可用 --url 修改。Ollama客户端只需Python标准库。
curl应手
黑棋H8后,模型执白的完整请求:
python3 - <<'PYCODE' > /tmp/gomoku-request.json
import json
from pointer_protocol import messages, relative
board = [0] * 225
board[112] = 1
print(json.dumps({'model': 'gomoku-small', 'messages': messages(relative(board, 2)), 'stream': False,
'options': {'temperature': 0, 'num_ctx': 2048, 'num_predict': 4, 'repeat_penalty': 1}}))
PYCODE
curl --fail-with-body http://127.0.0.1:11434/api/chat \
-H 'Content-Type: application/json' --data-binary @/tmp/gomoku-request.json
响应 message.content 为坐标。继续下棋时维护board(0空、1黑、2白),每轮提交当前完整棋盘。请用包内协议编码,任意自然语言棋盘不是等价输入。
HF使用标准 AutoTokenizer、AutoModelForCausalLM,无需 trust_remote_code。权重为 model.safetensors,原生模型为 gomoku-f32.gguf,文件哈希见 manifest.json。许可见LICENSE与NOTICE。
- Downloads last month
- 1,156
Install (macOS, Linux)
# Start a local OpenAI-compatible server with a web UI: llama serve -hf l898974766/gomoku:F32# Run inference directly in the terminal: llama cli -hf l898974766/gomoku:F32