Prerequisites
Before you begin, make sure you have:- Python 3.8 or higher
- Access to the Reactor repository
- AWS credentials configured (for model weight downloads)
Step 1: Install the Runtime
Install the Reactor runtime:reactor CLI command.
Step 2: Install LiveKit Server
If this is your first time running the runtime, you’ll need to install the local LiveKit server.Why LiveKit? Reactor uses LiveKit to power real-time video streaming
between your model and frontends. LiveKit handles all WebRTC complexity: room
management, peer connections, adaptive streaming, and more. Running it locally
gives you production-quality streaming with zero latency and zero cost during
development.
Step 3: Configure AWS Credentials
Model weights are stored in Reactor’s Model Registry (S3). Configure your AWS credentials to enable automatic downloads:Developing a new model or using local weights? You can skip this step!
Continue using your existing model loading process (downloading from Hugging
Face, local files, etc.). Reactor’s Model Registry is optimized for production
deployments. When you’re ready to deploy, the Reactor team will handle
uploading your weights to our registry—your code barely changes.
Step 4: Navigate to a Model
Go to any model directory (wheremanifest.json is located):
Step 5: Run the Model
Start the runtime:Phase 1: Model Loading
The runtime reads yourmanifest.json and instantiates your VideoModel class:
Phase 2: Component Startup
Three components start simultaneously:- Runtime Server (Port 8081) - FastAPI server hosting your model
- Local LiveKit Server (Port 7880) - WebRTC streaming server
- Development services - Session management and coordination
Phase 3: Ready State
Once you see “Ready to accept connections”, your model is:- Loaded in GPU memory
- Listening for session requests
- Connected to LiveKit
- Ready to stream to clients instantly
Step 6: Connect from a Client
Node.js Required: The following steps use
npx which requires Node.js to
be installed. If you don’t have Node.js installed, download it from
nodejs.org.npx create-reactor-app are perfect starting points—they’re already set up with working examples.
If you’re building a custom model with your own directives: You can code your own demo frontend at the same time! Reactor handles all the networking, streaming, and real-time communication for you. You just focus on building your UI and user experience. Learn more in the Usage Guide and API Reference.
Option 1: Using an Example Project (Recommended)
The fastest way to test is with a pre-built example:local flag.
After the project is created, navigate to /app/page.tsx and update the ReactorProvider component:
- Add the
localprop - This tells the SDK to connect to your local runtime instead of production - Replace
your-model-namewith the name of the model you’re running locally. This should match themodel_namein yourmanifest.json.
Option 2: Using Your Own Frontend
If you’re building a custom React application from scratch, set thelocal flag on ReactorProvider:
Step 7: Start Testing
pnpm Required: If you don’t have pnpm installed, install it first with
npm install -g pnpm (requires Node.js from Step 6). See the pnpm
installation guide for more options.What Happens When You Connect:
start_session() method runs, and frames stream in real-time to your browser.
Understanding Components in Action
| Component | Role During Session | Port |
|---|---|---|
| Frontend | Displays video, sends commands to model | 3000 |
| Runtime Server | Runs your model, generates frames | 8081 |
| LiveKit Server | Streams video frames between runtime and frontend | 7880 |
Development Workflow
The streamlined local development loop:-
Connect - Click “connect” button
- Runtime starts a new session
- Your
start_session()method executes - Video streams to your browser
-
Test - Interact with your model in real-time
- Send commands via the SDK
- See results instantly
-
Disconnect - Click “disconnect” or close tab
- Your
end_session()method executes (if implemented) - Session cleans up
- Model stays loaded and ready
- Your
-
Reconnect - Click “connect” again
- New session starts instantly (model already loaded)
- No restart needed
Hot Reload Tips
- Model Code Changes: Restart
reactor run - Frontend Changes: Hot reloads automatically
- Manifest Changes: Restart
reactor run - Between Sessions: No restart needed
