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

> Build, push, and prepare a model release for deployment

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

## Description

Publish a release of a model - image + weights, all in one command:

1. registers the release tag (idempotent),
2. mints short-lived ECR push credentials,
3. builds the image (or loads `--source`) and pushes to the partner slot,
4. records the digested image ref on the server,
5. optionally uploads weights (see `--weights` below).

**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, so you can simply type
`reactor model publish`. An explicit `<name>:<release>` on the command line
can override the workspace release tag, but its `<name>` part must match the
workspace `model.name` or the command is rejected.

**Image source (step 3):**

The image is built from reactor.yaml's `build:` block, with the
Dockerfile generated in memory and never written to the workspace.
A Dockerfile on disk takes the build over: the workspace ./Dockerfile is
built verbatim when it exists, `-f`/`--dockerfile` builds an explicit path,
and either way reactor.yaml's build fields are ignored with a stderr note
naming them. `--no-dockerfile` builds from reactor.yaml even when a
./Dockerfile exists, and is mutually exclusive with `-f`. `--source` skips
the build entirely and loads an existing image.

`--build-secret` supplies a build secret (id=\<id>,env=\<var> grammar -
see `reactor build --help`); required whenever the Dockerfile
(on-disk or generated) declares a secret mount, such as a build.run hook
with one. Ignored with `--source`.

**Weights (step 5):**

* `--weights <path>`: Upload weights from this file or directory for this release. Without it, the weights step is skipped and `reactor model deploy` reuses the previously deployed release's weights (upload new ones later with `reactor weights upload` if they changed).
* `--force`: Re-upload weights even when the target release already has a matching bundle on the server (only meaningful with `--weights`).

**Examples:**

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor model publish                            # workspace: read name+version from reactor.yaml
reactor model publish my-model:v1.0.0-gabc1234
reactor model publish my-model:v1.0.0 --source my-org/my-image:v1.0.0
reactor model publish my-model:v1.0.0 -f infra/Dockerfile.runtime
reactor model publish my-model:v1.0.0 --no-dockerfile # ignore the on-disk ./Dockerfile
reactor model publish my-model:v1.0.0 --weights ./checkpoints/
reactor model publish my-model:v1.0.0 --weights ./checkpoints/ --force
reactor model publish my-model:v1.0.0 --dry-run
```

## Options

| Flag                         | Description                                                                                                                                                                                   |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--build-secret stringArray` | Build secret, id=\<id>,env=\<var>\|src=\<path> (repeatable; e.g. id=github\_token,env=GITHUB\_TOKEN). Ignored with `--source`.                                                                |
| `-f, --dockerfile string`    | Path to an explicit Dockerfile (relative to the build context = cwd); defaults to the workspace ./Dockerfile when one exists                                                                  |
| `--dry-run`                  | Print the resolved plan and exit; no side effects                                                                                                                                             |
| `--force`                    | Re-upload weights even when the target release already has a matching bundle on the server                                                                                                    |
| `--no-dockerfile`            | Build from reactor.yaml, ignoring an on-disk Dockerfile                                                                                                                                       |
| `--no-register`              | Fail if the model is not already registered, instead of auto-creating it from the workspace reactor.yaml (publish registers on miss by default)                                               |
| `--platform string`          | Target build platform (default linux/amd64). Overrides build.platform in reactor.yaml; an explicit 'FROM `--platform`=' in the Dockerfile still wins for that stage. Ignored with `--source`. |
| `--source string`            | Use an existing image reference instead of building from a Dockerfile                                                                                                                         |
| `--weights string`           | Path to a weights file or directory to upload for this release (omit to reuse the previously deployed release's weights at deploy time)                                                       |
| `--workers int`              | Parallel workers for bundle hashing and per-file uploads during the weights step (default 4)                                                                                                  |

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