Metadata-Version: 2.4
Name: reactor_runtime
Version: 2.4.0
Summary: Reactor runtime with public model API
Author-email: Reactor <team@reactor.inc>
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: omegaconf>=2.3.0
Requires-Dist: av>=14.0.0
Requires-Dist: aiortc>=1.14.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn[standard]>=0.23.0
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: redis
Requires-Dist: jsonschema>=4.20.0
Requires-Dist: opentelemetry-api~=1.39
Requires-Dist: opentelemetry-sdk~=1.39
Requires-Dist: opentelemetry-exporter-otlp-proto-http~=1.39
Requires-Dist: opentelemetry-exporter-prometheus~=0.60b0
Requires-Dist: grpcio>=1.60.0
Requires-Dist: grpcio-health-checking
Requires-Dist: opentelemetry-instrumentation-grpc~=0.60b0
Provides-Extra: gst
Requires-Dist: PyGObject>=3.40.0; extra == "gst"

# 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

```bash
pip install reactor-runtime
```

## Quick Example

```python
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** — `reactor init` creates a project; `reactor run` starts it locally
