This is a submission for the Gemma 4 Challenge: Build with Gemma 4
What I Built
I Built a local-first AI CCTV assistant Using Gemma 4, Frigate, and Home Assistant
Most CCTV notifications are noisy and not actually useful.
Typical camera alerts are mostly:
Motion detected at Front Door
That tells me something happened, but not what actually happened.
Was it:
- a delivery person?
- someone waiting outside?
- a suspicious stranger?
- or just random movement?
I wanted a system that could intelligently summarize what was happening on my cameras while keeping everything completely local and privacy-friendly.
So I built a local AI-powered surveillance assistant using:
- Frigate for movement detection
- Home Assistant for automations
- Gemma 4 running locally through Ollama
- Mobile notifications for real-time summaries
Now instead of generic motion alerts, I receive notifications like:
“A person wearing a dark shirt approached the gate, waited briefly, and left.”
All processed locally without sending any footage to the cloud.
The system continuously monitors my WiFi connected CCTV cameras using Frigate. Frigate is an open-source NVR that performs real-time object detection on video feeds. You can learn more about Frigate here.
Whenever Frigate detects a person:
- Relevant frames are sent to a locally running Gemma 4 model
- Frigate creates an event with the video clip and the AI summary.
- Home Assistant automation triggers
- A rich notification is sent directly to my phone
The result is a much more useful home surveillance experience.
Instead of manually checking every alert, I can instantly understand what happened from the notification itself.
Demo
Video demo will be added here soon.
Code
You can find the YAML configuration for Frigate and Home Assistant automations in this GitHub Gist.
Update prompt and other alert / review settings as per your requirements in the Frigate config
If you run into any issues while setting it up, feel free to comment below. Your WiFi cameras should provide an RTSP stream that can be integrated into the Frigate configuration. Just refer to your camera’s documentation for instructions on retrieving the stream URL.
How I Used Gemma 4
I used the gemma4:e2b model running locally through Ollama.
The model runs inside a dedicated Proxmox container with GPU passthrough enabled for faster inference.
I specifically chose E2B variant because:
- it is lightweight enough for local deployment
- inference latency is low
- it works well for concise visual summarization tasks
Without Gemma 4, the system would only know:
“A person was detected.”
With Gemma 4, the system understands and communicates:
- what the person is doing
- where they moved
- how long they stayed
- and whether the event is important
That dramatically improves the usefulness of camera notifications.


Top comments (0)