Skip to main content
The rest of these docs describe the client side of Reactor: the app you write with the JavaScript or Python SDK to drive a model and render what it sends back. This section describes the other side, where that model comes from. A model is a Python class built on the Reactor Runtime, an open-source framework that turns an inference pipeline into a live, interactive video stream. You write two methods. The runtime handles WebRTC, the session lifecycle, media encoding, and every client that connects.

How it works

1

Write the model

Subclass ReactorModel. Declare the tracks it sends, load your weights in load(), and emit frames from run().
model.py
2

Declare what clients can change

An @event handler is a command a client can call. Its signature is the payload, and the runtime validates every field before the handler runs.
3

Run it locally

The reactor CLI builds a container with the runtime already inside it and serves your model on port 8080. The CLI and Docker are the only things that install on your machine — see Install the CLI.
reactor init scaffolds a workspace with a working model, a Dockerfile, and the runtime already pinned, so there is something to run before you write anything.
4

Connect a client

Point the SDK at the model running on your machine. The same code drives a deployed model once you drop local.
See Using the SDK for the full client API.
5

Deploy it

reactor model register once, then reactor model publish and reactor model deploy for each release, all from the same workspace. It runs on Reactor’s GPUs, in every region the platform serves.

What the runtime handles

Real-time streaming

Frames reach clients over WebRTC as you generate them, not after the video is finished.

Live interaction

Clients change inputs mid-generation. Nothing restarts, and nothing is re-queued.

No transport code

You never import a WebRTC library, hold a WebSocket open, or encode video.

Validated inputs

Declare each command with types and constraints. The runtime checks every payload first.

Next

Runtime Overview

Tracks, the run loop, commands, and messages.

Model Anatomy

A working model read line by line.