immortaltatsu/ghostai-pro
GhostAI Pro — MiniCPM5-2B app-contract
On-device tool-calling model for the GhostWallet Solana app. Given the app's system prompt and a retrieved slice of its 174-tool catalog, it emits a single Hermes-style tool call, then answers in one grounded line from the tool result.
<tool_call>{"name":"get_wallet_balance","arguments":{}}</tool_call>GhostAI Pro is the 2B tier of the Ghost AI bake-off, fine-tuned from `openbmb/MiniCPM5-2B` (Apache-2.0) on the app's real contract. It uses the same output shape as the LFM/Qwen tiers, so it drops into the existing app parser, tool validator, execution loop, and confirm gate unchanged.
Results
Held-out app-contract corpus (HF, greedy)
data/ghost-ai-app-contract-v4.parquet test split, 823 unique rows.
App harness — Q4KM on llama.cpp, greedy
Two harnesses that import the app's real retrieval, prompt assembly, parser, validator, execution loop, and value-moving confirm gate.
Single turn (56 held-out utterances; hash-fallback retrieval):
tool_correct is capped by retrieval: the app surfaces the correct tool in its top-5 catalog on only 10.7% of these utterances. With the reference tool forced into the catalog the model calls it 66.7% of the time.
End-to-end (ChatSession.send(), 76 cases / 88 turns):
Latency on the Q4KM GGUF (llama.cpp, A100): 189 ms/generation p50, 44 completion tokens/turn.
Quants
Both 4-bit quants were produced with an importance matrix (imatrix) computed from 1,200 app-contract calibration traces, so the quantization is tuned to this domain.
GhostAI Pro uses MiniCPM5's ChatML framing and is text-only.
Serving with llama.cpp (important)
MiniCPM5-2B tokenizes <tool_call> / </tool_call> as special tokens. llama.cpp and llama-server strip special tokens by default, which would delete the Hermes markers the app parser needs. Serve with --special, disable reasoning extraction, and keep the empty think block:
llama-server -m ghostai-pro-Q4_K_M.gguf \
-ngl 99 -c 8192 --jinja --special \
--reasoning-format none \
--chat-template-kwargs '{"enable_thinking": false}'Files
Training
- Corpus:
ghost-ai-app-contract-v4— 5,119 traces over 174/174 app tools (2,847 tool-call, 1,984 grounded-answer, 288 chat), split 4,259 train / 860 held-out by utterance template. - Objective: SFT (TRL
SFTTrainer, DeepSpeed ZeRO-3, bf16, 2×A100-40GB), lr 1e-5, effective batch 32, max length 2048, assistant-only loss. - Chat template: MiniCPM5 ships no
{% generation %}markers, so assistant-only loss would silently fall back to full-sequence loss. Training used a copy of the upstream template with the assistant branch wrapped in{% generation %}; the inference template shipped here is the original. - Epochs: 3 run, but epoch 1 shipped — eval loss rose afterwards (0.147 → 0.157 → 0.192), so epochs 2–3 only overfit. Imatrix perplexity of the epoch-1 weights (12.34) is well below the epoch-3 weights (18.01).
Base model: `openbmb/MiniCPM5-2B`, Apache-2.0.
