File size: 8,678 Bytes
022e9e3
b5ad3e5
8c6c5d9
b5ad3e5
a6856e0
022e9e3
a6856e0
022e9e3
8c6c5d9
b5ad3e5
 
 
8c6c5d9
 
 
 
 
 
 
2edc9ba
 
b5ad3e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9304be9
 
 
 
 
 
b5ad3e5
 
 
 
8d80a89
e608212
8d80a89
b5ad3e5
022e9e3
 
faf2dff
c1eb573
b5ad3e5
98cbf67
c1ef0f3
98cbf67
faf2dff
4f409b9
faf2dff
4f409b9
faf2dff
 
 
4f409b9
faf2dff
 
 
 
 
 
4f409b9
faf2dff
98cbf67
faf2dff
 
 
 
 
 
 
98cbf67
faf2dff
4713899
b5ad3e5
faf2dff
 
 
 
 
 
 
4713899
faf2dff
9fa751e
faf2dff
9fa751e
8c6c5d9
0450be4
 
8d80a89
 
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
---
title: Myco - Tiny AI Mushroom Companion
emoji: ๐Ÿ„
colorFrom: red
colorTo: green
sdk: gradio
sdk_version: 6.16.0
app_file: app.py
pinned: false
license: mit
short_description: Build Small Hackathon
tags:
  - thousand-token-wood
  - track:wood
  - sponsor:openai
  - achievement:offgrid
  - achievement:offbrand
  - achievement:sharing
  - achievement:fieldnotes
datasets:
  - build-small-hackathon/Myco
---

# โ‹ Thousand Token Wood Submission
*The Whimsical Track: Whimsical, delightful, AI-native apps that push the boundaries of fun. Wander somewhere stranger and show off what small models can dream up.*

---

## ๐ŸŽ–๏ธ Achieved Merit Badges
*Stack 'em on your sash! Hover a patch to see it lift.*

<div style="display: flex; flex-wrap: wrap; gap: 15px; margin: 20px 0;">

  <div style="flex: 1; min-width: 200px; padding: 15px; border: 1px solid #e5e7eb; border-radius: 12px; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; background: #fff;" onmouseover="this.style.transform='translateY(-5px)'; this.style.boxShadow='0 10px 15px -3px rgba(0,0,0,0.1)'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none'">
    <div style="font-size: 24px; margin-bottom: 5px;">๐Ÿœ</div>
    <strong>Tiny Titan</strong>
    <p style="font-size: 12px; color: #6b7280; margin: 5px 0 0 0;"><strong>Genuinely tiny:</strong> Myco's brain is <code>google/gemma-3-1b-it</code> โ€” a 1B-parameter open-weight model, well under the 4B bar.</p>
  </div>

  <div style="flex: 1; min-width: 200px; padding: 15px; border: 1px solid #e5e7eb; border-radius: 12px; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; background: #fff;" onmouseover="this.style.transform='translateY(-5px)'; this.style.boxShadow='0 10px 15px -3px rgba(0,0,0,0.1)'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none'">
    <div style="font-size: 24px; margin-bottom: 5px;">๐ŸŽฏ</div>
    <strong>Off the Grid</strong>
    <p style="font-size: 12px; color: #6b7280; margin: 5px 0 0 0;"><strong>Local-first:</strong> No cloud APIs. <code>google/gemma-3-1b-it</code> loads via <code>transformers</code> and runs entirely local on the host environment.</p>
  </div>

  <div style="flex: 1; min-width: 200px; padding: 15px; border: 1px solid #e5e7eb; border-radius: 12px; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; background: #fff;" onmouseover="this.style.transform='translateY(-5px)'; this.style.boxShadow='0 10px 15px -3px rgba(0,0,0,0.1)'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none'">
    <div style="font-size: 24px; margin-bottom: 5px;">๐ŸŽจ</div>
    <strong>Off-Brand</strong>
    <p style="font-size: 12px; color: #6b7280; margin: 5px 0 0 0;"><strong>Custom UI:</strong> A hand-built forest scene, status panels, and live AI log โ€” well past default Gradio styling.</p>
  </div>

  <div style="flex: 1; min-width: 200px; padding: 15px; border: 1px solid #e5e7eb; border-radius: 12px; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; background: #fff;" onmouseover="this.style.transform='translateY(-5px)'; this.style.boxShadow='0 10px 15px -3px rgba(0,0,0,0.1)'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none'">
    <div style="font-size: 24px; margin-bottom: 5px;">๐Ÿง </div>
    <strong>Codex Co-Author</strong>
    <p style="font-size: 12px; color: #6b7280; margin: 5px 0 0 0;"><strong>Best Use of Codex:</strong> Developed and structured using Codex for workspace orchestration and environment testing.</p>
  </div>

  <div style="flex: 1; min-width: 200px; padding: 15px; border: 1px solid #e5e7eb; border-radius: 12px; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; background: #fff;" onmouseover="this.style.transform='translateY(-5px)'; this.style.boxShadow='0 10px 15px -3px rgba(0,0,0,0.1)'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none'">
    <div style="font-size: 24px; margin-bottom: 5px;">๐Ÿ“ก</div>
    <strong>Sharing is Caring</strong>
    <p style="font-size: 12px; color: #6b7280; margin: 5px 0 0 0;"><strong>Open trace:</strong> Shared comprehensive agent execution traces on the Hub for open community learning.</p>
  </div>

</div>

---

## ๐ŸŒ Community Links
* **๐Ÿ“บ Video Walkthrough:** [Watch the Myco Demo on YouTube](https://youtu.be/uTlIWqJA9RQ)
* **๐Ÿ”— Read the LinkedIn post:** [Read the full project post on LinkedIn](https://www.linkedin.com/posts/noriko-kono_huggingface-gradio-gemma3-share-7472374564023427072-C64t/?utm_source=share&utm_medium=member_desktop&rcm=ACoAADV81lIBHfqnWPcrqTwi8q3nrm4-wpvkldE)

---

# ๐Ÿ„ Myco โ€” Tiny AI Mushroom Companion

Myco is a small Gradio AI Companion built for Hugging Face's **Build Small Hackathon**, entering **Chapter Two โ€” "An Adventure in Thousand Token Wood."** Wander a glowing forest with Myco, a tiny sentient mushroom companion. Discover strange mushrooms, chat with Myco about them, study and collect them, and watch Myco's live thoughts stream across the screen in real time as a small on-device AI model reacts to everything that happens.

**Live Space:** https://huggingface.co/spaces/build-small-hackathon/Myco

## Hackathon direction

This project targets Chapter Two of the Build Small Hackathon: *"Build something delightful that wouldn't exist without AI. Wander somewhere weirder... Strange is good. Joyful is the bar."* Myco optimizes for one polished, memorable mechanic rather than a long feature list โ€” a whimsical AI companion whose narration, in-game reactions, and chat replies are all generated live and visibly, the entire time you play.

Design decisions prioritize:
- **Delight:** a 10-second hook that makes the player smile.
- **AI as the experience:** every reaction โ€” narrative, in-game action, and chat โ€” is generated live by Myco's model and streamed to a visible live log, so the AI is never hidden behind the scenes.
- **Originality:** keep the mushroom-companion game strange, cozy, and memorable.
- **Polish:** a smooth Gradio Space with clear onboarding, responsive UI, and a strong visual identity.
- **Small scope:** one unforgettable loop over many unfinished mechanics.

Bonus quests this project aims for:
- ๐Ÿœ **Tiny Titan** โ€” Myco runs on `google/gemma-3-1b-it`, a genuinely tiny (1B-parameter) model.
- ๐Ÿ”Œ **Off the Grid** โ€” the model runs locally via `transformers`, with no cloud inference API calls.

## First play loop

1. Open the **Play** tab and click **๐ŸŽฎ Search Clearing** โ€” mushrooms sprout across the forest grid.
2. Move Myco with the arrow buttons, or let Myco roam the clearing on its own every few seconds.
3. Walk Myco onto a mushroom to collect it automatically, or use **๐Ÿ” Study**, **๐Ÿงบ Collect**, **๐Ÿ„ Pick**, or **๐ŸŒŒ Follow Whisper** on the current discovery.
4. **๐Ÿฝ๏ธ Eat?** is always refused โ€” Myco panics (in character) and tells you to study an unidentified mushroom before trying anything like that.
5. Watch the live log at the bottom of the page โ€” it streams Myco's narration, in-game reactions, and chat replies as the model generates them, tagged `[NARRATIVE]`, `[ACTION]`, and `[CHAT]`.
6. Build your **MycoDex**, unlock new areas on the **Map**, check the **Guide** for the full rundown, and visit the **๐Ÿ„ Myco** tab for the Magic Mushroom Garden.
7. Step on (or pick) a poisonous mushroom and it's Game Over โ€” the scene fades to red until you search a new clearing.

## What's included

- Gradio app entrypoint: `app.py`
- Game engine + AI: `game/engine.py`
- Mushroom catalog & progression state: `game/`
- Mushroom data model: `models/`
- Mushroom catalog data: `data/mushrooms.json`
- UI rendering: `ui/renderers.py` (forest scene, status panels, MycoDex, world map)
- Magic Mushroom Garden tab: `ui/interface.py`
- Runtime dependencies: `requirements.txt`

## Myco's AI companion

Myco's mind is **`google/gemma-3-1b-it`** (Gemma 3 1B Instruct), loaded **locally** via `transformers` โ€” there are no Hugging Face Inference API calls. The model runs on GPU if one is available, otherwise CPU.

Every successful generation (narrative, in-game action, or chat) is also appended to a running, tagged log that streams to the live log panel via a polling timer, so you can watch Myco "think" as it happens.


## ๐Ÿค– AI-Assisted Development & Codex Attribution
This repository was developed using **OpenAI Codex** and other assistant AI agents to co-author core Python scripts, streamline state routing, and manage structured code execution. Full logs and interactive context are structurally documented in our `CODEx_USAGE.md` file.