---
title: "opod model"
description: "Search the catalog, install models on the leader or on named workers, manage what is in engine memory, move a model between workers, and remove it."
url: "https://opod.io/docs/core-cli/model/"
markdown_url: "https://opod.io/docs/core-cli/model.md"
section: "Core CLI"
last_updated: "2026-10-30"
---

# opod model

> Search the catalog, install models on the leader or on named workers, manage what is in engine memory, move a model between workers, and remove it.

## In short

`opod model` finds, installs and removes models, and controls what the leader's engine holds in memory. `add --node` installs a model on named workers; `move` hands a model from one worker to another without a failed request. Run it on the leader host.

```bash
opod model add llama-3.2-3b --node n_abc123
```

```text
▶ placing llama-3.2-3b on n_abc123 (workers pull + load; this may take a few minutes)…
✔ placed llama-3.2-3b on n_abc123
```

## Usage

```text
opod model add ID [--force] [--dry-run] [--node a,b,c] [--from FILE.yaml]
opod model ls [--json]
opod model ps [--json]
opod model search [QUERY] [--sort=released] [--since YYYY-MM-DD] [--json]
opod model info ID [--json]
opod model load ID [--swap] [--pin] [--priority N]
opod model unload ID
opod model move ID --from NODE --to NODE
opod model remove ID [--yes]
```

Run these on the leader host. Each sub-command reaches the leader's state in one of three ways, and that decides whether it needs `opod up` running:

| Sub-command | Alias  | Path                                                          | Needs a running leader |
| ----------- | ------ | ------------------------------------------------------------- | ---------------------- |
| `add`       | —      | the local engine and the store; with `--node`, the admin API  | only with `--node`     |
| `ls`        | `list` | the store                                                     | no                     |
| `ps`        | —      | `GET /admin/v1/memory`                                        | yes                    |
| `search`    | —      | the catalog and the store                                     | no                     |
| `info`      | —      | the catalog and the store                                     | no                     |
| `load`      | —      | `POST /admin/v1/models/{id}/load`                             | yes                    |
| `unload`    | —      | `POST /admin/v1/models/{id}/unload`, else the engine directly | no                     |
| `move`      | —      | `POST /admin/v1/models/{id}/move`                             | yes                    |
| `remove`    | `rm`   | the local engine and the store                                | no                     |

The catalog these commands read is the merged one: the embedded entries plus your override directories. See [Catalog format](https://opod.io/docs/core-reference/catalog/).

## opod model add

Install a model.

| Flag               | Effect                                                                                                                                                    |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--force`          | Skip the hardware floor check (`hardware.min_ram_gb`, `min_vram_gb`). With `--node`, also replace the model a one-model engine is serving on that worker. |
| `--dry-run`        | Print the plan. Pull nothing and save nothing. `--dryrun` is the same. Not with `--node`.                                                                 |
| `--node a,b,c`     | Pull and load on these workers, through the leader. `--nodes` is the same; the flag may repeat.                                                           |
| `--from FILE.yaml` | Install from your own catalog entry (below).                                                                                                              |

Flags may come in any order. `ID` is a catalog id, or one of these scheme prefixes, which skip the catalog and the hardware check:

| Prefix    | Example                                                                               | Source                                                |
| --------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `hf:`     | `hf:bartowski/Phi-3-mini-GGUF`, `hf:bartowski/Phi-3-mini-GGUF:Phi-3-mini-Q4_K_M.gguf` | A Hugging Face repo, optionally `:FILE` for one file. |
| `ollama:` | `ollama:phi3:mini`                                                                    | An Ollama library tag. Needs the Ollama engine.       |
| `file:`   | `file:/models/my.gguf`                                                                | A GGUF already on disk.                               |

```bash
opod model add llama-3.2-3b
opod model add gpt-oss-120b --force
opod model add qwen3.6-27b --dry-run
opod model add hf:bartowski/Phi-3-mini-GGUF
opod model add --file ./my-model.yaml   # --from up to core v0.4.5
opod model add llama-3.2-3b --node n_abc123,n_def456
```

With no id, or an id that is not in the catalog, an interactive terminal opens a picker. With no terminal, it exits `opod: no model selected`.

### On the leader's own engine (no `--node`)

This path does not go through a running leader: the CLI talks to the configured engine and writes the store itself.

1. **Hardware floor.** It compares the entry's `min_ram_gb` with this machine's total RAM, and `min_vram_gb` with its largest GPU. On a machine with no discrete GPU (or Apple unified memory) only RAM is compared. A gap refuses:

   ```text
   opod: model gpt-oss-120b needs at least 80 GB RAM; this machine has 24 GB
     (override with `opod model add gpt-oss-120b --force` if you know what you're doing)
   ```

   An entry with no floor (every scheme id) only warns: `no hardware floor known for … — proceeding without check`.
2. **Source check.** It sends a `HEAD` to the upstream (the Ollama registry or Hugging Face), with a 5-second limit. A `404` refuses: `opod: source for … does not exist: …`. Any other failure only warns: `could not verify source for … (…) — proceeding anyway`. `OPOD_SKIP_SOURCE_CHECK=1` skips the check (air-gapped mirrors).
3. **Sharded?** An entry with `sharding.required: true` hands off to [`opod shard create`](https://opod.io/docs/core-cli/shard/) with no count, which picks one and needs the running leader.
4. **Engine match.** The entry's source type must suit the engine: `opod: source type "ollama" in … is not compatible with engine vllm — switch engines or use a different scheme prefix`.
5. **Pull** through the engine, with a progress bar, then a row in the store: `✔ installed: llama-3.2-3b`.

When the pull worked but the store write failed, it says `the weights for … are installed, but recording the … failed` and asks you to run `add` again once the store is healthy.

### On workers (`--node`)

```bash
opod model add llama-3.2-3b --node n_abc123
```

```text
▶ placing llama-3.2-3b on n_abc123 (workers pull + load; this may take a few minutes)…
✔ placed llama-3.2-3b on n_abc123
```

The CLI calls `POST /admin/v1/models` with `{"id", "nodes", "force"}`. The leader resolves the entry and calls each worker's `/v1/model/load`; the worker's engine pulls and loads it. Nothing is pulled on the leader. The model is routable once the worker's next heartbeat reports it loaded. The CLI waits up to 45 minutes.

A worker whose engine serves one model per process (vLLM, SGLang, llama.cpp, TensorRT-LLM) would stop what it serves. The leader refuses that and names both models; the CLI adds `(replace it on purpose with opod model add … --node … --force)`.

### Dry run

```bash
opod model add qwen3.6-27b --dry-run
```

```text
Dry-run plan for qwen3.6-27b
  Name          …
  Download size 17.0 GB
  Min RAM       24 GB
  License       apache-2.0
  Released      2026-03-22
  Engine        ollama (would pull "…")
  Engine status reachable
  Hardware      OK
  Source check  upstream exists
  ETA           ~5 min at 50 MB/s

No weights pulled. Run `opod model add qwen3.6-27b` to proceed.
```

`Hardware` reads `OK`, the gap with `— would refuse without --force`, or `no floor known`. `Source check` reads `upstream exists`, `NOT FOUND — install would refuse`, or `could not verify`. The ETA assumes 50 MB/s. A sharded entry shows the next step (`opod shard create …`) instead of an engine.

### From your own entry (`--from`)

```bash
opod model add --file ./my-model.yaml [--dry-run] [--force]   # --from up to core v0.4.5
```

1. Reads and parses the file. It needs `id:` and `source.type:` (`ollama`, `huggingface` or `file`), else it stops: ``…: missing `source.type:` field — set to ollama, huggingface, or file``.
2. Applies the signature policy (below) to the file as given.
3. With `--dry-run`, prints the plan and stops. Nothing is saved.
4. Copies the file to `~/.opod/catalog/<id>.yaml` (or to `catalog_dir` when `config.yaml` sets one), with its `.minisig` when there is one. An existing file of that name is not overwritten: it warns `… already exists — remove or rename it first` and installs once without saving.
5. Runs the install above. From then on the entry is like any catalog entry.

From core v0.4.6, `model add` names a catalog YAML with `--file` (in `model move`, `--from` is the source node), and `add --node` says `placing … — Ctrl-C stops waiting, not the pull`, prints `… still placing … (Ns)` every 10 s on stderr while the workers pull, and ends with `next: opod node show <node>`.

## opod model ls

```bash
opod model ls
```

```text
ID                     STATUS     SOURCE                         INSTALLED
llama-3.2-1b           ready      ollama:llama3.2:1b             2026-10-30T10:01:12Z
qwen-coder-7b          ready      ollama:qwen2.5-coder:7b        2026-10-30T10:20:40Z
```

The installed models in the store. `SOURCE` is `<engine>:<engine-native name>`. With none: ``(no models installed — try `opod model add llama-3.2-3b`)``. `--json` prints the rows with Go field names: `ID`, `CatalogID`, `Source`, `Status`, `SizeBytes`, `InstalledAt`.

A model placed on workers with `--node` is listed too, with `SOURCE` `node:<id>,<id>` (the workers named at placement time). What each worker actually holds is `opod node show ID` (`loadedModels`); what the cluster serves is `GET /v1/models`.

## opod model ps

What is resident in the **leader's own engine** memory right now. Calls `GET /admin/v1/memory`.

```text
MODEL                            RAM      VRAM PINNED  PRIO LAST USED
qwen-coder-14b                9.0 GB    9.0 GB pinned     2 2026-10-30 10:20
llama-3.2-1b                  1.3 GB    1.3 GB —          0 never

Memory: 10.3 GB resident of 19.2 GB budget (24.0 GB total RAM) · 8.9 GB free
Tip: `opod model load <id> --swap` evicts least-recently-used models to make room. `--pin` protects a model.
```

The budget is total RAM minus `placement.reserve_percent`. With `placement.exclusive: true` (or `opod up --exclusive`) the summary adds `exclusive mode`. Only Ollama reports residency; for any other engine it prints `(engine cannot report residency — memory view requires Ollama)`. `--json` prints the leader's answer as is: `supported`, `exclusive`, `total_ram_bytes`, `budget_bytes`, `resident_bytes`, `free_bytes`, and `resident[]` with `catalog_id`, `size_bytes`, `vram_bytes`, `pinned`, `priority`, `last_used`.

## opod model search

```bash
opod model search                # the whole catalog
opod model search coder          # text match
opod model search vision         # capability match: vision, embedding, tools, …
opod model search --sort=released
opod model search --since 2026-01-01
opod model search gguf --json
```

| Argument / flag      | Effect                                                                                                            |
| -------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `QUERY`              | Case-insensitive substring of the id, the display name, a capability or a tag. One word; a second is ignored.     |
| `--sort=released`    | Newest first. `--sort released` and `--sort-released` are the same. Entries with no date go last, smallest first. |
| `--since YYYY-MM-DD` | Only entries released on or after that day. Entries with no date are left out.                                    |
| `--json`             | The full entries, each with `installed`.                                                                          |

Without `--sort`, entries come smallest first. Any other flag is `opod: unknown flag: … (run opod model --help)`.

```text
ID                         NAME                                SIZE   RAM CAPABILITIES           RELEASED   INSTALLED
qwen-coder-7b              Qwen2.5 Coder 7B                  4.7 GB    8G chat,code,fim           2024-11-12 ✓
…

Tip: `opod model info <id>` for full details on one model. `opod model add <id>` to install.
```

From core v0.4.6, a search with no match says `no catalog model matches "X"` instead of printing an empty table; `--since` must be `YYYY-MM-DD` and `--sort` takes only `released`, each a usage error (exit `2`) otherwise.

## opod model info

```bash
opod model info qwen-coder-14b
opod model info qwen-coder-14b --json      # the catalog entry as JSON
```

Prints the entry: status (installed or not, and when), source and its URL, size, quantization, context window, RAM and VRAM floor, capabilities, recommended engines, tags, sharding, licence and its URL, release date, and the fallback chains (`Fallback`, `Fallback (context-length)`, `Fallback (content-policy)`). Then an install line and copy-paste use snippets: an embeddings `curl` for an embedding model, else a chat `curl`, an image example for a vision model, and the environment lines for an OpenAI-shape tool. The snippets use `http://localhost:8080` and `sk-orc-...`; `opod connect` prints them with your real URL and key.

From core v0.4.6 the snippets in `model info` use this host's real base URL (`OPOD_BASE_URL`, `external_url` or the listen address, as `opod connect` does) instead of a fixed `http://localhost:8080`, and a sharded model's install line is `opod shard create <id>` (it picks the part count).

## opod model load

Bring an installed model into the leader engine's memory now, under memory admission. Calls `POST /admin/v1/models/{id}/load` and waits up to 45 minutes.

| Flag           | Default | Effect                                                                                                                                  |
| -------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--swap`       | off     | Evict least-recently-used, non-pinned models to make room. Each is drained first and recorded.                                          |
| `--pin`        | off     | Exempt the model from eviction and from the engine's idle unload.                                                                       |
| `--priority N` | `0`     | Restore order on the next `opod up`, higher first. `--swap` evicts lower priorities first. A value that is not a number is read as `0`. |

```text
▶ evicted llama-3.2-1b (freed 1.3 GB)
✔ loaded qwen-coder-14b (pinned — exempt from eviction and idle TTL)
```

A model that is already resident only has its desired placement updated: `✔ … is already resident — desired placement updated (pin=true)`. Loaded and pinned models are restored, by priority, on the next `opod up`.

Refusals:

| `error.type`        | What the CLI prints                                                                                                              |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `needs_swap`        | The reason, each model `--swap` would evict with its size, then `rerun with opod model load … --swap to accept the eviction(s)`. |
| `blocked_by_pinned` | The reason, and a pointer to `opod model ps` and to unpinning.                                                                   |
| `impossible`        | The reason: the model does not fit even with everything else evicted.                                                            |

Any other flag is `opod: unknown flag: …`.

## opod model unload

```bash
opod model unload llama-3.2-3b
```

Through the running leader, it drains the model's in-flight requests, then drops it from engine memory: `✔ unloaded llama-3.2-3b (drained, weights still on disk; stays unloaded across restarts)`. The weights stay on disk, and the model is not restored on the next `opod up`. When the engine has no unload call, the leader answers "noop" and the CLI warns `… — restart the engine to free RAM`.

With no leader answering, the CLI asks the engine directly (10-second limit), with no drain: `✔ unloaded … from ollama (weights still on disk)`. An engine with no online unload (vLLM, MLX-LM) gets the warning `… does not support online unload — restart the engine to free RAM`.

From core v0.4.6, `model load` and `model unload` also accept a model id the leader lists (a model placed only on workers), `model ps --json` refuses an answer that is not JSON instead of passing it through, and `model remove` says when the engine kept the weights (`removed X from the store, but ollama did not delete its weights … — delete them with ollama rm …`) instead of printing `removed`.

## opod model move

```bash
opod model move llama-3.2-3b --from n_abc123 --to n_def456
```

Another worker takes over a whole model by overlap, so no request fails. All three arguments are required, and one model at a time. It needs the running leader and waits up to 45 minutes.

```text
▶ moving llama-3.2-3b from n_abc123 to n_def456: the target loads it while n_abc123 keeps serving (a cold target downloads the weights first — this can take a while)…
  10:20:01  started  admitted; loading on the target, the source keeps serving
  10:21:37  loaded   the target serves the model — both workers take requests
  10:21:37  flipped  the source is out of rotation: new requests go to the target
  10:21:39  drained  nothing is in flight on the source
  10:21:40  finished the source unloaded the model
✔ llama-3.2-3b is now served by n_def456; n_abc123 let it go
▶ no KV cache moved: a conversation n_abc123 was serving recomputes its prompt on n_def456 at its next turn
```

| Step       | Meaning                                                                                                               |
| ---------- | --------------------------------------------------------------------------------------------------------------------- |
| `started`  | Admitted. The target loads the model; the source keeps serving. When the target already serves it, nothing is loaded. |
| `loaded`   | The target serves the model. Both workers take requests.                                                              |
| `flipped`  | The source is out of rotation for this model.                                                                         |
| `drained`  | Nothing is in flight on the source, or the drain timed out with N requests left.                                      |
| `finished` | The source unloaded the model.                                                                                        |
| `aborted`  | The move stopped, with the reason and the state it left. A target that never serves leaves the source serving.        |

The leader refuses a move up front when it cannot work: the target cannot hold the model beside what it has, runs a one-model engine that serves something else, or takes no new work; the source does not hold the model, or serves adapters of it; the model is sharded. The steps are also events (`model.move_*`). See [Clusters](https://opod.io/docs/core/clusters/#move-a-model-to-another-worker).

| Error                                                                    | Cause                   |
| ------------------------------------------------------------------------ | ----------------------- |
| `opod: a model id, --from and --to are all required`                     | A missing argument.     |
| `opod: one model at a time: got "a" and "b"`                             | Two ids.                |
| `opod: --from needs a node id`                                           | `--from` with no value. |
| `… a move needs the running leader — start it with opod up on this host` | No leader answered.     |

## opod model remove

```bash
opod model remove llama-3.2-3b        # asks: Remove installed model "llama-3.2-3b"? Weights will be deleted from disk. (y/N)
opod model remove llama-3.2-3b --yes  # -y is the same
```

It asks the local engine to delete the model (a failure only warns and goes on), deletes the store row and forgets the leader's desired placement for it, so the next `opod up` does not try to restore it: `✔ removed: llama-3.2-3b`. This path writes the store directly; it does not go through a running leader. With no terminal on stdin and no `--yes`, it exits `opod: aborted`. An id that is not installed opens the picker on a terminal.

## Interactive picker

`add`, `info`, `remove`, `load` and `unload` with no id, or an id that is not in the catalog (`add`, `info`) or not installed (`remove`, `load`, `unload`), open a picker on an interactive terminal. With no terminal they exit `opod: no model selected`.

## Catalog signatures

With `OPOD_CATALOG_PUBKEY` set (a minisign public key, or a file that holds one), a catalog file that has `FILE.minisig` beside it must verify — for `--from` and for every catalog directory — and one that does not is refused. `OPOD_CATALOG_REQUIRE_SIGNED=1` refuses unsigned files too. The embedded catalog is never checked. A verified `--from` file prints `✔ signature verified against key …`.
