> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reactor.inc/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To build and serve your own model, start at /deploy/development/quickstart and /deploy/development/overview. Authenticate with reactor auth login, scaffold with reactor init, then run reactor deploy production from the workspace. Deploy builds remotely by default, creates a missing workspace project and its production environment, and waits for rollout. No local Docker or model.version bump is needed. Projects own images and weight sets; environments select the image, weights, GPU, instance count, and variables. Create staging explicitly with reactor environment create staging before deploying to it. Use reactor scale for capacity and reactor rollback for an earlier revision’s image and weights. See /deploy/platform/projects and /deploy/platform/deploy. Client SDK modelName remains account-qualified and selects production by default. Model code imports reactor_runtime; Python client code imports reactor_sdk. Local testing is optional; /deploy/development/local-testing covers reactor run, which needs Docker.
> Reactor hosts multiple models, each with its own connect slug (modelName) and command/event schema. The video model catalog — slug, typed SDK package, and links to its schema — is at /model-api-reference/overview. Robotics policy documentation starts at /robotics/overview; The launch policies are Cosmos Nano DROID (/robotics/cosmos/nano-policy-droid/), DreamZero DROID (/robotics/dreamzero/droid/), and FLUX Action DROID (/robotics/flux-action/droid/), organized by model family and embodiment. Some models expose one slug per experience (e.g. HappyOyster); always take the slug from the model's own pages, never guess it.
> Fastest path to a working app: `npx create-reactor-app my-app --model=<slug>` scaffolds a complete app with secure auth wired up. Typed TypeScript SDKs are published as @reactor-models/<model>; Python uses the base reactor-sdk package.
> Auth: exchange an API key (rk_...) for a JWT via POST https://api.reactor.inc/tokens from your server. Never put the API key in client-side code.
> Append .md to any docs URL for clean Markdown. Search these docs via the MCP server at https://docs.reactor.inc/mcp.

# Port Your Model

> Connect your inference code to Reactor, then deploy and test it.

Keep your existing inference code. Wrap it in a `ReactorApp` to receive client inputs and stream output.
Start with a model that already runs, its dependencies and weights, and an account with Serve and remote-build access.

## Create a workspace

[Install the CLI](https://docs.reactor.inc/deploy/platform/installation), then sign in and create a starter workspace:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor auth login
reactor init ported-model --runtime-version 3.11.7
cd ported-model
```

Copy your inference code into this folder and add its dependencies to `requirements.txt`.

## Connect your inference code

Replace the starter's rendering code in `model.py` with your model's loading and inference calls:

| Runtime interface | Your code |
| - | - |
| `load()` | Load the model once when the instance starts. |
| `InputState` | Declare values the client can change, such as a prompt. |
| `generate()` | Read those inputs and return the next frame or chunk. |
| `Output` | Declare the media tracks the client receives. |
| `@session_ended` | Clear generation history before another session starts. |

For a video model, return each chunk to the runtime instead of keeping a streaming loop inside `generate()`.
Set `fps` to the intended playback rate. Your inference code still controls how long each chunk takes to compute.

[Model anatomy](https://docs.reactor.inc/deploy/development/reactor-app/model-anatomy.md) shows these interfaces together in a working model.
For camera or microphone input, see [video and audio tracks](https://docs.reactor.inc/deploy/development/reactor-app/video-and-audio-tracks.md).

## Configure the model

Set the project name and Python class in `reactor.yaml`:

```yaml reactor.yaml (selected settings) theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
model:
  name: your-org/ported-model

runtime:
  import: model:MyModel
```

Replace `your-org` with your account or team slug and `MyModel` with your class name.
Remove the starter's `runtime.config` entry if your model doesn't use its configuration file.

Keep the generated runtime pin. Add the CUDA version and dependencies your inference code needs through the [build settings](https://docs.reactor.inc/deploy/platform/reactor-yaml.md#build).
Selecting a GPU at deployment doesn't add CUDA to the image.
Keep checkpoints outside the image; [Load your weights](https://docs.reactor.inc/deploy/development/weights.md) covers local folders and hosted sources.

## Deploy and test

From the workspace, deploy with hardware your model supports. For a model tested on one B200 with checkpoints in `weights/`:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor deploy production --gpu NVIDIA_B200x1 --desired 1 --weights ./weights
```

The CLI uploads the weights, builds remotely, and waits for rollout. No local Docker build is needed.
Your account needs an allocation for the chosen GPU; see [GPUs & Capacity](https://docs.reactor.inc/deploy/platform/gpu-capacity.md).

Once ready, connect a [test client](https://docs.reactor.inc/deploy/development/testing) to `your-org/ported-model`.
Update the client's controls to match your input fields and commands.
Check that output arrives, changes when you update inputs, and starts with fresh state in a new session.
A ready instance alone doesn't verify inference.

When finished, stop the instance:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor scale production --desired 0
```

For a complete video implementation, see [Deploy JoyAI video editing](https://docs.reactor.inc/deploy/development/video/joy-video-edit.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.