If you want to run a TensorFlow Lite model on an Arduino today, you quickly find that there is no obvious answer. There used to be one: Google’s official Arduino package, Arduino_TensorFlowLite, built from tflite-micro-arduino-examples. That package has not been updated for a long time, and I think it is worth looking at how we got here and what you can use in the meantime.
What happened to the official package
The official package was generated from the tflite-micro repository by a daily sync job. In March 2023 that job and its CI were switched off (#187, without an explanation), and the last sync dates from February 2023. In February 2025 the repository was archived, and the package has since disappeared from the Arduino Library Manager. No reason was ever given, and no successor was named. The README just points to the main tflite-micro project.
At the same time, TensorFlow Lite itself was renamed: since 2024 Google calls it LiteRT, and TFLM is documented as LiteRT for Microcontrollers. The code has kept its old names (tensorflow/tflite-micro, the tflite namespace, .tflite model files), and upstream development continues on main. Upstream does not publish releases or version tags.
So TFLM is alive and actively developed, but there is no maintained Arduino package of it.
What is out there today
The Arduino Library Manager lists about fifteen TFLM-related libraries. Most of them are snapshots of upstream taken at some point and then left alone:
- Forks of the old official package, e.g. Chirale_TensorFlowLite (mbed and ESP32, last updated 2024), Harvard_TinyMLx (for the edX course, Nano 33 BLE only) and Adafruit TensorFlow Lite (Adafruit SAMD51 boards, last updated 2023).
- ESP32 only, e.g. ESP_TF (actively maintained, with ESP-NN) and TensorFlowLite_ESP32, which is now deprecated in favor of the TFLM that ships with the ESP32 core. Espressif’s esp-tflite-micro is built into the Arduino ESP32 core, so ESP32 users are actually well served.
- Wrappers with a simplified API, e.g. EloquentTinyML, ArduTFLite, MicroTFLite and EdgeNeuron. These are convenient, but they bundle or depend on an older TFLM runtime.
Apart from Adafruit’s board-specific package, all of them are limited to ESP32 and/or Arm mbed boards, and none follows upstream automatically. If you use a Raspberry Pi Pico, an UNO R4 or one of the new Zephyr based Arduino cores, you are mostly on your own, and everyone else runs a TFLM version that gets older every month.
Why I created this library
pschatzmann/tflite-micro, currently a proof of concept, does not try to be yet another fork. It brings back the thing that made the official package useful in the first place: an automated pipeline that turns the current upstream into an Arduino library.
- Always the latest upstream. Since upstream has no versions, the library has none either. Every Saturday a GitHub Action regenerates it from tflite-micro
main. The upstream commit is recorded in the commit message. - Nothing is edited by hand.
src/is generated from upstream with the (adapted) tools of the original Arduino package. All changes are scripted as patches in a manifest, so they can be reviewed and are reapplied on every sync. - Tested before it is published. The sync compiles
hello_worldfor the UNO R4 WiFi, Raspberry Pi Pico, Pico 2 and Nano 33 BLE (Zephyr core). Only if everything builds is the result committed, so a breaking upstream change stops the sync instead of reaching you. - Any board with C++17. Current TFLM needs C++17, so the library builds on any core that compiles with
-std=gnu++17or newer, which also includes ESP32. Older cores such asarduino:mbed_nanoandarduino:samdare stuck on C++14 or older and cannot build current TFLM. - Optimized kernels on Arm. The CMSIS-NN kernels are included next to the reference kernels and are selected automatically at compile time on Cortex-M cores with DSP or MVE support (e.g. Pico 2), so you get the faster kernels without configuring anything.
Installation is a git clone into your Arduino libraries folder, and git pull gets you the latest upstream state.
Status: a proof of concept
Please take the library for what it is at this point in time: a proof of concept. It shows that an Arduino library can be generated from the current upstream automatically, kept up to date without manual work, and built for a wide range of boards. It is not yet a library you should rely on in a product:
- The automated test only checks that
hello_worldcompiles. Real models, other examples and inference results on the actual hardware have not been tested systematically. - Upstream
maincan change at any time, and so can this library. Since there are no versions, there is nothing to pin to except a git commit. - The API is the plain TFLM C++ API. There is no simplified Arduino-style wrapper.
Feedback from real projects is exactly what is needed to move it beyond this stage.
Meant to be temporary
I see this library as a stopgap, not as a replacement for an official package. The right place for an Arduino build of TFLM is upstream, maintained by the people who maintain TFLM, or by Arduino. If Google or Arduino publish a maintained package again, I will point to it here and recommend switching.
Until then, the goal is simple: give Arduino users the current TensorFlow Lite Micro on as many boards as possible, with as little manual work in between as possible. If you try it with your own model, I would like to hear how it went. If you run into a board that does not build, or a model that does not run, please open an issue on GitHub.
0 Comments