Keystone — Local AI Key & AI Port for UniFi Protect Copyright 2026 Keystone Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. This project is unofficial and is not affiliated with, endorsed by, or sponsored by Ubiquiti Inc. No vendor firmware, proprietary binaries, or vendor model weights are included. The dashboard ships third-party JavaScript, CSS, icons, and fonts. Their copyright notices and license texts are embedded in src/keystone/ui/index.html under the element ID third-party-notices, including in rendered demo copies. Upstream code attribution & third-party model acknowledgments: - Portions of Keystone's UniFi Protect UCP4 AI Key control, adoption/management handlers, TLS pinning, worker/CLIP reverification, and AI Port adoption code (specifically control.py, worker.py, aiport.py, and tls.py) are adapted from Olli0103/unifi-protect-local-ai (https://github.com/Olli0103/unifi-protect-local-ai), licensed under the Apache License, Version 2.0, and modified for Keystone. - Find Anything semantic and image search uses CLIP ViT-L/14 ONNX weights exported from OpenAI CLIP (MIT License) via Xenova/clip-vit-large-patch14 (https://huggingface.co/Xenova/clip-vit-large-patch14), pinned to an immutable commit and verified by SHA-256 on download. - Optional on-device ONVIF object detection uses official Apache-2.0 YOLOX ONNX models from Megvii-BaseDetection/YOLOX (https://github.com/Megvii-BaseDetection/YOLOX), verified by SHA-256 on download. - AI Port package detection (`package` / `packageMaincam`) uses D-FINE Small trained on Objects365 (ustc-community/dfine_s_obj365, https://huggingface.co/ustc-community/dfine_s_obj365; Peterande/D-FINE, https://github.com/Peterande/D-FINE), licensed under the Apache License, Version 2.0. ONNX exports are downloaded lazily at runtime from https://huggingface.co/onnx-community/dfine_s_obj365-ONNX (pinned to commit a61e4cdfe4f9d3188a305d91e37dbf38688ffbb8) and verified by SHA-256 on download and again before every load: * `onnx/model_int8.onnx` (default `aiport.package_quantization: int8`), SHA-256 3355fe77be41bca48937cd5bb100de51e1bfd894e67275f6d398cfda35624838 * `onnx/model_fp16.onnx` (`fp16`), SHA-256 0acee6c44082a997bb3b7a70709bcba893e63f9f8337e9a02d0345a7c0e88c1e * `onnx/model.onnx` (`fp32`), SHA-256 372feaa33ac6ba67d7df8589628f6abc395b3c6981c4edc70dfcfe2949751120 These weights are NOT included in this repository. - Optional speech-to-text uses OpenAI Whisper (MIT License, https://github.com/openai/whisper) ONNX exports from the onnx-community Hugging Face repos (whisper-tiny / whisper-base / whisper-small, https://huggingface.co/onnx-community), downloaded at runtime, pinned to immutable commits, and verified by SHA-256. These weights are not included in this repository. - AI Port speech detection (`alrmSpeak`) uses the Silero VAD v6.3 ONNX model (snakers4/silero-vad, https://github.com/snakers4/silero-vad), licensed under the MIT License (Copyright (c) 2020-present Silero Team). It is downloaded at runtime from https://raw.githubusercontent.com/snakers4/silero-vad/63d4a2a7bfce8cd9bb39ed8fa0afcb5236d73e01/src/silero_vad/data/silero_vad.onnx (pinned to commit 63d4a2a7bfce8cd9bb39ed8fa0afcb5236d73e01) and verified by SHA-256 (f6f4407b41e05e277e7f5cfd9b9ae957b1dfe763c6076a934734c0b448e09b31) on download and before every load. The weights are NOT included in this repository. - AI Port Smart Audio alarm detection (`alrmBark`, `alrmBabyCry`, `alrmSmoke`, `alrmCmonx`, `alrmSiren`, `alrmBurglar`, `alrmCarHorn`, `alrmGlassBreak`) uses Google Research YAMNet (https://github.com/tensorflow/models/tree/master/research/audioset/yamnet), licensed under the Apache License, Version 2.0, exported to ONNX via audiomagic/yamnet-onnx (https://huggingface.co/audiomagic/yamnet-onnx). It is downloaded at runtime from https://huggingface.co/audiomagic/yamnet-onnx/resolve/f25b741c2f0bdc6d7e6db24b5fddda23347dbafd/yamnet.onnx (pinned to commit f25b741c2f0bdc6d7e6db24b5fddda23347dbafd) and verified by SHA-256 (d3835ffbbd4a1bb3e777f0ca217b5007907f5171dd5d17c4236b95b2af8f908e) on download and before every load. The weights are NOT included in this repository. YAMNet's 521-class AudioSet ontology and class names (https://research.google.com/audioset/, Google LLC) are licensed under CC-BY-4.0 (Creative Commons Attribution 4.0 International). - Optional local face recognition uses InsightFace SCRFD (det_2.5g / det_500m) and ArcFace (w600k_r50 / w600k_mbf) ONNX weights from the official deepinsight/insightface v0.7 release (https://github.com/deepinsight/insightface), downloaded at runtime and verified by SHA-256. These weights are NOT included in this repository and are provided by InsightFace for non-commercial research purposes only; users enabling `faces:` are responsible for complying with that license. - Optional Face Image Enhancement (`enhance.backend: gfpgan`) uses GFPGAN v1.4 (TencentARC/GFPGAN, https://github.com/TencentARC/GFPGAN), licensed under the Apache License, Version 2.0. v1.4 uses the "Clean" StyleGAN2 generator and none of the NVIDIA-licensed CUDA ops listed among GFPGAN's third-party components. The ONNX export is downloaded at runtime from https://huggingface.co/neurobytemind/GFPGANv1.4.onnx (Apache-2.0 model card), pinned to commit e3fd467e3a83420614abb9bf0b1c2c3addd359bc and verified by SHA-256 (cd7311b8d9e13cdb1e208b12363182da58c7bf45e26d1aa67bbeac4751aae92e) before it is loaded. The weights are NOT included in this repository. - Optional license plate recognition (`lpr:`) downloads these weights at runtime. They are verified by SHA-256 on download and again before every load, and are NOT included in this repository: * Plate detector (default `lpr.detector: yolox_tiny`): open-lpr `plate_yolox_tiny_640.onnx`, a YOLOX-tiny model trained with the Apache-2.0 YOLOX codebase (Megvii-BaseDetection/YOLOX). Licensed under the Apache License, Version 2.0 (LICENSE and NOTICE in the model repository; the model card states that no Ultralytics/AGPL weights or code were used). Source: https://huggingface.co/faisalthaheem/open-lpr-models/resolve/aed0df35ec2891c5a90437041ebeadb592cc516b/onnx/plate_yolox_tiny_640.onnx (pinned to commit aed0df35ec2891c5a90437041ebeadb592cc516b), SHA-256 e5350bb2152eb44fa129b2438d1e39bbbf3c27accfe51cd893ce6e17d028d0b9. * Plate detector (optional `lpr.detector: yolox_s`): Autolane `yolox_plates_s.onnx`, YOLOX-S fine-tuned on US license plates. Licensed under the Apache License, Version 2.0 (model card). Source: https://huggingface.co/autolane/yolox-s-alpr/resolve/72332940134a1afd244576e09f84dc8fe94414a2/yolox_plates_s.onnx (pinned to commit 72332940134a1afd244576e09f84dc8fe94414a2), SHA-256 f9302f8c9a951861cf5e1266951d3962ce299b6636e73fa32032ffe38fe90ee7. * Plate OCR: fast-plate-ocr (ankandrew/fast-plate-ocr, https://github.com/ankandrew/fast-plate-ocr), MIT License, Copyright (c) 2024 ankandrew. The maintainer states the fast-plate-ocr model weights are MIT as well. Release `arg-plates` assets: https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_s_v2_global.onnx (default `lpr.ocr_model: cct_s_v2`), SHA-256 384bbbd2cea3ef54761d3df70822ef3a349ee1a112aeafddbe0e3ba06bc6e47b, and https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/cct_xs_v2_global.onnx (`cct_xs_v2`), SHA-256 8031afb5fdc6b4d80462c9d542f1284ebd2cfddf5dbacd62609848d7e2855f44. The YOLOv9 plate detectors from ankandrew/open-image-models are intentionally not used: their maintainer has stated they were trained and exported with a fork of the GPL-3.0 WongKinYiu/yolov9 code. - src/keystone/data/ram_tags.txt lists the 5,375 enabled English tag strings recognized by UniFi Protect's Recognize Anything (RAM) tag filter API, extracted from UniFi Protect's enabled tag vocabulary (excluding internal IDs and CSV metadata) strictly for tag-name interoperability. UniFi Protect is a trademark of Ubiquiti Inc.; inclusion of these interoperability tag strings does not imply affiliation with or endorsement by Ubiquiti Inc.