Reactor runtime with public model API
Project description
Reactor Runtime
A Python framework for building real-time, interactive video models. Write your ML code — Reactor handles networking, media transport, and client connections.
Installation
pip install reactor-runtime
Quick Example
from dataclasses import dataclass
from reactor_runtime.interface import Output, Video, ReactorPipeline, InputState, InputField
@dataclass
class MyOutput(Output):
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(video=frame)
Implement inference() as a generator that yields frames. Clients can update self.state mid-generation — no restart, no re-queue.
Key Features
- Real-time streaming — frames delivered over WebRTC as they're generated
- Live interaction — clients change inputs mid-generation via typed, validated state
- No transport code — no WebRTC, WebSocket, or video encoding to manage
- Scaffold & run — the Go
reactorCLI gives youreactor init/reactor run; the Python runtime ships its ownreactor-runtimescript for standalone use
Standalone usage (no Go CLI)
The runtime CLI is installed as reactor-runtime so it never shadows the Go
reactor binary. If you only use the Python runtime:
pip install reactor-runtime
reactor-runtime init my-model
cd my-model
python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
reactor-runtime run
The Go reactor CLI delegates to this same reactor-runtime script under the
hood; both reactor run (Go) and reactor-runtime run (standalone) execute the
same Python entry point.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reactor_runtime-2.5.0.tar.gz.
File metadata
- Download URL: reactor_runtime-2.5.0.tar.gz
- Upload date:
- Size: 215.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97a162aa3823478d67ac769c5af10ec4bbe8bd468d070ca86df536f5a218f3ad
|
|
| MD5 |
df6373c4c4b2f86e19f697ce2955c575
|
|
| BLAKE2b-256 |
83dedd8c1476b960f96f8a3a6b1be654d50a0c6e77ccbbcce7318f8d49b70fe6
|
File details
Details for the file reactor_runtime-2.5.0-py3-none-any.whl.
File metadata
- Download URL: reactor_runtime-2.5.0-py3-none-any.whl
- Upload date:
- Size: 278.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40cbafaf45ed06f22d14ed02e1ed7398c0764b1fc633fd4836c2f6d366644d0d
|
|
| MD5 |
66784bf01e1f183fffb738db33551929
|
|
| BLAKE2b-256 |
7957cfd8e0a54e2bea49a9ea42c349dea4bbe176d4468385b451a588019e5493
|