open source · v0.4

P4N4 — Portable Agentic Nodes Architecture

IoT +
GenAI
EdgeAI

From sensor data to answers, on your own hardware.

A CLI that sets up a self-hosted IoT and AI stack with Docker Compose, from a Raspberry Pi to a GPU server.

Four layers.
One network.

IoT, AI, extras and a control plane on one Docker network. The IoT layer is the MING stack, covered below. The AI layer runs local LLMs and edge models beside it.

Mosquitto :1883
Node-RED :1880
InfluxDB :8086
Grafana :3000
Telegraf optional
⟷
Ollama :11434
System 1 no port · optional
ei-runner · .eim / .onnx :8080 · optional
Letta :8283 · optional
n8n :5678 · optional
⟷
Your own services opt-in
go2rtc video in a template
REST API · JWT auth :8000
p4n4-lib shared with CLI
⟷
Web UI + proxy :8088
Android · iOS · desktop Flutter
Visual Flows
Node-RED connects sensors, the database and AI in a browser editor.
node-red
Agents with Memory
Letta agents keep a history of past faults and conversations.
letta
ML on Live Data
An Edge Impulse or ONNX model scores each reading that arrives over MQTT.
edge impulse / onnx
Fully Self-Hosted
Nothing calls the cloud. Runs offline once images and models are downloaded.
on-premise
Pick What Runs
Choose layers with --layer. Only those start.
docker compose
Use Your Broker
Pull topics from an MQTT broker you already run.
mqtt bridge

P4N4 runs the agents.
MING handles the IoT.

Four common open source services. p4n4 sets them up and connects them for you.

M
Mosquitto
MQTT Broker
Passes messages between devices over MQTT, a light publish/subscribe protocol.
I
InfluxDB
Time-Series Database
Stores each sensor reading with its timestamp.
N
Node-RED
Flow Editor
Connects services with flows you draw in the browser.
G
Grafana
Dashboards & Alerts
Charts your data and sends alerts when values cross a limit.

Start from a working project.

Six example projects in p4n4-templates, each built around a real use case.

mqtt-influx-grafana
IoT
Collect sensor data and chart it. Start here.
mqtt-nodered-influx-grafana
IoT
Greenhouse control with rules in Node-RED.
mqtt-influx-grafana-ollama
IoTGenAI
Ask a local LLM questions about your sensor data.
mqtt-influx-grafana-n8n
IoTGenAI
Cold-chain alerts and daily reports from n8n workflows.
mqtt-influx-grafana-ollama-letta
IoTGenAI
A maintenance assistant that remembers past faults.
mqtt-influx-grafana-ollama-go2rtc
IoTGenAIEdge
Count traffic in camera streams with an edge model.

Work in progress. Each template's README explains how to run it.

Browse templates

A small model flags it.
An LLM explains it.

Milliseconds to flag, seconds to explain. The edge model checks every reading. System 1 and the LLM only run when one looks wrong.

  1. ms
    Edge inference runner
    Labels each reading and scores how unusual it is.
  2. ms
    Mosquitto + Node-RED
    Route readings and raise an alert past your threshold.
  3. persistent
    InfluxDB
    Stores every reading and result for Grafana.
  4. <2s
    System 1
    Picks a likely cause from a list you define.
  5. seconds
    Ollama
    Explains the anomaly in plain language.
  6. stateful
    Letta agents
    Remember each machine's fault history.

Runs on the hardware
you already have.

Any 64-bit Linux machine with Docker. Tested on a Raspberry Pi 5, a Jetson Orin Nano and an embedded Linux computer; the other boards are untested. Models use the CPU unless you add the NVIDIA GPU override.

Raspberry Pi
GPIO BCM2712 4× A76 · 2.4GHz BROADCOM LPDDR4X8GB RP1 PCIe PWR HDMI0 HDMI1 FAN Raspberry Pi 5 Model B
Raspberry Pi 4
ARM Cortex-A72 · 2–8 GB RAM · USB 3.0
IoT GenAI Edge
Raspberry Pi 3B+
ARM Cortex-A53 · 1 GB RAM
IoT Edge
Raspberry Pi Zero 2 W
ARM Cortex-A53 · 512 MB RAM · Wi-Fi
Edge
NVIDIA Jetson
ORIN 40-PIN CAM0/1 PMIC DC DP JETSON ORIN NANO
Jetson Nano (4 GB)
ARM Cortex-A57 · 4 GB · 128-core Maxwell GPU
IoT GenAI Edge
Jetson Xavier NX
ARM Carmel · 8 GB · 384-core Volta GPU
IoT GenAI Edge
Banana Pi & Rockchip
RK3588 ROCKCHIP · 6 TOPS LPDDR5 LPDDR5 eMMC64GB PMIC CTRL NVMe SSD M.2 2280 · PCIe 3.0 NAND 2.5G 2.5G PD Banana Pi · RK3588
Banana Pi BPI-M7
RK3588 · 8–32 GB · NPU 6 TOPS
IoT GenAI Edge
Banana Pi BPI-M5 Pro
RK3576 · 4–16 GB · NPU 6 TOPS
IoT GenAI Edge
Rock 5B / Orange Pi 5 Plus
RK3588 · 4–32 GB · NPU 6 TOPS
IoT GenAI Edge
x86-64 Servers & Mini PCs
01 02 RACK SERVER · x86-64 MINI PC
Intel NUC / Beelink Mini PC
x86-64 · 8–32 GB RAM · Intel iGPU
IoT GenAI Edge
Any Linux VPS / VM
x86-64 · 4 GB+ RAM · Ubuntu / Debian
IoT GenAI
ARM64 & x86-64 — every Docker image is built for both
1 GB minimum for the IoT layer · 4 GB+ for the AI layer (8 GB recommended)

No board yet? Test against its limits.

Your workstation, capped to a real board's CPU, memory and disk. Install p4n4-emu, then run p4n4 up --emu rpi5.

Hardware profiles
ProfileCPUsMemoryDisk R/WArch
rpi5 47 GB100 MB/s arm64
rpi4 43.5 GB50 MB/s arm64
nuc 414 GB200 MB/s x86_64
mcu-class 1256 MB10 MB/s x86_64
Compose overlay
Board limits go in a separate Compose file, so your project files don't change.
QEMU ARM64
Runs ARM64 images on an x86 computer.
Sensor simulator
Publishes made-up readings over MQTT.
GPIO stub
Stands in for RPi.GPIO, so Pi code runs off the Pi.
p4n4-emu on GitHub

Running in three commands.

Needs Docker 24+ with Compose v2, Python 3.11+ and Git.

quickstart
01
pipx install p4n4
02
p4n4 init my-project # add --layer all for every layer
03
cd my-project && p4n4 up

v0.4 is for development and trusted networks. Don't expose its ports to the internet.