█

AI/TLDR

Buy me a coffee
Buy me a coffee

Keystone

A virtual AI Key and AI Port for UniFi Protect that runs search, event descriptions and detections on local models

Physical Sensing & PerceptionOpen source
Language
Python
License
Apache-2.0
IN SHORT

What is Keystone?

Keystone is an open-source (Apache-2.0) program that stands in for two pieces of Ubiquiti hardware: the AI Key and the AI Port for UniFi Protect, the video surveillance system in UniFi networks. It sits in the Physical Sensing & Perception category of the Robotics & Embodied AI tools and is open-source, written in Python and licensed Apache-2.0.

Overview

Keystone is an open-source (Apache-2.0) program that stands in for two pieces of Ubiquiti hardware: the AI Key and the AI Port for UniFi Protect, the video surveillance system in UniFi networks. Those devices unlock Protect's AI features, such as plain-English search, detailed event descriptions, face and license plate recognition and smart detections on third-party cameras. Keystone runs on a computer you already own and does the same jobs with open models on your own network. It is an unofficial community project with no affiliation to Ubiquiti, and the README says it ships no vendor firmware, proprietary binaries or vendor model weights.

Protect adopts Keystone under UniFi Protect → UniFi Devices exactly as it would a real AI Key, and optionally a virtual AI Port, with no database hacks, patched Protect files or cloud subscription. UniFi cameras with smart detections (G4 and newer) get search and event descriptions, and G4/G5 cameras also get face and plate recognition. Third-party ONVIF cameras (Reolink, Amcrest, or Nest through Scrypted) and older UniFi cameras pair with the virtual AI Port, which gives them Protect's native person, vehicle, animal, package and audio detections.

The UniFi Protect device list with Keystone adopted as an AI Key and as a UP AI Port X, with several Nest cameras paired to the virtual AI Port.
Protect lists Keystone as an AI Key and an AI Port, with third-party Nest cameras paired to the virtual port.Keystone README ↗

Most of the work runs on a CPU: Find Anything search uses CLIP embeddings stored in a local PostgreSQL database with pgvector, transcripts use a local Whisper model, and detections use ONNX models, with optional Intel OpenVINO, NVIDIA CUDA, AMD MIGraphX or Apple Silicon CoreML acceleration. Event descriptions need a vision-language model: an Ollama server (qwen3.5:9b by default), any OpenAI-compatible server such as LM Studio, llama.cpp or vLLM, or the hosted OpenAI or Anthropic APIs. Keystone also runs a local status dashboard on port 8088. The README lists testing on UniFi Protect 7.3.74, 7.4.112 and 7.4.114.

What it does

  • Plain-English and reference-photo search (Find Anything) inside Protect's own search bar, on by default and CPU-only
  • Event descriptions written by a local or hosted vision model, which turn alerts like "Vehicle detected" into a sentence and map to Protect's built-in tags
  • A virtual AI Port that gives up to 10 HD third-party ONVIF cameras Protect's smart detections, zones, line crossing and loitering
  • Face recognition with Enhance Face (GFPGAN) and license plate recognition that file results under Protect's Faces and Known Vehicles
  • Speech transcripts from camera microphones plus Protect's nine Smart Audio alarms on paired cameras
  • Webhooks and MQTT for Home Assistant or ntfy, and installers for Home Assistant OS, Docker Compose, Proxmox LXC, Unraid and macOS Homebrew

Getting started

The README offers one install path per setup; each one also sets up the local search database Protect 7.3+ uses for Find Anything. These steps follow the Docker Compose route on a Linux host.

Download the Compose files and run setup

On a Linux host with Docker Compose and Python 3 (no clone needed), fetch the compose file and the setup script. Setup asks for your UniFi Protect controller's IP and, optionally, an Ollama or AI server URL for event descriptions; press Enter to skip descriptions for now.

bashbash
mkdir keystone && cd keystone
curl -fsSLO https://raw.githubusercontent.com/seeARMS/keystone/main/docker-compose.yml
curl -fsSLO https://raw.githubusercontent.com/seeARMS/keystone/main/scripts/setup-compose.py
python3 setup-compose.py
docker compose up -d

Adopt the AI Key in Protect

Open UniFi Protect → UniFi Devices and adopt the discovered AI Key. The initial credentials are ubnt / ubnt and Protect rotates them on adoption. Then turn on Settings → Intelligence → Basic Understanding plus Smart Detections on each camera for Find Anything search.

Point it at a vision model for event descriptions

Event descriptions need a vision-capable model. Set the vision block in config.yaml to an Ollama server (or use provider openai-compatible with a /v1 URL for LM Studio, llama.cpp or vLLM), then restart Keystone.

yamlyaml
vision:
  provider: ollama
  base_url: http://192.0.2.20:11434
  model: qwen3.5:9b

Turn on optional features

Face recognition, license plates, speech-to-text and the virtual AI Port are off by default. Enable them in config.yaml and restart; Protect picks them up without re-adoption. Face recognition downloads InsightFace weights that are licensed for non-commercial research only, so check the terms first.

yamlyaml
aiport:
  enabled: true
lpr:
  enabled: true
stt:
  enabled: true
  backend: onnx
  model: whisper-base
Keystone's local status dashboard with service cards for Protect control, the virtual AI Port, vision captions, Find Anything, faces, plates and speech, a camera table and an activity feed of event descriptions.
The local dashboard shows each service's status, paired cameras and recent event descriptions.Keystone README ↗

Check the dashboard

Keystone serves a local status page on 127.0.0.1:8088 showing whether each service is ready, off or failing. On a headless host, tunnel to it over SSH.

bashbash
ssh -L 8088:127.0.0.1:8088 user@192.0.2.50

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Add plain-English search and written event descriptions to a UniFi Protect system without buying an AI Key
  • Bring Reolink, Amcrest or Nest (via Scrypted) cameras into Protect with native person, vehicle, package and audio detections
  • Keep camera analysis on your own network with local open models, or use a hosted vision API when there is no GPU
  • Feed camera event descriptions into Home Assistant automations or ntfy notifications over MQTT or webhooks

How Keystone compares

Keystone alongside other open-source physical sensing & perception tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
RuView★ 106kA WiFi-sensing platform that turns Channel State Information from low-cost ESP32 nodes into presence, 17-point body pose, breathing and heart-rate estimates, with Home Assistant, Matter and HomeKit bridges.
Unblink★ 1.5kAn open-source camera monitoring app that runs a local node to relay RTSP and MJPEG cameras to a server, where a vision-language model summarizes frames and you can chat with and search your feeds in natural language.
Keystone—A virtual AI Key and AI Port for UniFi Protect that runs search, event descriptions and detections on local models