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

# 模型

> 管理 base models，并部署已训练 LoRA models 用于 inference

Models 分为 **Base Models** 和 **LoRA Models**。Base models 是训练起点。LoRA models 是 training runs 产生的已训练 checkpoints；部署 LoRA model 后，即可通过 Osmosis inference serve 它。

LoRA model 生命周期统一在 `osmosis model` 命令组下：列出、查看、部署、停用都通过 LoRA model 名称操作。

## Base Models

Base models 从 [Hugging Face](https://huggingface.co) 导入，并作为在 Osmosis 上训练的起点。

### 受支持的 Base Models

我们当前支持：

| Model                    | Description                              |
| ------------------------ | ---------------------------------------- |
| `Qwen/Qwen3.6-35B-A3B`   | Qwen 3.6 35B，3B active parameters（MoE）   |
| `Qwen/Qwen3.5-122B-A10B` | Qwen 3.5 122B，10B active parameters（MoE） |

<Note>
  受支持模型列表会继续扩展。请查看平台 dashboard，或运行 `osmosis model list --type base` 获取最新可用 base models。
</Note>

### 列出 Base Models

```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis model list --type base
```

Base model 列表会显示 model name、creation date 和 creator。

## LoRA Models

LoRA models 是 training runs 产生的已训练 checkpoints。Models 页面会将它们与 base models 分开列出，并显示 training run、checkpoint step、training reward、creation date，以及您的账号可用 inference deployment 时的 deployment status。

### 查看 LoRA Models

列出 LoRA models：

```cli theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis model list --type lora
```

显示单个 LoRA model 的详情：

```cli theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis model info <lora-model-name>
```

Model 详情包含 base model、training run、checkpoint step、training reward、Hugging Face 导出状态，以及 deployment info 可用时的部署状态。

并排列出 base models 和 LoRA models：

```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis model list
```

当 deployment info 可用时，LoRA 部分还会显示 workspace 的部署配额汇总（例如 `2 of 5 inference deployments used`）。

### 部署 LoRA Model

训练任务完成后，先列出其 LoRA models 以选择要部署的一个：

```cli theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis model list --type lora
```

按名称部署 LoRA model：

```cli theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis model deploy <lora-model-name>
```

对 inactive 的 LoRA model 执行 `deploy` 会重新激活它。对 already-active 的 LoRA model 再次执行 `deploy` 是 no-op。

### 调用 Inference Endpoint

已部署的 LoRA models 通过 OpenAI-compatible chat completions endpoint 提供服务：

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
https://inference.osmosis.ai/v1/chat/completions
```

使用您的 Osmosis API key，以及 model detail 页面或 `osmosis model info` 提供的 canonical `model` 值。该 model 值格式为 `<base_model_path>:<lora-model-name>`。

```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
curl -X POST https://inference.osmosis.ai/v1/chat/completions \
  -H "Authorization: Bearer $OSMOSIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3.6-35B-A3B:my-run-step-100",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

<Note>
  如果您的账号不可用 inference deployment，deployment status、deployment quota 和 endpoint snippets 可能会被隐藏。
</Note>

### Undeploy

将 LoRA model 的部署切换为 inactive：

```cli theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/cli.json"]}}
osmosis model undeploy <lora-model-name>
```

该 LoRA model 仍会保留在训练任务历史中；`undeploy` 只会将 serving deployment 转为 inactive。`undeploy` 是幂等的 —— 对已处于 inactive 的 model 调用它是 no-op。

### 要求

* 在 workspace directory 中运行 model 命令，以便 CLI 可以从 Git `origin` 解析连接的 workspace。
* LoRA model 必须属于同一个 workspace 中的训练任务。
* 您的账号必须可用 inference deployment。部署 models 还需要 workspace billing 处于良好状态 —— self-serve workspaces 需绑定有效的 payment method。
* GitHub 设置必须健康，训练才能产出新的 LoRA models。

## 下一步

<CardGroup cols={2}>
  <Card title="数据集" icon="database" href="/zh/platform/datasets">
    上传并验证 evaluation runs 和 training runs 使用的数据集。
  </Card>

  <Card title="Training Runs" icon="play" href="/zh/platform/training-runs">
    提交训练任务并查看其 LoRA models。
  </Card>

  <Card title="Command Reference" icon="rectangle-list" href="/zh/cli/command-reference#model">
    查看 model 和 deployment 命令及选项。
  </Card>
</CardGroup>
