Find Anything
Search every camera in plain English, or with a photo, older UniFi and ONVIF cameras included. A local CLIP model indexes what they see.
Protect's AI features on the cameras Ubiquiti's AI doesn't cover: third-party ONVIF cameras and UniFi cameras older than G6. Keystone is an open-source AI Key and AI Port that adopts into Protect like Ubiquiti's own hardware, on a box you already own.
Apache-2.0 · Ollama, CLIP & YOLOX · 100% LAN
How it works
Keystone is a small service on a box you already run. Protect sends it events; it sends back descriptions, search results and detections over Protect's own protocols. Nothing goes to a cloud unless you point it at one.
Advertises over Ubiquiti UDP discovery and connects over Protect's own mTLS and WebSocket protocols (0xa5f0 and 0xa5f5). No database hacks or patched Protect files.
Looks at several moments of each event so moving cars aren't called parked, maps results onto Protect's 5,375-tag vocabulary, and embeds object crops with local CLIP ViT-L/14.
The built-in virtual AI Port (UP AI PORT X) relays HD streams with zero video transcoding, runs motion-gated YOLOX detections, and evaluates Protect's own polygon zones.
Features
The AI features Protect keeps for Ubiquiti's own AI hardware and newest cameras, on every camera you have, in the same places in Protect's own app.
Search every camera in plain English, or with a photo, older UniFi and ONVIF cameras included. A local CLIP model indexes what they see.
“Vehicle detected” becomes a sentence about what happened, written by a local vision model from several moments of the clip.
Reolink, Amcrest, Nest and other third-party cameras get Protect's own person, vehicle and animal detections, inside the zones you draw in Protect.
Every description maps onto Protect's tag vocabulary, so its filters, notifications and Alarm Manager work as they do with Ubiquiti's hardware.
When someone walks from the driveway to the door, what one camera saw clearly helps describe what the next one sees.
Ollama, CLIP and YOLOX on your own hardware. Point descriptions at an OpenAI-compatible or Anthropic endpoint only if you want to.
Quick start
Docker Compose on any Linux box, or Python 3.12+ in an LXC or systemd service.
Copy config.example.yaml, set controller.host and your vision model, and bring it up. Compose includes the TLS pgvector database Protect 7.3+ uses for Find Anything.
Open UniFi Protect → UniFi Devices and adopt the AI Key. The default credentials, ubnt / ubnt, rotate automatically on adoption.
Set aiport.enabled: true, adopt the AI Port, pair your cameras, and turn on Basic Object Recognition and AI Summary under Settings → Intelligence.
Includes Keystone + the local TLS pgvector database Protect 7.3+ uses for Find Anything.
Python 3.12+ with FFmpeg. Add PostgreSQL 16+ with pgvector for Find Anything search.
FAQ
Frigate is a separate NVR, with its own recordings, its own app and its own events. Keystone isn't an NVR and records nothing. It adopts into UniFi Protect as an AI Key and AI Port, so search, descriptions and smart detections show up in Protect itself: the web and mobile apps, push notifications, the timeline and Alarm Manager.
You keep Protect for recording, and everyone in the house keeps the app they already use.
No. Keystone takes the AI Key's and AI Port's place: it shows up in UniFi Devices as a virtual AI Key, and optionally a virtual AI Port, running on hardware you already own. And it works with the cameras you have, not only Ubiquiti's newest.
Every camera Protect records, including the ones Ubiquiti's AI doesn't cover. UniFi cameras older than G6 get Find Anything and event descriptions. Third-party ONVIF cameras you've added to Protect, such as Reolink, Amcrest or Nest, can also pair with Keystone's AI Port for Protect's own person, vehicle and animal detections, detection and exclude zones, and descriptions.
Any Linux machine, LXC container or Docker host on the same network as Protect. Search and ONVIF detection run on the CPU in about 4 GiB of RAM.
Descriptions need a vision model through Ollama, on the same machine or on another one with a GPU. A discrete GPU describes an event in a few seconds; an integrated one takes longer.
Not unless you choose to send it. Ollama, CLIP and YOLOX all run locally. If you'd rather use a hosted model for descriptions, Keystone can call any OpenAI-compatible or Anthropic endpoint instead.
It pins Protect's certificates, its adoption password rotates when Protect adopts it, and its status dashboard only listens on 127.0.0.1 unless you change that.
Descriptions come from any vision model Ollama serves (qwen3.5:9b by default), or from an OpenAI-compatible or Anthropic API. Find Anything uses CLIP ViT-L/14, and ONVIF detection uses YOLOX, both as ONNX models downloaded on first run.
Protect 7.3 and later. Find Anything relies on the pgvector search database Protect 7.3 introduced, which the Docker Compose setup includes.
Keystone doesn't patch Protect or touch its database, so an update can't overwrite it. It does speak Protect's own device protocols, so a release that changes them may need a Keystone update to match.
Yes. Besides Protect's own notifications, Keystone can send each description to a webhook or over MQTT, for Home Assistant, ntfy or anything else that listens.
Keystone uses host networking so Protect can discover it. If Keystone and Protect are on different VLANs, allow these:
| Direction | Port | Purpose |
|---|---|---|
| Keystone → Protect | TCP 7442 | UCP4 control WebSocket and AI Port avclient |
| Keystone → Protect | TCP 7443 | Find Anything search WebSocket |
| Keystone → Protect | TCP 7444 | Media export downloads and RAM callbacks |
| Keystone → Protect | TCP 7550 / 7551 | AI Port extendedFlv video ingest |
| Protect → Keystone | TCP 8080 | AI Key adoption (HTTPS) |
| Protect → Keystone | TCP 443 | AI Port adoption (HTTPS) |
| Protect → Keystone | TCP 5432 | PostgreSQL + pgvector over TLS for Find Anything |
| Protect ↔ Keystone | UDP 10001 | Ubiquiti LAN discovery (optional if adopted by IP) |
No. Keystone is an unofficial, open-source community project under the Apache-2.0 license. It includes no Ubiquiti firmware, binaries or model weights.
Keystone is free and open source. Start it next to Protect, adopt it, and search your cameras tonight.