File size: 1,629 Bytes
1ef2df5
 
199beca
 
1ef2df5
 
199beca
 
 
 
 
 
 
 
1ef2df5
 
199beca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Tiny Model Dungeon
emoji: ⚔️
colorFrom: indigo
colorTo: blue
sdk: static
app_file: index.html
pinned: true
tags:
- game
- webgpu
- on-device
- mobile-ai
- text-adventure
---

# ⚔️ Tiny Model Dungeon

An AI-powered text adventure game where the **entire AI runs in your browser** — no server, no cloud, no API costs.

## The pitch

> *This whole game's AI fits in 200MB.*

The dungeon master is a **360M parameter model** (SmolLM2-360M-Instruct) running entirely on your device via WebGPU. Every room description, monster encounter, and treasure find is generated in real-time by a model smaller than a single photo album.

## How it works

1. On page load, the model (~200MB ONNX) downloads once and is cached by your browser
2. WebGPU accelerates inference on your GPU (falls back to WASM on older browsers)
3. Every player action generates a unique AI narration — no scripted responses
4. The game never contacts a server after the initial model download

## Why?

This is dispatchAI's thesis made tangible: **small models are powerful enough for real applications.** A 360M model generating creative dungeon descriptions proves that mobile-sized AI is not a toy — it's a product.

## Tech

- **Model**: [SmolLM2-360M-Instruct](https://huggingface.co/dispatchAI/SmolLM2-360M-Instruct-mobile)
- **Inference**: [transformers.js](https://github.com/xenova/transformers.js) v3.7.0
- **Backend**: WebGPU (with WASM fallback)
- **Hosting**: Static HuggingFace Space (free forever)
- **Cost**: $0

---

*Built by [dispatchAI](https://huggingface.co/dispatchAI) — mobile AI that moves at the speed of need.*