Skip to main content

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 reactor CLI gives you reactor init / reactor run; the Python runtime ships its own reactor-runtime script 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reactor_runtime-2.7.4.tar.gz (239.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reactor_runtime-2.7.4-py3-none-any.whl (302.8 kB view details)

Uploaded Python 3

File details

Details for the file reactor_runtime-2.7.4.tar.gz.

File metadata

  • Download URL: reactor_runtime-2.7.4.tar.gz
  • Upload date:
  • Size: 239.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for reactor_runtime-2.7.4.tar.gz
Algorithm Hash digest
SHA256 2dfa9e93af364511fea4e7e47037a7a349f1dcbbfdd2e16a3324023a44df4c69
MD5 2e460da0a15e5f1c1a5c4499410c63a2
BLAKE2b-256 b9b7b2b1aa705e809fcce6373a1bc4c324932d25b01aa2838127595b0c92031a

See more details on using hashes here.

File details

Details for the file reactor_runtime-2.7.4-py3-none-any.whl.

File metadata

  • Download URL: reactor_runtime-2.7.4-py3-none-any.whl
  • Upload date:
  • Size: 302.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for reactor_runtime-2.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cff94ba221fc19bbc7398fd4f07c40a8aef55b9d9c6bb7533dbf4fb5fb5d4f94
MD5 5ee2edc9ce94c6b69ce05ae24b779d60
BLAKE2b-256 517b18e549dead359d349458c693faeb0cbad13c0dd1f252ca69215b1d36205a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page