@trillboards/edge-sdk
v0.2.2
Published
Composable cross-platform Edge AI SDK for audience sensing on DOOH/CTV devices
Maintainers
Readme
@trillboards/edge-sdk
Turn any screen into an AI-powered DOOH advertising endpoint. Edge AI audience sensing, ad delivery, federated learning, and cloud inference in one package. Linux and Windows.
Quick Start
npm install @trillboards/edge-sdk
npx trillboards-edge download-models
npx trillboards-edge start --config trillboards.config.jsonWhat This Does
The Edge SDK runs on digital signage hardware (kiosks, vending machines, billboards, CTV devices) and provides:
- Audience sensing — on-device face detection, gaze tracking, emotion analysis, foot traffic estimation via ONNX models (no cloud dependency)
- Ad delivery — Chromium browser lifecycle, display management, VAST/VPAID ad rendering
- Federated learning — privacy-preserving on-device model training with sparse gradient uploads
- Cloud inference — Gemini Vision scene analysis, content moderation, contextual targeting
- Device management — heartbeat, health monitoring, auto-recovery, signal buffering for offline resilience
All audience data stays on-device. Only aggregated, anonymized metrics are transmitted.
Configuration
Create trillboards.config.json:
{
"apiBaseUrl": "https://api.trillboards.com",
"deviceToken": "your-device-token",
"camera": { "enabled": true, "width": 640, "height": 480, "fps": 10 },
"audio": { "enabled": true },
"models": { "dir": "./models", "executionProvider": "cpu" },
"kiosk": { "enabled": true, "url": "https://screen.trillboards.com" },
"cloud": { "enabled": false },
"federated": { "enabled": true },
"logLevel": "info"
}Programmatic Usage
import { EdgeAgent, loadConfig } from '@trillboards/edge-sdk';
const config = loadConfig('trillboards.config.json');
const agent = new EdgeAgent(config);
agent.on('started', ({ fingerprint, tier }) => {
console.log(`Device ${fingerprint} running at TIER_${tier}`);
});
await agent.start();CLI Commands
| Command | Description |
|---------|-------------|
| trillboards-edge start [--config path] | Start the edge agent |
| trillboards-edge download-models [--dir path] | Download ONNX models (BlazeFace, YAMNet) |
| trillboards-edge version | Print SDK version |
Capability Tiers
The SDK auto-detects device capabilities and adjusts inference accordingly:
| Tier | RAM | NPU | Models | FPS | |------|-----|-----|--------|-----| | TIER_1 | < 2 GB | No | Face only | 2 | | TIER_2 | 2-4 GB | No | Face + Audio | 5 | | TIER_3 | 4-8 GB | Optional | All models | 10 | | TIER_4 | 8+ GB | Yes | All + high-res | 15+ |
Execution Providers
cpu— works everywhere (default)openvino— Intel integrated GPU (2-3x faster)directml— Windows GPU accelerationcuda— NVIDIA GPU
Sub-Packages
This is the umbrella package. For fine-grained control, install sub-packages individually:
| Package | Purpose | |---------|---------| | @trillboards/edge-core | Device identity, Socket.io, config, signal buffer, health monitoring | | @trillboards/edge-sensing | ONNX face detection, audio classification, audience metrics | | @trillboards/edge-ads | Chromium browser lifecycle, display management, ad delivery | | @trillboards/edge-federated | On-device federated learning, sparse gradient upload | | @trillboards/edge-cloud | Gemini Vision scene analysis, contextual targeting | | @trillboards/edge-platform-linux | V4L2 camera, PulseAudio, systemd, kiosk mode | | @trillboards/edge-platform-windows | DirectShow, RTSP IP cameras, WASAPI audio |
Platform Support
- Linux — Ubuntu 20.04+, Debian 11+, Raspberry Pi OS (ARM64)
- Windows — Windows 10/11 (x64)
Get a Device Token
npx @trillboards/ads-sdk initOr register via the Trillboards API.
License
MIT
