August 31, 2026
In July 2026 a 28.9-million-parameter LLM ran fully on-device on an $8 ESP32-S3 at almost 10 tokens per second. Here's how the trick works, who built

Running a large language model on a microcontroller hinges on shrinking the model without destroying its linguistic capabilities. The most common approach is post‑training quantization, where floating‑point weights are mapped to lower‑bit integers such as 8‑bit or even 4‑bit values. This reduces memory footprint and enables integer‑only arithmetic, which the ESP32‑S3 can execute efficiently. Weight pruning removes connections that contribute little to output, further trimming size. Knowledge distillation creates a smaller student network that mimics the behavior of a larger teacher, often achieving comparable performance with a fraction of the parameters. These techniques together can bring a model with tens of millions of parameters down to a few megabytes, a size that fits within the limited RAM of a low‑cost board.
The ESP32‑S3 offers roughly half a megabyte of SRAM and several megabytes of flash, with a clock speed around 240 MHz and a vector processing unit that supports SIMD instructions. Because the device lacks a floating‑point unit, developers must rely on fixed‑point arithmetic or specialized libraries that generate integer kernels. Memory‑aware memory pools and careful placement of intermediate tensors prevent out‑of‑memory crashes. Compiler flags that enable aggressive loop unrolling and vectorization, combined with DMA‑driven data movement, keep the CPU busy while minimizing stalls. In practice, these optimizations allow the inference engine to process a token quickly, providing a modest throughput that is sufficient for interactive applications with modest latency requirements.
Quantize weights to 8‑bit or lower to cut memory and enable integer math.
Prune low‑impact connections to reduce model size.
Use SIMD‑friendly libraries such as CMSIS‑NN or TinyML.
Allocate buffers in RAM carefully to avoid fragmentation.
Leverage flash storage for model weights and stream data from external flash when needed.
Deploying an LLM on a microcontroller expands the reach of AI to devices that cannot rely on cloud connectivity, preserving privacy and eliminating network latency. It also opens the door to low‑power applications, such as voice assistants, on‑device code completion, or real‑time translation in remote environments. However, the trade‑off is a constrained vocabulary size, limited context length, and a need to accept lower perplexity compared to server‑grade models. Training remains impractical on such hardware, so the ecosystem depends on pre‑trained models that have been heavily compressed. When the goal is to provide a useful, responsive experience within strict power and cost budgets, the combination of aggressive compression and hardware‑aware coding proves effective.
As edge AI continues to mature, the ability to run language models on inexpensive microcontrollers illustrates a shift toward decentralized intelligence. Engineers are increasingly using hybrid approaches that combine tiny models with cloud‑backed services, allowing devices to offload heavy computation when needed while still delivering fast, private responses locally. This balance of on‑device efficiency and optional cloud assistance is likely to shape the next generation of IoT applications, making sophisticated language understanding accessible beyond traditional servers.
A journey from WAP, Symbian and Windows Mobile to Android, SaaS and AI — and the lessons I learned along the way.
Aug 31, 2026