Skip to main content

Install

pip install reactor-runtime

Scaffold a project

reactor init my-model
This creates a ready-to-run project:
my-model/
├── pipeline.py         # ReactorPipeline — generator pattern (default)
├── model.py            # ReactorModel — manual run loop pattern
├── reactor.yaml        # Tells the runtime where your model class lives
├── config.yml          # Model config (passed to load() as a dict)
├── requirements.txt    # Extra Python dependencies
└── README.md

Run it

cd my-model
pip install -r requirements.txt
reactor run
The runtime loads your model, starts an HTTP server, and waits for a client to connect. You’ll see:
INFO   Model loaded: MyModel
INFO   HTTP server listening on 0.0.0.0:8080
INFO   Waiting for client...
Connect a frontend to see the model output in real-time. The fastest option is the Demo Frontend - just open it and click Connect. To build your own frontend, use the JS SDK with local: true to connect directly to your local model on port 8080:
import { ReactorProvider, ReactorView } from "@reactor-team/js-sdk";

<ReactorProvider modelName="my-model" local={true} autoConnect={true}>
  <ReactorView className="w-full aspect-video" />
</ReactorProvider>

What just happened

  1. The runtime read reactor.yaml and found pipeline:MyModel (that’s pipeline.py, class MyModel).
  2. It loaded config.yml and passed it to MyModel.load() as a dict.
  3. It started an HTTP server with WebRTC signaling endpoints.
  4. When a client connects, the runtime calls inference() and starts streaming the yielded frames.

Inspect schema

Without starting the server, you can see what your model exposes to clients:
reactor schema
This prints the tracks, events, and messages your model declares. Useful for verifying the client-facing contract.

CLI options

reactor run --help
Common flags:
FlagDescription
--path <dir>Model directory (default: current directory)
--port <number>HTTP server port (default: 8080)
--model.<key>=<value>Override config values (e.g. --model.width=1280)
-v / --verboseDebug logging

Next steps

Model Anatomy

Understand every piece of the scaffolded model.

Make It Interactive

Add parameters that clients can change in real-time.