Metadata-Version: 2.4
Name: reflex-sdk
Version: 0.7.1
Summary: Python SDK for Reflex hosted robot inference and training
Author: Reflex
License: Proprietary
Project-URL: Homepage, https://tryreflex.ai
Project-URL: Repository, https://github.com/reflex-inc/reflex
Keywords: robotics,inference,training,sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML<7,>=6.0
Requires-Dist: typer<0.24,>=0.23; python_version < "3.10"
Requires-Dist: typer>=0.24.1; python_version >= "3.10"
Requires-Dist: urllib3<3,>=1.26
Requires-Dist: rich<15,>=13
Provides-Extra: webrtc
Requires-Dist: aiortc>=1.8; extra == "webrtc"
Requires-Dist: av>=11; extra == "webrtc"
Requires-Dist: msgpack>=1.0; extra == "webrtc"
Requires-Dist: numpy>=1.24; extra == "webrtc"
Requires-Dist: Pillow>=10; extra == "webrtc"
Provides-Extra: runpod-serverless
Requires-Dist: msgpack>=1.0; extra == "runpod-serverless"
Requires-Dist: numpy>=1.24; extra == "runpod-serverless"
Dynamic: license-file

# Reflex Python SDK

Public Python package for hosted Reflex training, datasets, managed instances,
and action inference.

```bash
python -m pip install reflex-sdk
```

The package installs the `reflex` Python module and a `reflex` CLI command in
the active Python environment. If your Python installer puts console scripts in
a directory that is not on `PATH`, use the module entry point instead:

```bash
python3 -m reflex --help
```

```python
import reflex
```

This package is intentionally separate from `inference/`, which owns model
serving and Prime worker runtime code.

## Running a robot session (`reflex connect`)

`reflex connect` runs a closed-loop robot session (observe → infer → apply),
fully described by a YAML config:

```bash
reflex login                       # or: export REFLEX_API_KEY=rfx_...
reflex connect --config robot.yaml
```

The config's `target:` block selects where inference runs (`kind:`):

| `kind` | Where inference runs | Notes |
| --- | --- | --- |
| `webrtc` | **Hosted Reflex cloud** (default) | Convex authorizes the session and routes it to a worker. A **MolmoAct2 model (`molmoact2-bimanualyam`) is already hosted and online**, so you can connect to cloud inference without deploying anything — just log in. |
| `edge` | **Your own HTTP server** on the LAN | Point `url` at a self-hosted inference server (e.g. a Jetson). No cloud/auth. |

```yaml
target:
  kind: webrtc          # hosted cloud inference (molmoact2-bimanualyam, already online)
  timeout_s: 60
  state_field: state
  instruction_field: prompt
  img_size: 256
hardware:
  kind: yam_bimanual
  config: { instruction: "fold the towel" }
```

### Choosing the cloud provider — RunPod serverless

Hosted sessions (`kind: webrtc`) default to Modal. To request routing to a
**RunPod serverless** node instead, add a `runtime` hint:

```yaml
target:
  kind: webrtc
  runtime: runpod-serverless   # route this hosted session to RunPod (QUIC)
```

The RunPod account key stays server-side (same trust model as Modal) — you only
need your Reflex API key. Convex routes to RunPod **when a RunPod node is
registered and available**, otherwise the session uses the default backend.
You can also set it via the environment: `REFLEX_RUNTIME=runpod-serverless`.

See `examples/` for full configs (`yam_bimanual_molmoact2_MODAL.yaml`, etc.).
To exercise `reflex connect` end to end **without a robot** (fake hardware +
synthetic cameras, against the offline/Modal/RunPod backends), see `sim/`.
