by chilly23
Run a 28.9M-parameter TinyLM on ESP32-S3 with an RP2040 OLED display node for fully local embedded AI inference.
# Add to your Claude Code skills
git clone https://github.com/chilly23/RP2040-and-ESP32-AIGuides for using ai agents skills like RP2040-and-ESP32-AI.
See how RP2040-and-ESP32-AI compares with popular alternatives.
RP2040-and-ESP32-AI is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by chilly23. Run a 28.9M-parameter TinyLM on ESP32-S3 with an RP2040 OLED display node for fully local embedded AI inference. It has 50 GitHub stars.
RP2040-and-ESP32-AI's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/chilly23/RP2040-and-ESP32-AI" and add it to your Claude Code skills directory (see the Installation section above).
RP2040-and-ESP32-AI is primarily written in Python. It is open-source under chilly23 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh RP2040-and-ESP32-AI against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
See comparison
RP2040 and ESP32 AI is a two-board embedded AI demo built around an ESP32-S3 LLM engine and an RP2040 OLED display node. The ESP32-S3 runs the actual 28.9M-parameter PLE TinyLM model, while the RP2040 acts as a lightweight serial display companion for the generated text.
This repository contains the ESP32-S3 inference firmware, model export and verification tooling, an RP2040 serial OLED display-node sketch, a workflow diagram, and demo output images.
I first tried to put the same million-parameter LLM idea directly on the RP2040. Because the RP2040 only has 264 KB SRAM and no PSRAM, that path was not practical for the real model. I used a smaller RP2040 alternative, but the output quality was not strong enough for the final LLM demo.
The final version uses the ESP32-S3 as the actual LLM engine, based on the
esp32-ai work by Viacheslav Sierbov / slvDev:
https://github.com/slvDev/esp32-ai
The RP2040 is kept as a display node. It receives generated LLM text over serial and renders it on the OLED.
img/.
+-- .gitignore
+-- data/
| +-- prepare.py
+-- experiments/
| +-- clean_confirm.sh
| +-- deploy_seed1.sh
| +-- overnight.sh
| +-- run_ablation.sh
| +-- run_ple_dim_sweep.sh
| +-- run_seed1.sh
+-- firmware/
| +-- bandwidth_bench/
| | +-- bandwidth_bench.ino
| +-- common/
| | +-- llm.h
| +-- esp32_llm/
| | +-- display.h
| | +-- esp32_llm.ino
| | +-- partitions.csv
| | +-- README.md
| +-- host_verify/
| | +-- ppl.c
| | +-- verify.c
| +-- rp2040_display_node/
| | +-- rp2040_display_node.ino
| +-- rp2040_tinylm/
| | +-- README.md
| | +-- rp2040_model.h
| | +-- rp2040_tinylm.ino
+-- img/
| +-- IMG_20260817_222228.jpg
| +-- IMG_20260817_222245.jpg
| +-- workflow-block-diagram.svg
+-- src/
| +-- analyze.py
| +-- budget.py
| +-- export.py
| +-- gen_assets.py
| +-- gen_rp2040_assets.py
| +-- model.py
| +-- quantize.py
| +-- sample.py
| +-- train.py
+-- CONTRIBUTING.md
+-- LICENSE
+-- README.md
+-- RESULTS.md
+-- pyproject.toml
+-- uv.lock
firmware/esp32_llm/esp32_llm.ino: ESP32-S3 LLM inference firmware.firmware/esp32_llm/partitions.csv: custom flash partition layout with the
model partition.firmware/common/llm.h: portable C inference runtime shared by host and ESP32.firmware/host_verify/verify.c: host-side numerical correctness check.firmware/host_verify/ppl.c: host-side perplexity check.firmware/rp2040_display_node/rp2040_display_node.ino: RP2040 UART-to-OLED
display node.firmware/rp2040_tinylm/: earlier RP2040-only TinyLM fallback experiment.src/export.py: exports the quantized model payload used by the ESP32.img/workflow-block-diagram.svg: block diagram for the final two-board system.The model is trained, exported, and quantized on a development machine, then verified against the portable C runtime before deployment. On the device side, the ESP32-S3 firmware loads the model from the custom flash partition, memory-maps it, stages the hot buffers in PSRAM, and generates text from the 28.9M-parameter PLE TinyLM. The generated text is streamed over UART/Serial to the RP2040, which receives the stream and renders it on the OLED.
Credit to Viacheslav Sierbov / slvDev for the original ESP32-S3 28.9M-parameter microcontroller LLM work:
https://github.com/slvDev/esp32-ai
TinyStories is the dataset used for training: Ronen Eldan and Yuanzhi Li, Microsoft Research, arXiv:2305.07759.
The model uses Per-Layer Embeddings, a technique from Google's Gemma 3n work, to make a larger model practical on a small chip by keeping most parameters in flash and reading only the rows needed at each token.
Andrej Karpathy's llama2.c is an important reference for training a small
language model and running inference in plain C.
This project is released under the MIT License. See LICENSE for the full terms.