Raspberry Pi AI Hat Model Trainer

Pi Trainer: an open-source workbench for Raspberry Pi AI HAT models

Hi everyone,

I’ve been building Pi Trainer, an MIT-licensed workbench to help manage the steps between collecting training data and running a model on a Raspberry Pi AI HAT.

The idea is to train on a Mac, Windows PC or Linux machine, then compile for the appropriate Hailo accelerator, package the model and scripts, and test on the Pi. Training stays off the Raspberry Pi.

GitHub: GitHub - ShaunPrice/raspberry-pi-ai-trainer: Cross-platform training, optimisation and deployment workbench for Raspberry Pi Hailo-8L, Hailo-8 and Hailo-10H accelerators. · GitHub

Application interfaces

Web workbench: the project and dataset view above.

Native desktop: the same workbench is also available as a desktop application.

Training workflow: select a provider, review the settings and submit a background job.

The CLI supports repeatable commands, while MCP exposes the workbench to a connected assistant over stdio.

Actual CLI help output:


$ python3.11 -m pi_trainer --data-dir /private/tmp/pi-trainer-demo/store --help
usage: main.py [-h] [--data-dir DATA_DIR]
{capabilities,projects,jobs,mcp,desktop,web,create,import,plan,bundle,datasets,llm-recipe,score,estimate,workflow-jobs,doctor,job,logs,cancel,run,invoke}
...

Pi Trainer command line.

positional arguments:
{capabilities,projects,jobs,mcp,desktop,web,create,import,plan,bundle,datasets,llm-recipe,score,estimate,workflow-jobs,doctor,job,logs,cancel,run,invoke}

options:
-h, --help            show this help message and exit
--data-dir DATA_DIR

What it does

- Provides a native desktop application, web interface, CLI and MCP interface that share projects and jobs.

- Imports datasets, records snapshots and hashes, and supports versioned labels and source groups.

- Runs image-classification training with PyTorch, exporting ONNX and calibration data.

- Compares a bounded set of training configurations to help balance model quality and resource use.

- Connects to a compatible Hailo SDK environment for target-specific compilation.

- Packages models and scripts with checksums and target/runtime metadata.

- Supports SSH deployment and bounded Pi tests, with release selection and rollback controls.

- Adds a model bundle and scripts to a copy of an existing Raspberry Pi OS image. It does not build a new distribution or resize partitions.

The compiler needs a compatible Linux x86-64 Hailo SDK. Training frameworks, vendor SDKs and Pi runtimes are separate dependencies.

*The screenshot shows image-workflow preparation, with completed training and packaging jobs below it.*

Hardware and testing

Tested on Raspberry Pi 5 (8GB) with:

- Raspberry Pi AI HAT+ 13 TOPS — Hailo-8L

- Raspberry Pi AI HAT+ 26 TOPS — Hailo-8

Synthetic vision compilation and SDK numerical emulation have also passed for Hailo-10H. I don’t have the 10H board yet, so its physical testing remains pending. These fixture tests establish pipeline operation, not real-world model accuracy. The full deployment-helper activation and rollback sequence also needs separate hardware qualification.

What about LLMs?

There is a Hailo-10H workflow for host-side LoRA fine-tuning and preparation. Deployment requires a supported Hailo base model, matching pre-optimised archive and a qualified compiler recipe. It is not an arbitrary Hugging Face or GGUF-to-HEF converter. Hailo-8L and Hailo-8 are vision targets in this workbench.

*LLM configuration screen; this screenshot does not show a completed Hailo-10H deployment.*

Guide and walkthrough

I’ve put together a 19-page illustrated guide*and a 7-minute narrated walkthrough showing actual project creation, data import, training and packaging. The compilation, image, device and LLM sections explain preparation and requirements.

Watch the Pi Trainer walkthrough on YouTube

pi-trainer-youtube-thumbnail

Watch on YouTube: https://youtu.be/O7UQfUIOpUI

- Read the illustrated PDF guide: https://github.com/ShaunPrice/raspberry-pi-ai-trainer/releases/download/tutorial-v1/Pi-Trainer-User-Guide.pdf

- Source code and setup instructions: GitHub - ShaunPrice/raspberry-pi-ai-trainer: Cross-platform training, optimisation and deployment workbench for Raspberry Pi Hailo-8L, Hailo-8 and Hailo-10H accelerators. · GitHub

This is an early workbench, and I’d welcome feedback from anyone using the Raspberry Pi AI HAT range. Which part of your model workflow is the most awkward: dataset preparation, compilation, packaging or testing on the Pi? If you try it, please share your board, runtime version and what worked or failed.

*Application images are actual captures. Header and thumbnail are AI-assisted promotional artwork based on an [official Raspberry Pi product photograph](https://www.raspberrypi.com/products/ai-hat/), credited to Raspberry Pi Ltd; they are illustrative hardware images, not photographs of the test devices. No affiliation or endorsement is implied.*

2 Likes