Instructions to use campavao/pi-mon with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use campavao/pi-mon 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 campavao/pi-mon:Q4_0 # Run inference directly in the terminal: llama cli -hf campavao/pi-mon:Q4_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf campavao/pi-mon:Q4_0 # Run inference directly in the terminal: llama cli -hf campavao/pi-mon:Q4_0
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 campavao/pi-mon:Q4_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf campavao/pi-mon:Q4_0
Use Docker
docker model run hf.co/campavao/pi-mon:Q4_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use campavao/pi-mon with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "campavao/pi-mon" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "campavao/pi-mon", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/campavao/pi-mon:Q4_0
- Ollama
How to use campavao/pi-mon with Ollama:
ollama run hf.co/campavao/pi-mon:Q4_0
- Unsloth Desktop
- Pi
How to use campavao/pi-mon with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf campavao/pi-mon:Q4_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "campavao/pi-mon:Q4_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use campavao/pi-mon with Docker Model Runner:
docker model run hf.co/campavao/pi-mon:Q4_0
- Lemonade
How to use campavao/pi-mon with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull campavao/pi-mon:Q4_0
Run and chat with the model
lemonade run user.pi-mon-Q4_0
List all available models
lemonade list
- Hermes Agent
How to use campavao/pi-mon with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf campavao/pi-mon:Q4_0
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default campavao/pi-mon:Q4_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use campavao/pi-mon with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf campavao/pi-mon:Q4_0
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "campavao/pi-mon:Q4_0" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
pi-mon choice model (0.8B, q4_0 GGUF)
This model plays Pokemon Red through pi-mon, on the CPU of a Raspberry Pi 5. It is a LoRA fine-tune of Qwen/Qwen3.5-0.8B, merged and quantized to q4_0 for llama.cpp.
The model does not see the screen and does not press buttons. At each decision point pi-mon describes the game in a few lines of text, and the model answers with one high-level choice and a short reason. pi-mon checks the choice, carries it out in the emulator, and reports what happened. How pi-mon works explains the loop.
Files
| File | Size | SHA-256 |
|---|---|---|
pi-mon-choice-q4_0.gguf |
501,452,384 bytes | b42040a8e4e4ede7c0042764d675e8a87fdc38aaad036c9bdf8eea94aa633790 |
pi-mon fetch-model downloads this file and checks the hash. This is training round 12 (r12).
Prompt format
pi-mon writes the prompt. The current format is v7, and the model expects exactly that format. Other formats or
hand-written prompts give poor answers. The system message is one fixed line:
You play Pokemon Red. Read the state and pick one choice. Answer as CHOICE: <choice> then REASON: <short reason>.
These two examples come from the r12 test set. An overworld decision:
MAP PEWTER_CITY 11,16 facing S
GOAL Defeat Brock (Boulder Badge) | route PEWTER_CITY>PEWTER_GYM
BADGES 0 | SCENE overworld
PARTY 1 Rattata L8 23/23 ; 2 Charmander L12 32/32
EXITS ROUTE_3 E ; ROUTE_2 S ; MUSEUM_1F 14,7 ; MUSEUM_1F 19,5 ; PEWTER_GYM 16,17 ; PEWTER_MART 23,17 ; PEWTER_NIDORAN_HOUSE 29,13 ; PEWTER_POKECENTER 13,25 ; PEWTER_SPEECH_HOUSE 7,29
NEAR SIGN 11,17 ; COOLTRAINER_F 8,15 ; SIGN 15,9 ; SIGN 14,25
CENTER visited | respawn PEWTER_CITY
LAST SWITCH 2 ; FIGHT 3 ; WALK 11,16
CHOICE: GO PEWTER_GYM 16,17
REASON: Heading to Pewter Gym 16,17.
A battle decision:
MAP PEWTER_GYM 4,2 facing N
GOAL Defeat Brock (Boulder Badge)
BADGES 0 | SCENE battle menu
PARTY 1 Charmeleon L17 44/49 ; 2 Rattata L12 30/30
ENEMY Geodude L12 69% trainer
MOVES 1 Scratch pp16 WEAK ~15% ; 2 Growl pp40 ; 3 Ember pp15 WEAK ~46% ; 4 Leer pp30
MATCH foe ROCK GROUND | 1* x.5 L17 ; 2 x.5 L12
LAST PRESS U U ; PRESS U U ; FIGHT 3
CHOICE: FIGHT 3
REASON: Charmeleon uses Ember on Geodude. Not very effective.
pi-mon serves the model with llama-server -c 4096, samples at temperature 0, turns thinking off
(chat_template_kwargs: {"enable_thinking": false}), and passes a GBNF grammar with every request. The grammar allows
only the choices that exist at that spot, so the answer always parses.
Results
All runs below are on Pokemon Red (UE) with pi-mon's harness: grammar, precheck, watchdog, and checkpoint reloads. No
other model and no scripted player makes decisions during play. The harness answers only when no model answer passes
the precheck in 4 tries, and then it walks in place or presses B. A "new game" starts from the save that
pi-mon bootstrap makes: a scripted intro player names the player, picks Squirtle, and delivers Oak's Parcel. The
evals start from the same point with each starter.
- A full game on a Raspberry Pi 5. A run from a new game reached the Hall of Fame 21 h 44 min after it started, with Squirtle. The previous round, r11, played the first 6 h 20 min, up to Silph Co. r12 played the rest, through Giovanni, the last badges, Victory Road, and the Elite Four.
- Fresh-start evals. r12 started a new game with each of the 3 starters. All 3 runs reached 8 badges: Charmander in 3,907 decisions, Bulbasaur in 3,949, and Squirtle in 5,184.
- Late-game evals. From a save in front of the Elite Four, r12 reached the Hall of Fame in 403 decisions. From a save in Victory Road, it reached the Hall of Fame in 2,223 decisions.
Limitations
- The model plays only through pi-mon. It knows pi-mon's choice vocabulary and prompt format, and nothing else.
- It plays only Pokemon Red (UE). pi-mon checks the ROM's SHA-1 and refuses every other version.
- It is slow by design. A game takes about a day of wall-clock time on a Pi 5.
- It relies on the harness. Without the grammar, the precheck, and the watchdog's bans and reloads, it repeats failing choices.
- It loses battles and sometimes loops in one place for hours. Victory Road and long dungeons are the hardest parts.
- The reasons are short and sometimes wrong. They are training targets, not explanations of the model's computation.
Training
LoRA SFT on Qwen/Qwen3.5-0.8B, over 12 rounds. The r12 set has 40,000 training examples. Scripted players wrote the examples by playing the game in the same choice format. The training code and data are not released.
No game content
This repository holds model weights only. It includes no ROM, no game art, no sprites, no music, and no save states. pi-mon needs your own legally dumped Pokemon Red (UE) ROM and checks its SHA-1. pi-mon and this model are an unofficial fan project and are not affiliated with Nintendo, Game Freak, Creatures Inc., or The Pokemon Company.
License
Apache License 2.0, the license of the base model, Qwen3.5-0.8B by the Qwen team, Alibaba Cloud. pi-mon's code is MIT.
- Downloads last month
- 66
4-bit