> ## 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
> Reactor hosts multiple models, each with its own connect slug (modelName) and command/event schema. The catalog of every model — slug, typed SDK package, and links to its schema — is at /model-api-reference/overview. 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.

# reactor model deploy

> Activate a published release on the platform

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor model deploy [<model>:<release>] [flags]
```

## Description

Deploy (or roll back to) an already-published release.

The release must already exist - run `reactor model publish` first to
register the release tag and push the image (and optionally the weights).

**Use this command to:**

* Activate a freshly published release when it is ready for traffic.
* Roll back to an older release if the current one has issues.

**Weights:**

If the release has no weights of its own, the deploy reuses the most
recently deployed release's weights (server-side, no upload). When neither
the release nor any previously deployed release has weights, the deploy
still succeeds and prints a warning to upload them with
`reactor weights upload`.

**Workspace-aware:**

When run from a workspace (any directory under one containing a
`reactor.yaml`, stopping at the enclosing repository root) with no
positional argument, the model name and release tag are taken from the
file's `model.name` and `model.version` fields. An explicit
`<model>:<release>` on the command line can override the workspace
release tag - use it for rollbacks to an earlier release - but its `<model>`
part must match the workspace `model.name` or the command is rejected.

**Strategy:**

By default a deploy replaces instances one at a time, so the model keeps
serving throughout. `--strategy replace-all` signals the whole old generation
at once: an idle fleet turns over in seconds, and a busy one runs at reduced
capacity until the fresh instances finish loading. Under both, an instance
still serving a session keeps serving it until the session ends or the
instance's grace period runs out, which is up to five minutes in production.

**Immediate (emergency cutover):**

`--immediate` cuts that tail. After signalling the rollout, the platform
disconnects the model's live sessions so the new release takes over in
seconds instead of minutes. Reach for it when the running release must stop
serving now (a bad version, a safety problem), not for routine deploys.

It implies `--strategy replace-all` (spelling the strategy out is fine;
any other strategy is an error). It terminates whatever sessions are live
when the sweep runs, including ones that started during the deploy. Two
overlapping deploys, or a retry, each disconnect the then-live set.

Clients are told the model was redeployed where their session's release
supports it; on older releases they see a plain disconnect. Their sessions end
either way.

`--yes` skips the confirmation prompt for scripts and CI.

**Examples:**

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor model deploy                            # workspace: read name+version from reactor.yaml
reactor model deploy my-model:v1.0.0-gabc1234
reactor model deploy my-model:v0.9.0-gprevious  # roll back
reactor model deploy my-model:v1.0.0-gabc1234 --strategy replace-all
reactor model deploy my-model:v1.0.0-gabc1234 --immediate        # implies --strategy replace-all
reactor model deploy my-model:v1.0.0-gabc1234 --immediate --yes
```

## Options

| Flag                              | Description                                                                                                                             |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--immediate`                     | Disconnect live sessions instead of letting them finish (implies `--strategy` replace-all)                                              |
| `--strategy rolling\|replace-all` | Rollout strategy (default: rolling); replace-all cuts over the whole fleet at once, trading capacity until the new instances are loaded |
| `--yes`                           | Skip the `--immediate` confirmation prompt (for scripts / CI)                                                                           |

## Global options

| Flag              | Description                                                                           |
| ----------------- | ------------------------------------------------------------------------------------- |
| `--server string` | Reactor API server URL (default "[https://api.reactor.inc](https://api.reactor.inc)") |
| `-v, --verbose`   | Enable verbose output                                                                 |

## See also

* [reactor model](/deploy/cli-reference/reactor_model) - Model management commands
