An eight-dollar microcontroller board is now running a language model entirely on its own chip, with nothing sent to a server and no cloud account involved. The project, called esp32-ai, squeezes a 28.9-million-parameter model onto an ESP32-S3 board, and the board generates text at close to reading speed. It is a striking demonstration of how far small, cheap hardware has come, and it also shows exactly where the limits of that hardware still sit.
The trick is not a faster chip. It is a smarter way of using memory. Most of a small language model’s parameters live in its embedding tables, which the model reads from rather than computing with, so the project leaves about 25 million of those parameters in flash memory as a lookup table and keeps only a small dense core of roughly 560,000 parameters in fast RAM. Generating each token touches only about six rows of that table, or roughly 450 bytes of flash reads, so the chip never needs the whole model at once.
Before getting carried away, it helps to know what this tiny model actually does. It was trained on TinyStories, a dataset of short, simple children’s stories, and it writes short, mostly coherent stories. That is all it does. It cannot answer questions, follow instructions, write code, or hold a conversation the way a cloud chatbot can. What it proves is that local AI on a microcontroller is real, and that the engineering behind it is worth understanding before you buy a board.
Key takeaways
- The esp32-ai project runs a 28.9-million-parameter language model entirely on an ESP32-S3 board, at 9.88 tokens per second.
- Per-layer embeddings keep a dense core of 560,000 parameters in RAM and about 25 million parameters in flash as a lookup table.
- The 4-bit quantised model is 14.9 MB, fitting the board’s 16 MB of flash, with 512 KB of fast SRAM and 8 MB of slower PSRAM alongside it.
- The model was trained on TinyStories, so it writes short children’s stories and cannot answer questions or follow instructions.
- The project builds on llama2.c and an earlier 260,000-parameter ESP32 model from 2024, a jump of more than a hundred times in two years.
What the project actually built
The esp32-ai project, published by a developer going by slvDev, reached the front page of Hacker News on 25 July 2026 with a claim that sounded like a typing error: a 28.9-million-parameter language model running entirely on an ESP32-S3, a microcontroller that costs about eight dollars. The model generates text on the chip at 9.88 tokens per second, and the text appears on a small display wired to the board. Everything happens locally, with no Wi-Fi, API key, or subscription.
The hardware is an ESP32-S3 development board with 16 MB of flash, the variant the project targets being the N16R8, which pairs 16 MB of flash with 8 MB of PSRAM. The chip itself has just 512 KB of fast SRAM, the memory that matters most for speed. On paper, that is nowhere near enough for a 28.9-million-parameter model, and the project is interesting precisely because it refuses to accept that verdict. Our guide to how to create your own AI assistant covers the cloud-based route to the same goal, and comparing the two shows how different the trade-offs are when everything must fit on one small chip.
How a 28.9-million-parameter model fits on an eight-dollar chip
The first step is compression. The model’s parameters are quantised to 4 bits each, which shrinks the whole model to 14.9 MB, just small enough to fit in the board’s 16 MB of flash. Four-bit quantisation loses some precision, but for a small story-writing model the trade-off is acceptable, and without it the project would not fit at all. Fitting in flash is only half the problem, though, because flash is far too slow to stream weights through on every token.

The second step is the architectural idea borrowed from Google’s Gemma 3n: per-layer embeddings. Most of a small model’s parameters sit in embedding tables, which the model reads from rather than computing with. The project splits the model in two: a dense reasoning core of 560,000 parameters lives in fast RAM, while the other 25 million sit in flash as a memory-mapped lookup table. Generating a token touches only about six rows of it, so the chip never needs the whole model at once. Tables read rarely go in slower PSRAM, while values touched many times per token stay in fast SRAM.
This three-tier split is the real breakthrough: a memory hierarchy, not a faster processor. There is no neural processing unit on any ESP32 chip; the AI acceleration on the S3 is a set of SIMD vector instructions. The lineage shows how fast this field is moving: nearly every microcontroller language model traces back to Andrej Karpathy’s llama2.c and to Dave Bennett’s esp32-llm, which proved in 2024 that a 260,000-parameter model could run at 19 tokens per second on the same chip family. From 260,000 to 28.9 million parameters in two years is a hundredfold jump on hardware that has barely changed.
What you need to build one
The core shopping list is short: an ESP32-S3 development board with 16 MB of flash, such as the N16R8 variant the project targets, a small display, a USB-C cable for power and flashing, and a computer to build and upload the firmware. The project’s repository includes the complete firmware, training scripts, quantisation pipeline, wiring instructions, and results, so a builder follows a documented path. A display is optional, since the board can send output over a serial connection instead, and the closest comparison is a Raspberry Pi project at a fraction of the size and cost, as our explainer on what a Raspberry Pi is and what you can build with it shows.
Board choice matters more than it first appears. One builder who tried the project on an ESP32-S3 N8R8, with half the flash of the target board, found the 14.9 MB model did not fit alongside the firmware. The fix was to shrink the vocabulary from 32,768 words to 4,096, retrain a reduced version, resize the partition table for 8 MB of flash, and recompile with the matching flag. That build ran at 22.3 tokens per second, faster than stock, because the smaller output head is about six times cheaper to compute.
What it can and cannot do
What it can do is generate short stories. The TinyStories dataset consists of short, synthetic children’s stories with a constrained vocabulary, and the model writes in that style: simple sentences, familiar characters, and plots that mostly hold together. At close to ten tokens a second, text appears at a comfortable reading pace on the display.
What it cannot do is everything people usually mean by a chatbot. It will not answer questions, follow instructions, write code, or know facts about the world. Ask it a question and it will respond with a story-like continuation, because that is the only thing it was trained to do. Calling it a chatbot is a stretch; an honest description is a tiny local story generator demonstrating the techniques a real on-device chatbot would need.
The caveats that matter
The other caveat is about the build itself. The published firmware targets a specific board, and other boards may need the vocabulary-shrinking and partition-resizing work described above. The project is open source and documented, but it is a hobbyist project, not a polished consumer product, and there is no support line if a flash fails. Builders should be comfortable with a terminal, a USB cable, and reading error messages. Running a small server at home is a useful stepping stone, and our guide to setting up a home server for beginners covers the same kind of hands-on setup. The board costs about eight dollars, but a complete first build is closer to twenty or thirty dollars, with no ongoing costs because everything runs locally.
| Detail | What is known |
|---|---|
| Project | esp32-ai by slvDev, publicised 25 July 2026, open source with firmware, training scripts, and wiring instructions |
| Model | 28.9 million parameters, 4-bit quantised to 14.9 MB, trained on TinyStories |
| Speed | About 9.88 tokens per second on the stock build, roughly reading speed |
| Hardware | ESP32-S3 board, about 8 dollars, 512 KB SRAM, 8 MB PSRAM, 16 MB flash, target board N16R8 |
| Key technique | Per-layer embeddings from Google’s Gemma 3n: dense core of about 560,000 parameters in RAM, about 25 million in a flash lookup table |
| What it does | Writes short children’s stories; cannot answer questions, follow instructions, or write code |
| Privacy | Fully local, no cloud connection, no API key, nothing leaves the board |
Checklist: building a tiny local AI chatbot honestly
Use these checks before buying parts or promising what the build can do.
- Buy the board the project targets, the ESP32-S3 N16R8 with 16 MB of flash, or be ready to shrink the model yourself.
- Understand that the model writes short stories only and will not answer questions like a cloud chatbot.
- Check the project’s repository for the current firmware, wiring diagram, and partition table before ordering parts.
- Budget for a display, USB cable, and breadboard on top of the eight-dollar board.
- Keep expectations local: no internet, no updates, and no new abilities without retraining the model.
- Test the stock build first, and only then experiment with smaller vocabularies or different models.
Frequently asked questions
Can an ESP32-S3 really run a language model?
Yes, with heavy optimisation. The esp32-ai project runs a 28.9-million-parameter model on the chip by quantising it to 4 bits and keeping most of its parameters in flash as a lookup table, generating text at 9.88 tokens per second.
Is it a real chatbot?
Not in the usual sense. The model was trained on TinyStories, so it writes short children’s stories. It cannot answer questions, follow instructions, or hold a conversation like a cloud chatbot, though it demonstrates the techniques a real on-device chatbot would need.
What board do I need?
The project targets an ESP32-S3 development board with 16 MB of flash, specifically the N16R8 variant. Boards with 8 MB of flash need a reduced-vocabulary model and a resized partition table, which is a more advanced build.
How much does it cost to build?
The board itself costs about eight dollars. A complete first build with a small display, USB cable, breadboard, and jumper wires is closer to twenty or thirty dollars, with no ongoing costs because everything runs locally.
Does it need the internet?
No. The model, the firmware, and the generated text all live on the board. Nothing is sent to a server, no API key is needed, and the project works with no network connection at all.
What is per-layer embeddings?
It is a technique from Google’s Gemma 3n: most of a model’s parameters stay in slow flash as a lookup table, while only a small dense core lives in fast RAM. Each token reads only a few rows, so a large model can run on a chip with very little fast memory.
The bottom line
A 28.9-million-parameter language model running on an eight-dollar microcontroller is a genuine engineering achievement, and the memory trick behind it is more interesting than the stories the model writes. Per-layer embeddings turn a chip that should be far too small for a language model into a platform that can run one at reading speed, entirely offline, for the price of a lunch.
Buy a board if you want to learn how small models work, to teach someone about AI without a cloud account, or to build a delightful desk gadget that writes stories. Do not buy one expecting a pocket chatbot. The project is a glimpse of local AI, not the finished product, and its value is in what it teaches rather than what it answers.

