bots-garden/mini-mepublic Fork
⑂ feature/llamacpp-fallback
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/mini-me.git
git clone ssh://git@rickub.com/bots-garden/mini-me.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
🛟 Updated. 79606ef · on feature/llamacpp-fallback · k33g · 28d ago
README.en.md · 81 lines · 5.9 KBmarkdown
Blame HistoryOpen raw

Demo: a Dungeon Master helped by a decider that picks the spell

Version française

A novice wizard describes a situation; a decider (LiquidAI d1-3B, spell.yaml, ACP name sidekick) picks one of the wizard's five spells, and a chat agent playing the Dungeon Master (Qwen3.5-4B, dungeon_master.yaml) explains the choice. A preGeneration hook written in Go, hooks/ask-decider/ — the hook of decision-chat-golang — sends each message to the decider and adds its answer under the message.

Editable source: decision-dnd-flow.drawio (draw.io); decision-dnd-flow.svg is the same picture.

File Role
spell.yaml the decider: one choice question, spell — fireball, arcane_bolt, shield, misty_step, sleep, each described by when to cast it
dungeon_master.yaml the chat agent, its system prompt (below), and its preGeneration hook: cd "$MM_CONFIG_DIR/hooks/ask-decider" && DECIDER_DUMP=.mm/decider go run . spell.yaml
hooks/ask-decider/ the Go hook (its own module): runs the decider named by its argument, writes spell: <name> (confidence <c>) under the message

Run it

Pull the models into llmman once:

llmman pull hf.co/LiquidAI/d1-3B-GGUF:Q4_K_M
llmman pull hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M

Then, from this directory (Go must be on the PATH):

mm tui dungeon_master.yaml
mm -config dungeon_master.yaml -p "An ogre is raising its club to hit me right now."
mm -config spell.yaml -p "An ogre is raising its club to hit me right now."   # the decider alone, its JSON

See what the decider answered

  • In the chat, before every answer: spell.yaml sets display: true, so the decider's answers appear as indented JSON, in blue under ‣ hook, between your question and the Dungeon Master's answer (a fenced block in an editor). Remove the line to hide them.
  • The decider alone: mm -config spell.yaml -p "…" prints the server's JSON (add | jq), headed by "display":true.
  • One JSON file per question: DECIDER_DUMP=.mm/decider in the hook's command (on in dungeon_master.yaml; remove it to stop). Each question leaves .mm/decider/<time>-spell.json with the question, the decider's whole response, the line handed to the Dungeon Master — or the error when the decider failed. .mm/ is git-ignored.
  • What the Dungeon Master read: AGENT_TRACE=true mm dungeon_master.yaml, then the last user message of .mm/traces/…request.json.

What was measured (2026-10-24, from the sandbox, llmman on the host)

The decider:

Situation spell
Five goblins are standing in a tight group 40 feet away. My friends are behind me. fireball (0.50)
An ogre is raising its club to hit me right now. shield (0.85)
Two wolves have grabbed me and the rest of the party is far away. misty_step (0.47)
One goblin is left, almost dead, hiding behind a crate. arcane_bolt (0.58)
Six kobolds are sneaking toward our camp; the paladin wants to question them alive. fireball (0.44) — wrong, sleep fits

With the first system prompt ("help the novice wizard choose… Display all the data provided and the confidence score"), the Dungeon Master went its own way: 7 to 31 s per answer, long analyses, and it followed the decider's pick once out of five (the ogre). It read the confidence as the chance the spell succeeds ("0.50 suggests it might not be the most precise choice"), recommended spells the wizard does not have (Magic Missile, Ray of Frost, Disintegrate, Hold Person), and gave them confidences of its own ("Magic Missile (Confidence: 0.90)"). On the kobolds it was right to reject fireball.

With a system prompt that says what the line means — the one now in dungeon_master.yaml — the five spells and no other, the confidence is how sure the decider is of its pick, three short parts:

system: |
  You are the Dungeon Master. You help a novice wizard choose a spell for the
  situation the player describes. The wizard knows exactly five spells:
  fireball, arcane_bolt, shield, misty_step and sleep. Never suggest another.

  Under each message you find a block "[context added by a hook]" with the
  line "spell: <name> (confidence <c>)". It comes from a decision model that
  read the situation: <name> is the spell it picked among the five, and <c>
  is how sure it is of that pick (0 to 1) — not the chance the spell works.

  Answer in three short parts: the spell and the confidence; one sentence on
  why it fits the situation; if the confidence is below 0.5, the other one of
  the five you would consider, and why.

2 to 4 s per answer, three lines each, only the five spells, and the decider's pick kept on the four situations where it was right, with an alternative when the confidence was under 0.5. On the kobolds, it answered "spell: sleep (confidence 0.85)": the right spell, but presented as the decider's answer with a confidence the decider never gave (it said fireball, 0.44). A chat model can quietly rewrite what it is handed; when the pick matters, show the decider's line to the player yourself (the debug dump, or the hook's own output), not only through the chat model.

The Dungeon Master's D&D rules are not checked here: some sentences are wrong ("its range might be too short" for a fireball at 40 feet).

Read more

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Demo: a Dungeon Master helped by a decider that picks the spell

*[Version française](README.fr.md)*

A novice wizard describes a situation; a decider (LiquidAI d1-3B, `spell.yaml`, ACP name `sidekick`) picks one of the wizard's five spells, and a chat agent playing the Dungeon Master (Qwen3.5-4B, `dungeon_master.yaml`) explains the choice. A `preGeneration` hook written in Go, `hooks/ask-decider/` — the hook of [`decision-chat-golang`](../decision-chat-golang/README.en.md) — sends each message to the decider and adds its answer under the message.

![The decision-dnd flow: the player's situation goes to a Go preGeneration hook, which asks the spell decider and passes its pick to the Dungeon Master; a debug dump keeps one JSON file per question](decision-dnd-flow.svg)

Editable source: `decision-dnd-flow.drawio` (draw.io); `decision-dnd-flow.svg` is the same picture.

| File | Role |
|------|------|
| `spell.yaml` | the decider: one `choice` question, `spell` — `fireball`, `arcane_bolt`, `shield`, `misty_step`, `sleep`, each described by **when** to cast it |
| `dungeon_master.yaml` | the chat agent, its system prompt (below), and its `preGeneration` hook: `cd "$MM_CONFIG_DIR/hooks/ask-decider" && DECIDER_DUMP=.mm/decider go run . spell.yaml` |
| `hooks/ask-decider/` | the Go hook (its own module): runs the decider named by its argument, writes `spell: <name> (confidence <c>)` under the message |

## Run it

Pull the models into llmman once:

```bash
llmman pull hf.co/LiquidAI/d1-3B-GGUF:Q4_K_M
llmman pull hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M
```

Then, from this directory (Go must be on the PATH):

```bash
mm tui dungeon_master.yaml
mm -config dungeon_master.yaml -p "An ogre is raising its club to hit me right now."
mm -config spell.yaml -p "An ogre is raising its club to hit me right now."   # the decider alone, its JSON
```

## See what the decider answered

- **In the chat, before every answer**: `spell.yaml` sets `display: true`, so the decider's answers appear as indented JSON, in blue under `‣ hook`, between your question and the Dungeon Master's answer (a fenced block in an editor). Remove the line to hide them.
- **The decider alone**: `mm -config spell.yaml -p "…"` prints the server's JSON (add `| jq`), headed by `"display":true`.
- **One JSON file per question**: `DECIDER_DUMP=.mm/decider` in the hook's command (on in `dungeon_master.yaml`; remove it to stop). Each question leaves `.mm/decider/<time>-spell.json` with the question, the decider's whole response, the line handed to the Dungeon Master — or the error when the decider failed. `.mm/` is git-ignored.
- **What the Dungeon Master read**: `AGENT_TRACE=true mm dungeon_master.yaml`, then the last user message of `.mm/traces/…request.json`.

## What was measured (2026-10-24, from the sandbox, llmman on the host)

The decider:

| Situation | spell |
|-----------|-------|
| Five goblins are standing in a tight group 40 feet away. My friends are behind me. | fireball (0.50) |
| An ogre is raising its club to hit me right now. | shield (0.85) |
| Two wolves have grabbed me and the rest of the party is far away. | misty_step (0.47) |
| One goblin is left, almost dead, hiding behind a crate. | arcane_bolt (0.58) |
| Six kobolds are sneaking toward our camp; the paladin wants to question them alive. | fireball (0.44) — wrong, `sleep` fits |

**With the first system prompt** ("help the novice wizard choose… Display all the data provided and the confidence score"), the Dungeon Master went its own way: 7 to 31 s per answer, long analyses, and it followed the decider's pick once out of five (the ogre). It read the confidence as the chance the spell succeeds ("0.50 suggests it might not be the most precise choice"), recommended spells the wizard does not have (Magic Missile, Ray of Frost, Disintegrate, Hold Person), and gave them confidences of its own ("Magic Missile (Confidence: 0.90)"). On the kobolds it was right to reject `fireball`.

**With a system prompt that says what the line means** — the one now in `dungeon_master.yaml` — the five spells and no other, the confidence is how sure the decider is of its pick, three short parts:

```yaml
system: |
  You are the Dungeon Master. You help a novice wizard choose a spell for the
  situation the player describes. The wizard knows exactly five spells:
  fireball, arcane_bolt, shield, misty_step and sleep. Never suggest another.

  Under each message you find a block "[context added by a hook]" with the
  line "spell: <name> (confidence <c>)". It comes from a decision model that
  read the situation: <name> is the spell it picked among the five, and <c>
  is how sure it is of that pick (0 to 1) — not the chance the spell works.

  Answer in three short parts: the spell and the confidence; one sentence on
  why it fits the situation; if the confidence is below 0.5, the other one of
  the five you would consider, and why.
```

2 to 4 s per answer, three lines each, only the five spells, and the decider's pick kept on the four situations where it was right, with an alternative when the confidence was under 0.5. On the kobolds, it answered "spell: sleep (confidence 0.85)": the right spell, but presented as the decider's answer with a confidence the decider never gave (it said fireball, 0.44). A chat model can quietly rewrite what it is handed; when the pick matters, show the decider's line to the player yourself (the debug dump, or the hook's own output), not only through the chat model.

The Dungeon Master's D&D rules are not checked here: some sentences are wrong ("its range might be too short" for a fireball at 40 feet).

## Read more

- [How to write the questions of a decider](../../docs/en/how-to/write-decision-questions.md) — the spell example and three others
- [`decision-chat-golang`](../decision-chat-golang/README.en.md) — the same hook, the same flow, for Go programming
- [Hooks reference — `preGeneration`](../../docs/en/reference/hooks.md#pregeneration)