The API layer between a SAE instance and the outside world (e.g. a cloud backend system). It publishes information about the local SAE instance to a backend Valkey, and is the place where inbound communication from the backend will be handled in the future.
- Reports lifecycle events — on startup and shutdown it publishes an
EventMessagedescribing the instance to the backend. - Forwards frames — periodically pulls the latest frame from each local video
source stream and forwards a frame-only
SaeMessageto the backend (one output stream per source).
It reads from a local source Valkey and writes to a remote backend Valkey. Stream keys are built from the prefixes and IDs in the configuration:
| Direction | Valkey | Stream key | Payload |
|---|---|---|---|
| Input | source | {video_source_stream_prefix}:{source_id} |
SaeMessage |
| Output | backend | {frame_forwarding.output_stream_prefix}:{source_id} |
frame-only SaeMessage |
| Output | backend | {event_reporting.output_stream_prefix}:{instance_id} |
EventMessage |
Source streams are discovered by scanning the source Valkey for keys matching
{video_source_stream_prefix}:*.
Configuration is read from settings.yaml (see settings.template.yaml for all
options); every value can be overridden via environment variables, using __ as the
nesting delimiter (e.g. BACKEND_VALKEY__HOST). Point SETTINGS_FILE at a different
file to use another location.
poetry install
poetry run python main.pyA Prometheus metrics endpoint is served on prometheus_port (8000 by default).
poetry run pytest