--- title: You Are A Bug emoji: 🐞 colorFrom: green colorTo: yellow sdk: gradio sdk_version: 6.17.3 python_version: '3.13' app_file: app.py pinned: true short_description: An entomological TTRPG powered by a small fine-tuned LLM. tags: - track:wood - sponsor:modal - achievement:offgrid - achievement:welltuned - achievement:offbrand - achievement:llama - achievement:sharing - achievement:fieldnotes --- # You Are a Bug A submission for the June 2026 Hugging Face x Gradio [Build Small Hackathon](https://build-small-hackathon-field-guide.hf.space/), **Thousand Token Wood** track. [Read my full diary post here!](https://huggingface.co/blog/build-small-hackathon/you-are-a-bug-dev-diary) The underlying model was built from [Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) with a **QLora trained on Modal.com**, made from a purpose-curated dataset of 777 player turns and JSON outputs. [See the merged GGUF model, the LoRA/adapater, and an example model trace here!](https://huggingface.co/jnalv/you-are-a-bug-qwen3-8B/tree/main) You can also export your own game's trace at the bottom of the game area :) 🎬 [Check out the demo video here!](https://www.youtube.com/watch?v=7MzfhDxs1Sc) 📱 [Social post here!](https://www.linkedin.com/feed/update/urn:li:activity:7471754081850658816/) #### Qualifying for: 🎨 Off-Brand · 🎯 Well-Tuned · 🦙 Llama Champion · 🔌 Off the Grid · 📡 Sharing is Caring · 📓 Field Notes 🛠️ Built with Modal.com 📍 Running local, no cloud APIs used ## Quotes From Friends *it did feel very epic, magic buggy... the vibe was fun and weird* - M *very fun* - A *update - i have convinced the mouse to move to san francisco as my cofounder* - Z *lol* - C ## The Inputs & Outputs I Trained For The model was trained to produce only two shapes, and decide when to use them: either a JSON response with a simple `say` that narrates something, or a `roll` that tests a `stat` (`might|speed|smarts|mystique`) with a `difficulty` (`easy|medium|hard`). What comes in as input is a simple card in a set format to provide context, with a standard shape to give structure to our inputs for fine-tuning: **Input: The player, world, previous turns, and most recent user input** ``` PLAYER Luna Moth, Level 1 — HP 4/4 · Moxie 5/5 Might 1 · Speed 1 · Smarts 6 · Mystique 2 A wise wizard type. Worldly and mysterious. THE WORLD Night, high summer. Warm dark thick with pollen. Restless and electric — the night shift coming awake. WHAT JUST HAPPENED [dm] The night is warm and buzzing. Creatures of the night start to hum and chitter as they join the forest's festivities, replacing day-timers. [player] i fly up to the tree canopy and try to find blooms to drink from [dm] A pulse of sound brushes your wings, then another, faster. Out of the warm dark a bat banks toward you, painting you with clicks. You are the loudest thing in its black sky, and it is hungry. PLAYER'S TURN [player] I fold my wings and drop like a leaf. ``` **Output: A JSON `roll` response, testing a skill** ``` { "action": "roll", "stat": "speed", "difficulty": "medium", "on_success": "You tumble out of the sound-beam, falling all wrong on purpose, and the bat's swoop slices the air where a sensible moth would have been.", "on_fail": "You drop a half-beat late. Wing membrane brushes you, claws comb your tails, and you spin earthward, listening to the bat already turning back around." } ``` For skill rolls, the LLM narrates what both the success and the failure would look like in a single response. Then the code takes the player's stat, rolls a random number against it, resolves which happens, and displays the winner! ## Big Thanks Thanks to **Gradio** and **Hugging Face** for putting together an incredibly fun hackathon, with exactly the sort of prompt that I dream about. Huge thanks to **Modal.com** for the awesome credits, which I had a blast using. Fine-tuning is fun, and I think I caught the bug, pun intended. Also a huge thanks to all the HF and Gradio **staff answering questions in the Discord**, as well as **all the other brilliant participants!** ### Background Art (Creative Commons Zero/CC0) - ["Insects and Grasses," Yamamoto Baiitsu](https://www.metmuseum.org/art/collection/search/44285) - ["Procession of Insects," Nishiyama Kan'ei](https://www.metmuseum.org/art/collection/search/670951) - ["Insects and Flowers," Ju Lian](https://www.metmuseum.org/art/collection/search/36184) - ["Garden Flowers," After Chen Chun](https://www.metmuseum.org/art/collection/search/45797) - ["Flowers and Insects," Chai Zhenyi](https://www.artic.edu/artworks/80215/flowers-and-insects) *Created by Josh Nalven / @JNalv*