tinkerline / projects / sentinel

Sentinel

A self-hosted, GPU-accelerated network video recorder built in Go — real AI detection on your cameras (people, not headlights), face recognition, and a REST + MQTT API that plugs straight into Home Assistant. Your footage never leaves your box.

Self-hosted Go GPU detection (ONNX / TensorRT) Face recognition REST + MQTT AGPL-3.0

01Why I built it

I run cameras at home and wanted real AI detection — people, not headlights — without shipping video to a cloud I don't control or paying a monthly fee for the privilege. The popular self-hosted options are built in Python, and once you're running detection on several cameras at once, that starts to show. I wanted something built for throughput from the start, that treats my footage as sacred and runs on whatever hardware I happen to have.

Sentinel is a network video recorder written in Go. It records your cameras, runs object and face detection on a GPU — or a CPU, or even a Raspberry Pi — and exposes everything through a REST API and an MQTT event stream, so Home Assistant and the rest of your smart home can react to what it actually sees. The one rule it never breaks: a bad config or a missing model never costs you footage. It drops to recording-only and logs exactly what went wrong, so a mistake means "no detection for a bit," never "the camera wasn't recording."

02How it's built (for the curious)

The decisions that matter:

Go instead of Python. For the concurrency and the single-binary deployment. Detection runs through pluggable backends: ONNX Runtime for portability — verified on NVIDIA GPUs, x86-64 CPUs, and a Raspberry Pi 4 — or NVIDIA TensorRT / DeepStream when you have the hardware. It ships as two Docker images so nobody downloads CUDA libraries their box can't use: a ~220 MB CPU image and a ~4.6 GB GPU one.

PostgreSQL + pgvector, doing double duty. It's the storage layer and what powers built-in face recognition — ArcFace embeddings stored and searched as vectors, no separate service.

The parts that make an NVR actually usable. Multi-camera batching for GPU efficiency, polygon zone detection with inertia, an IoU centroid tracker, background-subtraction motion detection, MP4 segment recording that's HLS-compatible, WebSocket events, and config hot-reload via fsnotify so you're not restarting the stack just to add a camera.

Built to be consumed. Everything is exposed over a documented REST API and an MQTT event stream with stable payload shapes, so Home Assistant and existing home-automation tooling can react to it directly. It's in daily use on an eight-camera GPU deployment, running continuously.

03Get it

Runs as a Docker stack (Sentinel + PostgreSQL/pgvector + MQTT). A GPU gives the best detection throughput, but it runs on CPU or a Raspberry Pi too.

04More from the workshop