PyTrickle is early-stage software (3 stars, 20 open issues as of April 2026). The API is stable enough for production use (Embody SPE and Streamplace use it) but the project is under active development. Check the GitHub repository for the latest API changes before building against it.
Installation
- Python 3.8 or later
- PyTorch (for GPU tensor support)
- FFmpeg (for encoding/decoding)
- NVIDIA GPU recommended for inference workloads
FrameProcessor
FrameProcessor is the base class you subclass to implement your AI model. Override the async methods for the workload types your container handles.
VideoFrame
VideoFrame wraps a decoded video frame as a PyTorch tensor with metadata.
Key methods:
AudioFrame
StreamServer
StreamServer wraps your FrameProcessor with the REST API contract required by the Livepeer gateway. You do not implement the endpoints manually.
StreamServer automatically exposes four endpoints on the configured port:
TrickleClient
For direct trickle protocol connections without the REST API layer:Built-in monitoring
FrameProcessor exposes metrics via get_metrics():
/api/stream/status endpoint when running via StreamServer.
Related pages
BYOC Guide
Full BYOC walkthrough: implementing FrameProcessor, building a container, and deploying to the network.
Build with ComfyStream
ComfyStream uses PyTrickle internally — use it if your model is a ComfyUI workflow.