Install the Runtime
First, install the Reactor Runtime package:run and init.
Create a Model Project
Reactor provides a starter template to get you going. Create a new project:Start the Model
Run the model with the HTTP runtime:Startup Logs

The model loads once and stays in memory. When users connect and disconnect, only the session
changes, but the weights remain loaded. This is the key to low-latency serving. See Model
Instancing for details.
Configuring WebRTC
WebRTC uses STUN/TURN servers to establish connections and UDP ports for media streaming. The defaults work for most local development, but you can customize them for restrictive network environments.- CLI Flags
- Environment Variables
Connect a Frontend
With the model running, you need a client to connect to it. Reactor provides a scaffolding tool that sets up a Next.js frontend with the SDK pre-configured. Open a new terminal and run:- Project name: Enter any name (e.g.,
my-frontend) - Template: Select
dynamicfrom the list


See It Work
Ensure that thelocal checkbox is selected in the dynamic UI.
Click Connect in the frontend. You will see:
1. The video stream appears, showing an animated gradient
1. The video stream appears, showing an animated gradient

2. A slider appears for the set_brightness command
2. A slider appears for the set_brightness command

3. In your model terminal, you will see Session started
3. In your model terminal, you will see Session started
Session ended, and the model returns
to idle, ready for the next connection.
Extending the Model
Now that you have a working setup, let’s add a new capability. Openbrightness_example.py and add
a new command to control the animation speed:
__init__ to initialize the speed:
_generate_frame:
_reset_state:
Ctrl+C then reactor run --runtime http), refresh the frontend, and
reconnect. A new slider for animation speed appears automatically. The frontend reads your model’s
command schema and generates the appropriate UI.
The
@command decorator turns methods into real-time API endpoints. Type annotations and Pydantic
Field constraints become the schema that frontends use to generate controls. See Accepting User
Inputs for the full API.Next Steps
You now have a working local development environment. From here:Understand the Model Lifecycle
Learn how models load, serve sessions, and stay efficient across users.
Build Real Pipelines
Structure your generation loop for continuous real-time output.
Frontend SDK
Build custom frontends with the full Reactor SDK API.
Configuration
Use YAML configs and CLI overrides for flexible model setup.
