--- title: Thousand Token Wood emoji: ๐Ÿ„ colorFrom: green colorTo: yellow sdk: gradio sdk_version: 6.16.0 app_file: app.py pinned: false license: mit short_description: Five small models run a market drama; you are the financier tags: - track:wood - sponsor:openbmb - sponsor:nvidia - sponsor:modal - achievement:welltuned - achievement:offbrand - achievement:sharing - achievement:fieldnotes - thousand token wood - off-brand - well-tuned - best demo - best agent - field notes - sharing is caring - minicpm - nemotron - modal --- # ๐Ÿ„ Thousand Token Wood A small-model **finance drama** for the [Build Small Hackathon](https://huggingface.co/build-small-hackathon). Five woodland creatures, each driven by a *different lab's* small model, trade goods for pebbles, gossip, scheme, and panic. You are the **Patron of the Wood**, a shadow financier: you lend, whisper tips, short the market, bribe, and broker alliances, while a magistrate watches for cheats. The chart is the scoreboard; the story is the people. ## Watch and read - ๐ŸŽฌ **Demo video**: [YouTube (100s)](https://youtu.be/ugFyFumUCgs) - ๐Ÿ“ฃ **Social post**: [on X](https://x.com/RealLesterLeong/status/2064904967391961483) - ๐Ÿ““ **Field notes** (the build, in four parts): [1 โ€” emergent market drama](https://huggingface.co/blog/build-small-hackathon/thousand-token-wood-sim) ยท [2 โ€” the five-lab council](https://huggingface.co/blog/build-small-hackathon/thousand-token-wood-sim-v2) ยท [3 โ€” the crash that vanished](https://huggingface.co/blog/build-small-hackathon/thousand-token-wood-sim-v3) ยท [4 โ€” the wood fights back](https://huggingface.co/blog/build-small-hackathon/thousand-token-wood-sim-v4) ยท [Medium mirror](https://medium.com/@LesterLeong/thousand-token-wood-emergent-market-drama-from-3-billion-parameter-agents-22545d5982bf) - ๐Ÿง  **Fine-tuned model** (one of the five minds): [AdmiralTaco/ttw-trader-0.5b](https://huggingface.co/AdmiralTaco/ttw-trader-0.5b) - ๐Ÿ“ก **Open agent traces** on the Hub: [dataset](https://huggingface.co/datasets/build-small-hackathon/thousand-token-wood-traces) ## Five labs, five minds Every creature thinks with a different small model, so the council is a live argument between four labs, all under the 32B cap and served with vLLM on **Modal**: | Creature | Model | Lab | |---|---|---| | Oona (owl) | gpt-oss-20b | OpenAI | | Bramble (squirrel) | MiniCPM3-4B | OpenBMB | | Fenn (fox) | Nemotron-Mini-4B | NVIDIA | | Mossback (tortoise) + Pip (mouse) | ttw-trader-0.5b (fine-tuned) | ours | The 0.5B was distilled from cleaned traces of a 3B teacher (self-buy mistakes stripped), so a model one-sixth the size trades *more* cleanly than its teacher: zero self-buys, 100% valid offers. gpt-oss-20b doubles as the Narrator that writes the wood's headlines. ## Why "small" is load-bearing A living economy needs *many* agents thinking *many* times per turn. Frontier models are too slow and costly for that. Small models are what make a real-time council of traders feasible, and the heterogeneity (four labs) is what makes the drama: each model has its own temperament, so the market is an emergent negotiation, not a script. ## How Modal powers the wood The entire model layer runs on **Modal**, end to end: - **Four vLLM engines, four Modal apps** โ€” one per lab's model, each on its own GPU, invoked per turn with **per-engine batching** (every creature on the same engine shares one batched call). All apps **scale to zero** when idle, so the wood costs ~nothing between sessions and the whole hackathon ran on a fraction of the starter credits. - **Fine-tuning on Modal too**: `AdmiralTaco/ttw-trader-0.5b` was LoRA-trained on a Modal A10G from cleaned traces of its 3B teacher, then merged and pushed to the Hub โ€” build, train, eval, and serve, all on one platform. - **Cold-start craft**: a warmup ping precedes recorded runs, the UI streams a "waking the wood" frame during the first cold call, and the attract reel plays instantly with zero GPU so the Space is never blank while engines wake. ## Sponsor models in the council - **OpenBMB MiniCPM3-4B** is Bramble the squirrel โ€” the council's scrappy haggler. - **NVIDIA Nemotron-Mini-4B** is Fenn the fox โ€” the opportunist who buys the dip. - **OpenAI gpt-oss-20b** is Oona the owl *and* the Wood Street Journal narrator. Each model's temperament is visible in its creature's ๐Ÿ’ญ thoughts and raw JSON (both exposed in the UI), so you can watch four labs' small models argue a market into being. ## What you can do (you are the Patron) - **Power moves**: lend pebbles at interest, whisper a tip, short a good, bribe a creature, broker an alliance, or fund a corner. Every move costs you purse, reputation, or heat, and the creatures react. - **The information war**: a tip can be *true* (real foresight of the next Wood Legend, your insider edge) or *false* (bait). Profit from an insider tip and your **heat** rises; cross the line and **Magistrate Heron** opens an investigation that ends in a fine, frozen pebbles, or exile. - **Grudges and cartels**: creatures remember how you and others treated them. Short a creature's crop and it turns hostile and refuses your loans; broker an alliance and the partners stop undercutting each other. - **The wood fights back**: burn the same creatures twice and they wise up. Wary holders stand against your next crash and blunt it, and they testify to the magistrate, so a gambit you keep repeating pays less every time and brings Heron faster. A live exposure meter shows your expected payoff collapsing as the wood sours on you. - **Leverage and ruin**: loans come due, shorts get margin-called, and a creature that cannot pay is ruined and banished (it returns a chapter later). - **Tempt Fate**: draw a *Wood Legend*, a famous market mania reskinned as woodland folklore (Tulip Mania, the South Sea Bubble, the 1929 bank runs, the 2020 toilet-paper scramble, the Hunt silver corner, the Dust Bowl), each carrying the real history under the fur. - **Read their minds**: every creature's private reasoning is shown and shared as open traces. ## How it works - `ttw/` is the engine: a deterministic double-auction market (`market.py`), the turn loop (`sim.py`), the per-creature multi-model policy (`agents.py`, `council.py`, `llm.py`), the Patron power moves (`moves.py`), relationships (`relationships.py`), the Wood Legends deck (`events.py`), the narrator and chapters (`narrator.py`, `chapters.py`), and a tolerant JSON parse-and-repair layer (`actions.py`) so no small model can break the simulation. - `serve_council.py` serves each model as its own Modal vLLM engine. - `app.py` is this Gradio app, the Wood Street Terminal console. ## Run it yourself ```bash pip install -r requirements.txt # No GPU, dummy agents (for trying the UI): TTW_DUMMY=1 python app.py # The multi-model council on Modal (deploy each engine, then enable the council): TTW_APP_NAME=ttw-serve-gptoss TTW_MODEL=openai/gpt-oss-20b TTW_CUDA_DEVEL=1 TTW_REASONING_EFFORT=low python -m modal deploy serve_council.py TTW_APP_NAME=ttw-serve-minicpm TTW_MODEL=openbmb/MiniCPM3-4B TTW_CUDA_DEVEL=1 TTW_TRUST_REMOTE=1 python -m modal deploy serve_council.py TTW_APP_NAME=ttw-serve-nemotron TTW_MODEL=nvidia/Nemotron-Mini-4B-Instruct TTW_CUDA_DEVEL=1 python -m modal deploy serve_council.py TTW_APP_NAME=ttw-serve-qwen TTW_MODEL=AdmiralTaco/ttw-trader-0.5b TTW_CUDA_DEVEL=1 python -m modal deploy serve_council.py TTW_COUNCIL=1 TTW_NARRATOR=1 python app.py ``` Built for the Build Small Hackathon, 2026. Small models, big adventures.