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

# sf model

> Manage the model registry

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf model register alice/support-agent --run run-4f2a91 --version 3
sf model ls
sf model promote alice/support-agent@3
```

模型注册表：一条比产出它的 run 活得更久的命名版本线。

run id 是关于某次实验的事实。模型版本是一个决定——这一个是我们愿意拿去服务的。
注册把前者变成后者，之后下游的一切（部署、Playground、验收卡）引用的都是版本而不是 run。

| 命令                  | 什么时候用                        |
| ------------------- | ---------------------------- |
| `sf model register` | 某次 run 产出了值得留下的东西            |
| `sf model promote`  | 这个版本就是生产该用的那个                |
| `sf model card`     | 查看或导出验收卡——它是凭什么上线的，在上线那一刻被冻结 |
| `sf model archive`  | 把一个版本撤出流通，但不删它的历史            |
| `sf model ls`       | 有哪些模型和版本，哪个版本被推广了            |

完整流程见[模型注册表](/zh-Hans/guides/model-registry)。

## `sf model`

Manage the model registry

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf model <subcommand>
```

| 命令                  | 说明                                   |
| ------------------- | ------------------------------------ |
| `sf model archive`  | Archive one version                  |
| `sf model card`     | Show or export the acceptance card   |
| `sf model ls`       | List models and their versions       |
| `sf model promote`  | Promote one version to production    |
| `sf model register` | Record a run's artifact as a version |

### `sf model archive`

Archive one version

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf model archive <MODEL> <VERSION>
```

| 参数        | 说明                                   |
| --------- | ------------------------------------ |
| `MODEL`   | Model id (\<owner>/\<name>) (**必填**) |
| `VERSION` | Version number (**必填**)              |

除 `--help` 外没有其他选项。

### `sf model card`

Show or export the acceptance card

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf model card <MODEL> <VERSION> [options]
```

| 参数        | 说明                                   |
| --------- | ------------------------------------ |
| `MODEL`   | Model id (\<owner>/\<name>) (**必填**) |
| `VERSION` | Version number (**必填**)              |

| 选项         | 说明                                      |
| ---------- | --------------------------------------- |
| `--export` | Write the card as Markdown to this path |

### `sf model ls`

List models and their versions

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf model ls [MODEL]
```

| 参数      | 说明                                                 |
| ------- | -------------------------------------------------- |
| `MODEL` | Model id (\<owner>/\<name>); omit to list them all |

除 `--help` 外没有其他选项。

### `sf model promote`

Promote one version to production

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf model promote <MODEL> <VERSION>
```

| 参数        | 说明                                   |
| --------- | ------------------------------------ |
| `MODEL`   | Model id (\<owner>/\<name>) (**必填**) |
| `VERSION` | Version number (**必填**)              |

除 `--help` 外没有其他选项。

### `sf model register`

Record a run's artifact as a version

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf model register <MODEL> [options]
```

| 参数      | 说明                                                                           |
| ------- | ---------------------------------------------------------------------------- |
| `MODEL` | Model name (lands in your own namespace) or a full \<owner>/\<name> (**必填**) |

| 选项              | 说明                                                              |
| --------------- | --------------------------------------------------------------- |
| `--run`, `-r`   | Register from this run's hf\_export artifact                    |
| `--path`        | Record a weights path directly (a base model, external weights) |
| `--notes`, `-n` | What changed in this version                                    |
| `--desc`        | Model description (write it on the first registration)          |
