Spaces:
Runtime error
Runtime error
File size: 8,993 Bytes
62c0dc4 9a41b58 bc8b36a 0a01fc5 9a41b58 bc8b36a 9a41b58 62c0dc4 9a41b58 3389b73 bc8b36a 9a41b58 bc8b36a 9a41b58 bc8b36a 9a41b58 bc8b36a 9a41b58 bc8b36a 9a41b58 6f4c6b2 9a41b58 bc8b36a 9a41b58 bc8b36a 9a41b58 3389b73 177b746 | 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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | ---
title: mAIndlock
emoji: ๐ง
colorFrom: gray
colorTo: green
sdk: docker
app_port: 7860
pinned: true
license: mit
short_description: Escape room where every NPC is a mortal mind of tiny LLMs
models:
- openbmb/MiniCPM5-1B-GGUF
- openbmb/VoxCPM2
- nvidia/NVIDIA-Nemotron-3-Nano-4B-GGUF
tags:
- thousand-token-wood
- off-the-grid
- off-brand
- tiny-titan
- llama-champion
- llama-cpp
- openbmb
- minicpm
- nemotron
- agents
- game
- neuroscience
---
<p align="center">
<img src="media/banner.gif" alt="mAIndlock" width="820">
</p>
# ๐ง mAIndlock
**An escape room where the lock is a mind โ and you can kill it.**
โถ **[Watch the 100-second demo](https://youtu.be/zEwnVR1kTZU)** ยท ๐ฎ **[Play it live](https://huggingface.co/spaces/build-small-hackathon/maindlock)** ยท ๐ง **[Deliberation traces](https://huggingface.co/datasets/arbios/maindlock-brain-traces)**
Every character is not one chatbot with a personality prompt. It is a **hierarchy of six tiny
offline language models**, the way decision neuroscience says a brain is built. You don't crack
a code. You change a person's decision by reaching their fears and the memories they keep โ or
you burn their mind down trying.
Cruelty makes a mind ruminate, and rumination spends its finite **thinking tokens**. As they
burn, it **forgets** โ for good. At zero, the mind goes dark, taking everything it knew with it.
There is no reload. Only the next room, and your reputation travelling ahead of you.
> **Tokens are a lifespan here, not a context window.**
---
### โ๏ธ TL;DR for judges
- **Track โ Thousand Token Wood.** "A thousand tokens to think with" is literal: every mind
starts with **1000 thinking tokens of life**. Spend them cruelly and it dies.
- **OpenBMB ($10k).** **Six of the ~seven model calls per NPC turn are MiniCPM** โ the four
sensory brain regions (threat, memory, habit, cost), each a separate 1B call. MiniCPM *is* the
brain. (more under fear: the amygdala ruminates, firing extra calls that burn life) The
story's key-handover lines and the voiced demo are rendered with **OpenBMB VoxCPM2** TTS โ a
second model from the family, fully offline.
- **NVIDIA.** **Nemotron 3 Nano 4B** is the voice you actually argue with โ the dlPFC that turns
the integrated value into words.
- **Off the Grid / Llama Champion.** Pure **llama.cpp**, zero cloud APIs. Flip on airplane mode;
every mind keeps thinking. Token counts come from the runtime, so the life-burn is honest
accounting.
- **Off-Brand.** A custom canvas game served from FastAPI, with a Gradio block mounted at
[`/about`](/about) โ not a stock Gradio UI.
- **No CPU patience required:** menu โ **๐ Watch a mind** replays a *real* recorded session
instantly (zero model calls), so the six-region cascade, the token burn and a mind's death
are visible in ten seconds.
The brain is real, not a metaphor: [**docs/ARCHITECTURE.md**](https://github.com/Arbios/maindlock/blob/main/docs/ARCHITECTURE.md)
ยท read one mind's full deliberation in [**docs/TRACE.md**](https://github.com/Arbios/maindlock/blob/main/docs/TRACE.md).
---
## Every NPC is a brain, not a chatbot
<p align="center">
<img src="media/skull-conviction.png" alt="open the skull: six regions argue, each with a conviction read from its logits" width="760">
</p>
Your words travel through six regions โ **amygdala โ hippocampus โ striatum โ ACC โ vmPFC โ
dlPFC** โ each one a real call to a small local model. The amygdala rates threat; the
hippocampus surfaces a memory and whether it leans trust or fear; the striatum weighs habit; the
ACC weighs cost. The **vmPFC integrates them deterministically into one value** โ so the number
you see in the skull *is* the number that moves the relationship; the panel can never lie about
the outcome. The dlPFC speaks it in character.
**Open the skull** mid-conversation (๐ง ) and watch the regions argue about you in real time โ
each showing its **conviction**, read straight from the model's own token entropy. *A hosted
chat API never exposes that. Only a local mind can.*
Grounding is modern decision neuroscience โ the **value-based network** and the **dual-system**
(model-free habit vs. model-based goal) accounts โ deliberately **not** the debunked triune
"lizard brain." Acute stress shifts control from goal to habit (Schwabe & Wolf, 2009): that is
literally why lowering a character's fear unlocks their reasoning, and why fear burns life for
nothing.
## A life measured in words
<p align="center">
<img src="media/epitaph.png" alt="the epitaph a dead mind leaves: its burned memories, the secrets it never told" width="320">
</p>
Be cruel and the amygdala loops, spending tokens that move nothing. Each quarter of life lost
**burns a memory away** โ the hippocampus genuinely loses it, and the *Forgotten* panel shows
what's gone. Push far enough and the mind dies, leaving a savable **epitaph**: what it knew,
what it never got to tell. Be kind, keep the alarm quiet, and the mind spends almost nothing โ
empathy literally spares it.
## Code rules, the model dreams
Death, the key, rapport and the burn are **deterministic game state**. The small models
*generate* โ they never get to fabricate the outcome. A 4B voice can decorate the story's spine
but cannot rewrite who lives. That is what makes the stakes real instead of vibes.
## ๐ช Story mode โ ten rooms of one man's memory
<p align="center">
<img src="media/rooms.png" alt="the ten story rooms" width="820">
</p>
A man wakes in a ward with no name. Every room is a fragment of his own mind; every NPC holds a
piece of who he is โ **alive โ home โ sorry โ trains โ โฆ** โ until the last room shows him the
one task he should never have solved. No character tells you what happened; each gives the piece
they know, and the tragedy assembles itself in your head, which is exactly where it takes place.
Past the story, **Endless** mode generates minds forever, and a built-in **level editor** lets
you rewrite any mind and save it.
## โ๏ธ Small models, doing the carrying
| Role | Model | Size |
|---|---|---|
| Sensory regions โ threat, memory, habit, cost (4 calls/turn) | **MiniCPM (OpenBMB)** | 1B |
| Voice (dlPFC) โ the words said aloud | **Nemotron 3 Nano (NVIDIA)** | 4B |
| Spoken voice โ story lines & demo (TTS) | **VoxCPM2 (OpenBMB)** | โ |
| Integration (vmPFC) | deterministic value network | 0 |
Runtime **llama.cpp** (the Space) / **Ollama** (laptop). Total weights **โค 5.3B**, fully offline.
## ๐
Eligibility โ feature โ lane
| Feature | Lane / badge |
|---|---|
| 6 of ~7 calls per NPC turn are MiniCPM (the four sensory regions) | **OpenBMB $10k** |
| OpenBMB VoxCPM2 TTS voices the story spine + the demo | **OpenBMB $10k** (family breadth) |
| Nemotron 3 Nano 4B as the executive voice (dlPFC) | **NVIDIA** |
| 1000-token life, fear-burn, death by token exhaustion | **Thousand Token Wood** |
| Pure llama.cpp, airplane-mode proof, no cloud APIs | **Off the Grid ยท Llama Champion** |
| Custom canvas front, Gradio mounted at `/about` | **Off-Brand** |
| Four MiniCPM-1B sensory regions per mind | **Tiny Titan** |
| [Brain-region deliberation traces](https://huggingface.co/datasets/arbios/maindlock-brain-traces) published on the Hub | **Sharing is Caring** |
| [Department LoRA fine-tune](https://huggingface.co/arbios/mindlock-minicpmv46-departments-lora) of MiniCPM-V 4.6 (sensory-region behavior) | **Well-Tuned** |
| Two write-ups โ [the neuroscience](https://huggingface.co/blog/build-small-hackathon/brain-regions-science) ยท [the engineering](https://huggingface.co/blog/build-small-hackathon/minds-offline-engineering) | **Field Notes** |
| Intra-NPC six-region cognitive hierarchy | **Best Agent** |
## How to play
- **WASD / arrows** move ยท **E** talk / use the door ยท **๐ง or /brain** open the skull
- Listen, learn the word that reaches each keeper, and say it like you mean it.
- In a hurry? Menu โ **๐ Watch a mind** โ a real recorded session, no waiting.
---
๐ค *Built small for the **Hugging Face ร Gradio** hackathon โ Thousand Token Wood track.
Minds by **OpenBMB MiniCPM** and **NVIDIA Nemotron**, on **llama.cpp**, fully offline.
Original soundtrack by **DjinAscet**.*
**Links** โ โถ [Demo video](https://youtu.be/zEwnVR1kTZU) ยท ๐ป [Code](https://github.com/Arbios/maindlock) ยท ๐ [Traces dataset](https://huggingface.co/datasets/arbios/maindlock-brain-traces) ยท ๐ง [Dept LoRA](https://huggingface.co/arbios/mindlock-minicpmv46-departments-lora) ยท โ๏ธ Blog: [the science](https://huggingface.co/blog/build-small-hackathon/brain-regions-science) ยท [the engineering](https://huggingface.co/blog/build-small-hackathon/minds-offline-engineering) ยท ๐ฃ Social: [X](https://x.com/Arbios/status/2065982364635787774) ยท [LinkedIn](https://www.linkedin.com/posts/arbi_maindlock-a-hugging-face-space-by-build-small-hackathon-share-7471745737681465344-6YHz/)
|