Skip to main content
Reactor Runtime is a Python framework for turning inference pipelines into real-time, interactive video streams. You focus on your ML code. Reactor handles the networking, media transport, and client connections. Key features:
  • Real-time streaming: frames are delivered to clients over WebRTC as they’re generated, not after the entire video is done.
  • Live interaction: clients can change inputs mid-generation. No restart, no re-queue.
  • No transport code: you never import a WebRTC library, manage a WebSocket, or encode video.
  • Typed, validated inputs: declare what inputs your model accepts with types and constraints. The runtime handles validation.

The simplest model

from dataclasses import dataclass
from reactor_runtime.interface import Output, Video, ReactorPipeline, InputState, InputField

@dataclass
class MyOutput(Output):
    main_video: Video

@dataclass
class MyState(InputState):
    prompt: str = InputField(default="a sunny meadow")

class MyModel(ReactorPipeline):
    state: MyState

    def load(self, config):
        self.pipe = load_my_model(config["checkpoint"])

    def inference(self):
        while True:
            frame = self.pipe.forward(prompt=self.state.prompt)
            yield MyOutput(main_video=frame)
That’s a complete Reactor model. The inference() generator yields frames as fast as your model produces them. The client can send set_prompt at any time and self.state.prompt updates automatically between iterations.

From model to production

Once your model is wrapped with the runtime, you get two things for free: Client SDKs - Connect any frontend to your model with a few lines of JavaScript or Python. The SDK handles WebRTC, sessions, and real-time input. See the SDK docs. Deploy to Reactor - Push your model to Reactor’s GPU cloud and have it live in under 3 minutes. No infrastructure to manage. See the deployment guide.

Next

Quickstart

Install, scaffold, and run your first model in 2 minutes.

Model Anatomy

Understand every line of a Reactor model.