Pocket Tank is an open-source virtual fish tank that uses a small AI model to control its virtual fish. It runs on an ESP32-S3 and creates a small aquarium where fish can eat, explore, rest, follow other fish, play, and interact with each other. Each fish has different values such as hunger, energy, curiosity, stress, boredom, and trust, which can change how it behaves. The project was created by the developer behind the mediacutlet/pocket-tank GitHub repository. It is designed to show that AI can run directly on a microcontroller without using the cloud or an internet connection. The project also includes a touchscreen, fish growth, feeding, breeding, saved progress, and other virtual aquarium features.
The main part of Pocket Tank is a 14.3-million-parameter AI model that runs directly on the ESP32-S3. The model was made smaller from a much larger 26-billion-parameter model and trained with more than 51,000 example situations. When a fish needs to make a decision, the AI looks at information such as its hunger, energy, curiosity, nearby food, and other fish. It then chooses what the fish should do, such as eat, explore, rest, or follow another fish. The AI model is compressed into a 7.56 MB file and stored in the ESP32-S3's flash memory. The two processor cores of the ESP32-S3 are used for different tasks, allowing the AI and the aquarium graphics to run at the same time. The project reports around 25-30 frames per second, while each AI decision takes about 3.7 seconds.
Pocket Tank is open source and its GitHub repository includes the firmware, AI model, simulator, and tools used to train the model. However, the AI is not like ChatGPT and cannot answer general questions. It is made only to decide what the virtual fish should do and has a small set of possible actions. It also takes a few seconds to make each decision, so it does not control every movement of the fish. Regular program code takes care of fast tasks such as fish movement, physics, touch controls, and graphics, while the AI decides the fish's larger actions.