# Deskfish

lively digital fish that live in an esp32-s3 on your desk

桌面鱼缸里每条鱼的行为都由板上一个小语言模型决定。

- id: mbouli-deskfish
- author: mbouli
- repository: https://github.com/mbouli/deskfish
- license: MIT
- shape: square
- scenes: home
- boards: ESP32-S3
- browser_playable: no
- preview: Project screenshots
- html: https://esp32gallery.com/projects/mbouli-deskfish/
- html_zh: https://esp32gallery.com/zh/projects/mbouli-deskfish/
- json: https://esp32gallery.com/data/catalog/projects/mbouli-deskfish.json

## Hardware

Supported hardware: ESP32-S3. Confirm the exact board revision and pin map in the upstream repository.

支持硬件：ESP32-S3。烧录前请在上游仓库核对板卡版本与引脚定义。

## English

```
Every fish in this desk aquarium asks a small transformer what to do. Once every 1.5 seconds — or immediately when food or a finger arrives — the model reads a 26-word line describing that fish's species, hunger, energy, stress and surroundings, and answers with one goal and one mood, such as seek_food eager. Nothing second-guesses the answer. The network has two layers, two heads and a 54-word vocabulary: 29,952 learned numbers stored at 8 bits, 30,522 bytes in total. A decision costs about 31 ms; caching recent answers and keeping weights in internal RAM holds the tank at 16 to 17 frames a second. Training is Python and PyTorch, distilling qwen3.5:4b over 12,000 situations. The board is a Hosyond/LCDWIKI ES3C28P with a 2.8-inch 320x240 screen, and an SDL2 simulator runs the same code on a Mac.
```

## 中文

```
桌面鱼缸里每条鱼的行为都由板上一个小语言模型决定。它每 1.5 秒看一次自己那行 26 个词的处境，回两个词：七个目标之一加六种情绪之一，比如 seek_food eager，代码照单执行不再纠正。模型是 2 层 2 头的 decoder-only transformer，词汇表 54 个词，29,952 个参数按 8 位存成 30,522 字节；一次推理约 31 毫秒，靠复用缓存和把权重放内部 RAM，水箱还能跑 16 到 17 帧。板子是 Hosyond/LCDWIKI ES3C28P（ESP32-S3、2.8 英寸 320x240），用 ESP-IDF v6.1 编，另有一份 SDL2 模拟器可以在电脑上先玩。天空按 Auburn 的真实经纬度算日月星，训练用的是 qwen3.5:4b 标注的 12,000 条处境。
```
