CoolFace
Apppublic

Zhenzewu/tokenwood

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes
App README

๐Ÿ„ Tokenwood โ€” a very small wood that thinks

Five tiny creatures. One tiny model. Drop a button, start a saga.

Tokenwood is a pocket terrarium-world: an anxious hedgehog economist, a haiku-only snail poet, a sensationalist owl journalist, a washed-up opera frog and a magpie entrepreneur live little autonomous lives. Each one is an agent running on a single fine-tuned Qwen3-1.7B through llama.cpp โ€” on this Space's own CPU. No cloud APIs. No GPUs. No adult supervision.

You are the Wanderer. Leave a shiny button at the Old Oak. Tell the magpie a secret about the moon. Make it snow. Then let time pass โ€” and read what the wood believes happened in tonight's edition of The Thousand Token Tribune, Tokenwood's only (and therefore finest) newspaper.

๐ŸŽฌ Demo video: link added at submission ๐Ÿ“ฃ Social post: link added at submission ๐Ÿ““ Field notes (blog): link added at submission ๐Ÿง  Fine-tuned model: link added at publish ๐Ÿ“ก Agent traces dataset: link added at publish

Why this belongs in Thousand Token Wood

The app literally is a thousand-token wood. Every thought a creature thinks, every line it speaks, every overblown headline is generated under a strict token budget โ€” and the wood counts them honestly in the corner of your screen. Remove the model and nothing remains: the AI isn't a feature, it's the climate.

How it works

Browser (hand-drawn SVG world, custom frontend) โ”€โ”€ @gradio/client
        โ”‚ streamed events (thoughts, speech, moves, headlines)
gr.Server (FastAPI + Gradio queue)
        โ”‚
World engine (Python): places ยท items ยท weather ยท clock ยท consequences
        โ”‚ observe โ†’ think โ†’ act (ONE tool per turn)
llama-server (llama.cpp, pinned build) โ€” fine-tuned Qwen3-1.7B Q4_K_M
        โ””โ”€ per-creature KV slots + grammar-constrained JSON tool calls
  • โ€”Agents, honestly small. Each creature turn is one grammar-constrained generation: {think, tool, to, arg}. llama.cpp compiles a JSON schema to a GBNF grammar, so a 1.7B model files tidy paperwork every single time โ€” no retries, no parsing surgery.
  • โ€”Fast enough to feel alive on 2 vCPUs. Static persona cards live in per-creature KV-cache slots; only the fresh world-slice is re-processed each turn. Median turn โ‰ˆ a few seconds, streamed to the UI as it happens.
  • โ€”Emergence, not scripts. The newspaper is generated from the day's real event log. The misquotes are the model's own journalistic instincts.

Bonus quests claimed

BadgeEvidence
๐Ÿ”Œ Off the GridAll inference is in-Space llama.cpp on CPU; zero external AI APIs
๐ŸŽฏ Well-TunedRuns a published fine-tune (in-voice agent SFT) โ€” link above
๐ŸŽจ Off-Brand100% custom frontend over gr.Server (SVG forest, zero default Gradio UI)
๐Ÿฆ™ Llama Championllama.cpp llama-server, pinned release, grammar-constrained decoding
๐Ÿ“ก Sharing is CaringFull agent traces (messages โ†’ decision โ†’ applied effects) published as a dataset; in-app ๐Ÿ“ก button exports your own session
๐Ÿ““ Field NotesBlog post on building a living world on a 1.7B CPU budget โ€” link above

Credits

Built for the Build Small Hackathon 2026 (Gradio ร— Hugging Face). Base model: Qwen3-1.7B (Apache-2.0). Runtime: llama.cpp. Fine-tuned with Modal GPU credits (see field notes for the training recipe). Every creature opinion is its own; the Tribune regrets nothing.