> ## 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.

# Deploy Cosmos3 Policy DROID

> Deploy NVIDIA's Cosmos3 Edge robot policy to a production environment and receive action chunks with a Python client.

Deploy [NVIDIA's Cosmos3 Edge Policy DROID](https://github.com/reactor-team/reactor-cookbook/tree/main/models/cosmos3-policy-droid)
on 1 B200 and test it with a Python client. This example targets a Franka Panda arm with a Robotiq 2F-85 gripper.

<video controls playsInline preload="metadata" poster="/images/cosmos3-policy-droid/nvidia-droid-simulation-poster.jpg" aria-label="NVIDIA Cosmos3 DROID robot simulation showing a banana being placed in a bowl">
  <source src="https://mintcdn.com/reactortechnologiesinc/AFS5VXMUwc0tUo4V/images/cosmos3-policy-droid/nvidia-droid-simulation.mp4?fit=max&auto=format&n=AFS5VXMUwc0tUo4V&q=85&s=463f366778650c83c63a3a6d798339b3" type="video/mp4" />

  Your browser does not support embedded video.
</video>

NVIDIA's Cosmos3 DROID policy demo: placing a banana in a bowl in simulation.

| Item | Value |
| - | - |
| Model | NVIDIA Cosmos3-Edge-Policy-DROID, 4B parameters, [OpenMDW 1.1 license](https://huggingface.co/nvidia/Cosmos3-Edge-Policy-DROID#license) |
| Deployment GPU | 1 NVIDIA B200 |
| Inputs | 3 camera views, 7 arm joint positions, 1 gripper position, and a task instruction |
| Output per chunk | 32 actions, each with 7 absolute joint-position targets and 1 gripper value |
| Action execution rate | 15 Hz |
| Reference inference time | About 210 ms per chunk after warmup on 1 B200, as reported in the [cookbook](https://github.com/reactor-team/reactor-cookbook/tree/main/models/cosmos3-policy-droid#cosmos3-policy-droid) |

## What the model does

The model is a robot policy. It reads 3 camera views, the joint and gripper positions of the arm, and a task instruction.
It returns the next 32 actions for the arm.

### Inputs and output

![The client sends 3 video tracks (wrist\_view, exterior\_view\_1, exterior\_view\_2) and 3 commands (set\_task\_description, set\_proprio\_json, set\_executed\_step\_json) to the robot policy on Reactor. The policy sends back the action\_prediction message.](https://mintcdn.com/reactortechnologiesinc/AFS5VXMUwc0tUo4V/diagrams/cosmos3-inputs-outputs.svg?fit=max\&auto=format\&n=AFS5VXMUwc0tUo4V\&q=85\&s=76c1e7b4f5c5fcabde1ece62bcf6522b)

The client sends:

* Video from 3 cameras, on the tracks `wrist_view`, `exterior_view_1`, and `exterior_view_2`.
* The task, with `set_task_description`. For example: "Put the banana in the bowl."
* The robot state, with `set_proprio_json`: 7 joint positions in radians and the gripper position.
* The executed step, with `set_executed_step_json`. Each chunk the model sends has a `step` number. When the robot
  finishes running a chunk, the client sends that `step` number back. This tells the model that the robot moved, so it
  can predict the next chunk from the new camera views and robot state.

The model sends one `action_prediction` message per chunk. `step` numbers the chunks from `0`. `action` holds 32
rows. Each row has 7 absolute joint-position targets in radians, then 1 gripper command. The rows are for
execution at 15 Hz, so one chunk covers about 2.1 seconds of motion.

### When the model predicts

The model and the robot take turns. The model predicts a chunk, the robot runs it, and the client reports the result.
Only then does the model predict the next chunk:

![Sequence diagram. The client sends the task, robot state, and camera frames. The model sends action chunk step 0. The robot runs the actions. The client sends the new robot state and camera frames, then executed step 0. The model waits for new camera frames, then sends action chunk step 1. This repeats for every chunk.](https://mintcdn.com/reactortechnologiesinc/AFS5VXMUwc0tUo4V/diagrams/cosmos3-prediction-sequence.svg?fit=max\&auto=format\&n=AFS5VXMUwc0tUo4V\&q=85\&s=eb52757c8d51daa37b15e5084726a43f)

* **First chunk:** the model predicts it when it has a valid robot state and a frame from each camera.
* **Next chunks:** the model predicts each one after it gets the executed step and a new frame from each camera. The new
  frames show the robot after it moved.
* **Reset:** `reset` starts the loop again at step `0`.

[Model walkthrough](https://docs.reactor.inc/deploy/development/robotics/cosmos3-policy-droid/model-walkthrough.md#check-the-inputs) has the code for these checks.

## Requirements

* A Reactor account with Serve access, [remote builds](https://docs.reactor.inc/deploy/platform/build.md), and capacity for 1 B200 instance.
* The latest Reactor CLI.
* Git, Python 3.12, and [uv](https://docs.astral.sh/uv/getting-started/installation/) for the test client.
* An [API key](https://reactor.inc/account/api-keys) for the account that owns the project.

The deployment and client test need no local Docker or GPU. The weights are public.
Read the [model card](https://huggingface.co/nvidia/Cosmos3-Edge-Policy-DROID) for its license and intended use.

## Project structure

The model lives in one folder of the cookbook:

```text models/cosmos3-policy-droid/ theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
models/cosmos3-policy-droid/
├── reactor.yaml                    # How Reactor builds and serves the model
├── requirements.txt                # Python dependencies
├── cosmos3_policy_droid.yaml       # Checkpoint, NVIDIA source revision, sampler settings
├── cosmos3_policy_droid.py         # Model class: tracks, commands, prediction loop
├── cosmos3_policy_droid_types.py   # Declares the tracks, commands, and action message
├── cosmos3_policy_droid_model.py   # The policy: load the weights, predict 1 chunk
├── cosmos3_policy_droid_assets.py  # Downloads the NVIDIA source and checkpoint
└── tests/                          # Tests that run without a GPU
```

[`reactor.yaml`](https://github.com/reactor-team/reactor-cookbook/blob/main/models/cosmos3-policy-droid/reactor.yaml)
tells Reactor which class to serve and how to build its image. These are its main settings:

```yaml reactor.yaml (main settings) theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
model:
  name: your-org/cosmos3-policy-droid              # Set this: replace your-org with your account slug

runtime:
  import: cosmos3_policy_droid:Cosmos3PolicyDroid  # The model class to serve
  config: cosmos3_policy_droid.yaml                # The file that load() reads

build:
  runtime_version: "3.5.0"                         # Reactor Runtime version
  python_version: "3.13"                           # Matches the prebuilt attention kernels
  cuda_version: "12.8.1"
  python_requirements: requirements.txt
  system_packages:
    - git                                          # load() clones the NVIDIA source
```

The full file also sets the package index and environment variables that the build needs. Deploy it unchanged, except
for the name.

`reactor deploy` takes the model through 3 stages:

* **Build:** the remote build waits for a worker, installs Reactor Runtime and the Python dependencies, and creates the image.
* **Promote image:** Reactor copies and records the image for deployment. This can take several minutes after build output stops.
* **Start model:** an instance pulls the image and calls `load()`. The model downloads missing source and weights, loads the checkpoint, and runs warmup.

[Model walkthrough](https://docs.reactor.inc/deploy/development/robotics/cosmos3-policy-droid/model-walkthrough.md) explains each file and the prediction step.

## 1. Prepare the project

Install the CLI:

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
curl -fsSL https://reactor.inc/install | bash
```

Sign in, clone the cookbook, and open the model workspace:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor auth login
git clone https://github.com/reactor-team/reactor-cookbook.git
cd reactor-cookbook/models/cosmos3-policy-droid
```

In `reactor.yaml`, set `model.name` to your account-qualified project name. Replace `your-org` with your account slug:

```yaml reactor.yaml (model name only) theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
model:
  name: your-org/cosmos3-policy-droid
```

## 2. Deploy the policy

![Deployment lifecycle: build the image, promote it for deployment, start the model on 1 B200, then become ready for clients. Scaling production to zero stops the GPU instance.](https://mintcdn.com/reactortechnologiesinc/AFS5VXMUwc0tUo4V/diagrams/cosmos3-deployment.svg?fit=max\&auto=format\&n=AFS5VXMUwc0tUo4V\&q=85\&s=5b27c49839995681752918d9c6f3d5f9)

Choose a region where your account has a B200 allocation. For example, if your allocation is in `us-west`:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor deploy production \
  --gpu NVIDIA_B200x1 \
  --desired 1 \
  --require-regions us-west
```

Replace `us-west` with your allocated region. Selecting a region does not grant capacity.
If deployment reports `no 'NVIDIA_B200' allocation`, check your [account capacity](https://docs.reactor.inc/deploy/platform/gpu-capacity.md#check-account-capacity) or contact Reactor.

The CLI creates the project if needed, builds the image remotely, and deploys 1 B200 instance.
On startup, the model downloads any missing source and weights, loads the weights, and runs warmup.
The CLI waits for the deployment to report `ready`.

Follow build and promotion progress in the deploy terminal. Once rollout starts, check the instance from another terminal in the model workspace:

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

Status shows phases such as `pulling_image`, `loading`, and `ready`. Once an instance exists, follow its startup logs:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor logs production --follow
```

Empty runtime logs during build or image promotion are expected. Those stages happen before the model starts.

## 3. Test the deployment

The test client is in the `robotics/sim/notebooks` folder of the cookbook:

```text robotics/sim/notebooks/ theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
robotics/sim/notebooks/
├── pyproject.toml            # Client dependencies, installed by uv sync
├── first_cosmos_actions.py   # The test: sends 1 observation, checks 1 action chunk
├── reactor_robotics/
│   ├── session.py            # ReactorSession: connects and publishes the camera tracks
│   └── cosmos_droid.py       # Cosmos helpers: track names and encode_proprio()
└── ...                       # Clients for other robot policies
```

`reactor auth login` signs the CLI in for deployment commands. The Python client needs a separate API key.
Create a key in [API keys](https://reactor.inc/account/api-keys) under the account that owns your deployment.

From the model workspace, install the client dependencies. Export the key and project name in the same terminal where you run the client:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
cd ../../robotics/sim/notebooks
uv sync --frozen --python 3.12
export REACTOR_API_KEY='YOUR_API_KEY'
export REACTOR_MODEL='your-org/cosmos3-policy-droid'
```

`REACTOR_MODEL` identifies the project for the cleanup and log commands below. Sessions use production by default.

Set the same project name in
[`first_cosmos_actions.py`](https://github.com/reactor-team/reactor-cookbook/blob/main/robotics/sim/notebooks/first_cosmos_actions.py)
by replacing `reactor/cosmos-nano-policy-droid`:

```python first_cosmos_actions.py (session setup) theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
    session = ReactorSession(
        "your-org/cosmos3-policy-droid", fps=15, frame_size=(180, 320)
    )
```

Run the test:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
uv run python first_cosmos_actions.py
```

The script checks that chunk `0` holds a `(32, 8)` array of finite values. Then it prints the shape, the first action,
and the time from request to reply, and closes the session:

```text Expected output theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
actions: (32, 8)
first step: [8 values]
request-to-reply ms: <time>
```

The test sends synthetic camera frames and robot state, so it checks the message flow from your client to the deployment
and back.

### What the client sends

The script connects the 3 camera tracks and subscribes to `action_prediction`.
It then sends a task, synthetic camera frames, and sample joint and gripper positions:

```python first_cosmos_actions.py (simplified) theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await session.connect(TRACKS, subscribe=("action_prediction",))
await session.send("set_task_description", {"task_description": "Put the banana in the bowl."})
session.set_frames({name: np.zeros((180, 320, 3), dtype=np.uint8) for name in TRACKS})
proprio = encode_proprio([0.0, -0.5, 0.0, -2.0, 0.0, 1.5, 0.0], 0.0)
await session.send("set_proprio_json", {"proprio_json": proprio})
```

`ReactorSession` publishes the frames at the configured 15 fps. `encode_proprio()` formats the robot state as JSON.

`proprio_json` contains a JSON string. Decoded, the state sent by this script looks like this:

```json Robot state inside proprio_json theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
{
  "joint_position": [[0.0, -0.5, 0.0, -2.0, 0.0, 1.5, 0.0]],
  "gripper_position": [[0.0]]
}
```

Both fields contain lists of rows, even for a single observation. Joint positions are in radians.
`encode_proprio()` creates this structure and serializes it for the command.

### Check the response

The script waits for the first `action_prediction` message, checks it, and prints it:

```python first_cosmos_actions.py (simplified) theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reply = await session.next_message("action_prediction")
actions = np.asarray(reply["action"])
assert reply["step"] == 0 and actions.shape == (32, 8)
print("actions:", actions.shape)
print("first step:", actions[0])
```

`step` identifies the chunk. `action` holds 32 rows. Each row has 7 absolute joint-position targets and 1 gripper value.

### What gets validated

The model checks whether it has the inputs needed to predict. The client test checks the returned message:

| Check | Behavior |
| - | - |
| Robot state | The model parses `proprio_json` into rows of 7 joint values and 1 gripper value. It predicts when every value is present and finite. |
| Camera frames | The model waits for a fresh frame on each of the 3 tracks. |
| Execution feedback | After the first prediction, the model waits for an executed step greater than the last one it accepted. A repeated step is ignored. |
| Action response | The test asserts step `0`, exactly 32 rows of 8 values, and no NaN or infinity. |

Passing the test confirms the message format and the first prediction. [Connect a simulator](#connect-a-simulator) runs the
full feedback loop. Before you execute actions on hardware, check them against the joint, motion, and gripper limits of
the robot.

## 4. Stop the deployment

Closing the client leaves the GPU instance running. Stop it from the same directory:

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

The command waits for the change and prints the status. Your project and image remain available.

> [accordion] Troubleshoot deployment or client errors
>
> From the client directory, inspect startup or prediction errors:
>
> ```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
> reactor logs production -p "$REACTOR_MODEL" --follow
> ```
>
> | Symptom | What to check |
> | - | - |
> | No GPU capacity | Your account needs Serve access and B200 capacity. |
> | Startup fails | Check the logs for source or checkpoint download errors. Keep the default asset cache. Do not pass an empty directory with `--weights`. |
> | The client cannot connect | Use an API key from the account that owns the project. Check the project name in `first_cosmos_actions.py`. |
> | No first action chunk | Wait for readiness and check that all 3 camera tracks and valid robot state reach the model. |

## Understand the feedback loop

> [accordion] Request another action chunk (optional)
>
> The test stops after one chunk. In a robot integration, request the next chunk after executing actions:
>
> 1. Send updated robot state with `set_proprio_json`.
> 2. Send the `step` of the chunk you executed with `set_executed_step_json`.
> 3. Keep all 3 camera tracks publishing fresh frames after that.
>
> Each executed step must be greater than the last one the model accepted.
> This model uses its own flow control, not Reactor stepped-generation mode.
>
> [Model walkthrough](https://docs.reactor.inc/deploy/development/robotics/cosmos3-policy-droid/model-walkthrough.md#check-the-inputs) shows the code that
> applies these checks.
>
> See the cookbook's
> [client contract](https://github.com/reactor-team/reactor-cookbook/tree/main/models/cosmos3-policy-droid#client-contract)
> for command payloads and frame timing.

### Change the task

In a connected session, send `set_task_description` to change the instruction:

```python Client (before closing the session) theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
await session.send(
    "set_task_description",
    {"task_description": "Open the drawer."},
)
```

The new instruction applies to the next prediction and keeps the step counter. The next chunk still comes after the next
executed step and new camera frames.
Send updated observations and execution feedback as shown above. Keep task instructions within the contract's 300-character limit.

## Connect a simulator

The first action chunk confirms that your deployed policy can receive observations and return actions.
The next step is to close the loop: execute those actions in a simulation, send the resulting camera views
and robot state back to the model, and request the next chunk.

The Cosmos DROID simulator provides that loop. Follow its setup instructions for Isaac Sim and an RTX-class GPU.
If you scaled the deployment to zero, start it again before connecting:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor scale production --desired 1 -p "$REACTOR_MODEL"
```

Pass `--model "$REACTOR_MODEL"` to the simulator gateway to use your deployment.
Start with a task, watch the robot respond, and try a new instruction in the same session.

> [card] [Run the policy in simulation](https://github.com/reactor-team/reactor-cookbook/tree/main/robotics/sim/cosmos-droid)
>
> Connect the simulator to your model and test the full observation → action → feedback loop.


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