whatisgithub

What is cardputer-ai?

therezor/cardputer-ai — explained in plain English

Analysis updated 2026-05-18

22C++Audience · developerComplexity · 4/5Setup · moderate

In one sentence

Firmware that runs a tiny offline AI chatbot directly on the M5Stack Cardputer handheld device, with no internet or server required.

Mindmap

mindmap
  root((repo))
    What it does
      Offline AI chatbot
      Runs on ESP32-S3
      No network needed
    Tech stack
      C++
      ESP32-S3
      PlatformIO ESP-IDF
    Model details
      3 million parameters
      Q4_0 compression
      Pruned vocabulary
    Modes
      Chat mode
      Story mode
      Raw mode
    Retraining
      Python tools
      Fine-tune on Mac

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Flash a fully offline AI chatbot onto an M5Stack Cardputer.

USE CASE 2

Generate short stories on a handheld device using Story mode.

USE CASE 3

Retrain and compress your own tiny language model for the Cardputer.

What is it built with?

C++ESP32-S3PlatformIOESP-IDFPython

How does it compare?

therezor/cardputer-aizunhaisu/oscar-kv-quantakshayanirmal2005-cmyk/smart-health-track
Stars222223
LanguageC++C++C++
Setup difficultymoderatehardmoderate
Complexity4/55/53/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires M5Stack Cardputer hardware and PlatformIO or ESP-IDF to flash the firmware.

So what is it?

Cardputer AI puts a small AI chatbot directly onto a tiny handheld device called the M5Stack Cardputer, which runs on an ESP32-S3 microcontroller. The entire language model lives inside the firmware that gets flashed to the device, so the chatbot works completely offline with no internet connection, no Wi-Fi, no SD card, and no external server calls. Once the firmware is installed, the device is a standalone chatbot. The AI model used is a 3-million-parameter language model trained on simple English stories and conversations. It generates about 7 words per second on the hardware. Because the microcontroller has very little memory (around 280 kilobytes of usable working memory), the project uses a heavily compressed version of the model weights stored in a format called Q4_0, which reduces each number to 4 bits. The vocabulary was also pruned from about 50,000 possible word pieces down to roughly 12,000 to reduce memory further. All of this fits into a firmware file just under 2 megabytes. The device runs in three modes. Chat mode is the default: you type something, the device replies, and it remembers the last few exchanges. Story mode takes a short description and writes a brief story based on it. Raw mode passes your input directly to the model without any formatting, which is useful for testing. The README is honest about the model's limits: it speaks only simple English, has no real-world knowledge, and can only hold about 80 tokens (roughly three short exchanges) in memory at once. The firmware works on two versions of the Cardputer hardware. It detects which one it is running on at startup and loads the correct keyboard driver automatically, so the same firmware file covers both. For people who want to retrain the chat model from scratch, the repository includes Python tools to download the base model, prepare training data from a public dialogue dataset, run the fine-tuning, and then convert the result into the C++ source files the firmware needs. The fine-tuning takes about 30 minutes on an Apple Silicon Mac. Building and flashing the firmware uses either PlatformIO or the standard ESP-IDF toolchain.

Copy-paste prompts

Prompt 1
Help me build and flash the Cardputer AI firmware using PlatformIO.
Prompt 2
Explain how the model was compressed to fit in 280 kilobytes of memory.
Prompt 3
Show me how to retrain the chat model with my own dialogue dataset.
Prompt 4
What is the difference between Chat mode, Story mode, and Raw mode?

Frequently asked questions

What is cardputer-ai?

Firmware that runs a tiny offline AI chatbot directly on the M5Stack Cardputer handheld device, with no internet or server required.

What language is cardputer-ai written in?

Mainly C++. The stack also includes C++, ESP32-S3, PlatformIO.

How hard is cardputer-ai to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is cardputer-ai for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.