MilikMilik

How a 28.9M-Parameter LLM Landed on an ESP32 Without the Cloud

How a 28.9M-Parameter LLM Landed on an ESP32 Without the Cloud
Interest|Open-Source Hardware

A language model on a sandwich-priced chip

Running a large language model on a microcontroller means executing a fully self-contained neural network that generates tokens locally, with no cloud connection, within the severe memory, compute, and power limits of low-cost edge AI hardware. That is exactly what developer slvDev_ has done on an ESP32-S3: ESP32-AI fits a 28.9M-parameter LLM on an ESP32-S3 that can tell coherent stories, and it runs entirely on-chip at about 9 tokens per second. The chip in question costs less than a sandwich, which is why this project quietly rewrites expectations about what offline language models can do for embedded machine learning. This is not frontier AI shrunk down; it is a proof that the bottom end of on-device intelligence for IoT has shifted, and the cloud-first assumption is no longer a given.

How a 28.9M-Parameter LLM Landed on an ESP32 Without the Cloud

The trick: per-layer embeddings instead of brute force

The key insight is that most parameters in a language model sit in embedding tables, not in the dense compute core. ESP32-AI uses a Gemma-style technique called Per-Layer Embeddings, where roughly 25 million parameters live in a lookup table stored in flash as memory-mapped XIP, and only a small subset is read per token. As the developer explains, the firmware keeps the 25M-row table in flash and reads about six rows per token—around 450 bytes—while only a ~560K dense core needs fast RAM. In total, roughly 559,000 parameters form the dense core, about 3.1 million sit in the input embedding and output head, and about 25 million live in the Per-Layer Embeddings table. In quotable terms: "A 28.9-million-parameter count sounds as if someone stuffed a chatbot into a microcontroller. They didn't". They re-architected the memory layout instead.

What actually runs on the ESP32-S3

Strip away the hype and you get a measured story about ESP32 AI inference. The deployed model has six layers, a hidden size of 96, four attention heads and a 32,768-token vocabulary. Its exported file weighs in at 14,912,332 bytes, which fits only on ESP32-S3 boards with 16MB of flash and 8MB of OPI PSRAM, such as specific DevKitC-1 variants. This is the kind of boring hardware detail that decides whether a demo becomes a product or a weekend frustration. Functionally, ESP32-AI is trained around TinyStories-style text generation. It can tell a story and keep track of variables on-device, but it is not a general assistant, and it will not reason over live sensor streams out of the box. Calling it “ChatGPT on a microcontroller” is marketing spin; calling it a new floor for LLM on microcontroller deployments is accurate.

Why offline edge AI on microcontrollers matters

Cloud-dependent AI has always had an awkward fit with cheap connected devices: every useful query needs connectivity, an API call, a bill and permission to send data away from the device. Offline inference changes the conversation, but only if you keep the task small. A model like this can already support useful embedded machine learning work: classification, command parsing, short structured responses and local text generation where the task is narrow enough to fit the silicon. You may get enough local intelligence to filter events, parse a constrained command or decide when a larger system needs to wake up. That directly cuts latency and reduces privacy concerns, because sensor data does not leave the device for every decision. Most edge AI talk still gravitates toward NPUs and higher-cost boards, but ESP32-AI pushes the floor lower, redefining what offline language models can mean in IoT microcontroller deployments.

From proof of concept to everyday edge AI

This project lands in a market already leaning toward smarter endpoints. Fact.MR estimates the IoT microcontroller market at $8.4 billion in 2026 and $31.7 billion by 2036, with a 14.2% compound annual growth rate, while another forecast puts the edge AI market at $118.69 billion by 2033, growing at 21.7% from 2026. Those numbers do not prove that every sensor needs a language model, but they show why cheaper local inference keeps attracting attention. ESP32-AI demonstrates that a microcontroller can carry more model-shaped behavior than many hardware teams assumed. The harder work is ahead: someone has to train these models for real device tasks, test latency under actual workloads, measure power draw, and make the build process less fragile than cloning a repo and flashing a specific board. Until then, ESP32-AI is a strong proof of concept, not a finished product strategy—but it has already broken the idea that edge AI must live in the cloud.

Milik earns a commission when you shop through our links, at no extra cost to you. This article was generated with AI from published sources and product data.

Related Products

You May Also Like

Comments
Say something...
No comments yet. Be the first to share your thoughts!