--- title: SnapQuest emoji: โš”๏ธ colorFrom: yellow colorTo: gray sdk: gradio sdk_version: 5.9.1 app_file: app.py pinned: true tags: - thousand-token-wood - off-brand - tiny-titan - best-demo - best-agent - openbmb - minicpm - game - rpg - voice - photo-to-rpg - modal license: mit ---
SnapQuest

> **Build Small Hackathon 2026 โ€” Track: Thousand Token Wood ๐Ÿ„** > Upload any real photo. MiniCPM-V 4.6 reads it. Your room becomes a dungeon you can actually play. **Demo Video:** [YouTube โ†’](#) *(link added after recording)* **Social Post:** [LinkedIn โ†’](#) *(link added after posting)*
--- ## What SnapQuest Does Upload 1โ€“3 photos of any real space. Each photo becomes one room of a dungeon. The last room always spawns a **boss** โ€” an entity formed from the most prominent object the vision model detects. ``` ๐Ÿ“ธ Photo 1 โ†’ Room 1: Entry Hall ๐Ÿ“ธ Photo 2 โ†’ Room 2: Inner Chamber ๐Ÿ“ธ Photo 3 โ†’ Room 3: BOSS LAIR โ˜  ``` MiniCPM-V 4.6 (1.3B parameters) reads each image directly. It sees your specific objects. It builds a scene grounded in what it actually observes โ€” not a template. | Real Object | Becomes | |---|---| | Red chair | Throne of the Forgotten Scholar | | Black backpack | Wanderer's Cursed Pack | | Stuffed bear | **โ˜  The Bear Sentinel โ€” BOSS** | | Desk lamp | Flickering Oracle | | Curtain | Veil of Shadow | --- ## Five Classes, Five Worldviews | Class | How They See Your Room | |---|---| | โš”๏ธ Swordsman | Cover, threats, chokepoints | | ๐Ÿน Archer | Vantage points, sightlines, escape routes | | ๐Ÿ’š Healer | Vulnerability, what needs protecting | | ๐Ÿ—ก๏ธ Rogue | Shadows, hiding spots, things worth stealing | | ๐Ÿ”ฎ Mage | Arcane energy, omens, symbolic meaning | --- ## Game Loop 1. Upload 1โ€“3 photos โ†’ pick class โ†’ **Begin Quest** 2. MiniCPM-V reads each photo, builds rooms 3. Click choices or type custom actions (try "attack the chair") 4. Combat: attack enemies to clear rooms, take damage in return 5. Type **"Go deeper"** to advance to the next room 6. Final room: **BOSS FIGHT** โ€” the boss is built from your last photo's main object 7. Defeat the boss โ†’ dungeon cleared, loot collected --- ## Architecture ``` Photos (1โ€“3) โ”‚ โ–ผ vision.py โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ†’ Modal A10G GPU Base64 encode + POST to Modal endpoint MiniCPM-V 4.6 (1.3B) 3x retry with backoff Returns: scene JSON per photo โ”‚ โ–ผ dungeon.py build_rooms() โ†’ 1โ€“3 rooms with difficulty scaling generate_boss() โ†’ boss from photo's main object apply_combat() โ†’ lightweight combat resolution minimap_html() โ†’ pixel minimap display โ”‚ โ–ผ engine_photo.py HF Inference API โ†’ Qwen2.5-3B-Instruct (free, serverless) Rule-based fallback (always works if HF is slow) Multi-room state management, history window โ”‚ โ–ผ ui_photo.py + voice.py Gradio 5.x CRT interface Whisper STT + edge-tts TTS Press Start 2P pixel font en-GB-RyanNeural voice Boss banner + minimap + XP bar ``` --- ## Tech Stack | Layer | Technology | Notes | |---|---|---| | Vision | MiniCPM-V 4.6 (OpenBMB) | 1.3B params, reads real photos | | GPU | Modal A10G | On-demand, scales to zero | | DM Narration | Qwen2.5-3B-Instruct via HF Inference | Free serverless, no key needed | | DM Fallback | Rule-based generator | Always playable even if API is slow | | Voice In | OpenAI Whisper (local) | Speech โ†’ text | | Voice Out | edge-tts RyanNeural | Text โ†’ speech | | UI | Gradio 5.x + custom CSS | Press Start 2P font, CRT scanlines | | Deployment | HuggingFace Spaces | Free tier | --- ## Run Locally ```bash git clone https://github.com/ashish-doing/snapquest cd snapquest pip install -r requirements-local.txt # Pull DM model locally (optional โ€” HF Inference is used on Space) ollama pull qwen2.5vl:3b # Set Modal endpoint (get from: modal deploy modal_app.py) export SNAPQUEST_MODAL_ENDPOINT=https://ashish-kumar-doing--snapquest-minicpm-v-46-minicpmvservi-12daf4.modal.run python app.py ``` ### HF Space Secrets Required ``` SNAPQUEST_MODAL_ENDPOINT โ€” Modal GPU endpoint URL ``` --- ## Prize Tracks Targeted | Prize | Qualification | |---|---| | ๐Ÿ„ **Thousand Token Wood** ($4k) | Creative whimsical AI game โ€” photo โ†’ dungeon | | ๐Ÿ”ฌ **OpenBMB Best MiniCPM Build** ($2.5k) | MiniCPM-V 4.6 doing real multimodal vision | | ๐ŸŽจ **Off Brand Badge** ($1.5k) | Custom pixel UI, Press Start 2P font, boss banner, minimap | | ๐Ÿœ **Tiny Titan Badge** ($1.5k) | Both models โ‰ค4B: MiniCPM-V 1.3B + Qwen2.5 3B | | ๐ŸŽฌ **Best Demo Badge** ($1k) | App + video + social post | | ๐Ÿค– **Best Agent Badge** ($1k) | Multi-step: vision โ†’ room build โ†’ DM narration โ†’ combat | --- ## Author **Ashish Kumar** โ€” B.Tech ECE, IIIT Guwahati (Batch 2024) [![GitHub](https://img.shields.io/badge/GitHub-ashish--doing-181717?style=flat-square&logo=github)](https://github.com/ashish-doing) [![HuggingFace](https://img.shields.io/badge/HuggingFace-ashish--doing-FF9D00?style=flat-square&logo=huggingface)](https://huggingface.co/ashish-doing) ---
Built for **HuggingFace Build Small Hackathon 2026** *MiniCPM-V 4.6 ยท Modal ยท Qwen2.5-3B ยท Whisper ยท edge-tts ยท Gradio* **Small model. Real vision. Your room becomes the dungeon.**