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

# 运行 Ollaya

用 [Ollaya](https://gitee.com/ariacompute/ollaya) 在本地运行 AFM-D 决策模型：安装、拉取 afm-de / afm-dd、运行预设、调用 /api/decide，或者作为 System One 守护进程常驻。

[Ollaya](https://gitee.com/ariacompute/ollaya) 以类似 Ollama 的方式在本地运行**开放决策模型**：读取文本或 JSON **状态**与类型化问题（`choice` / `score` / `noul`），一次前向传播返回校准概率，从不生成对话文本。AFM-D 检查点可通过目录名拉取：`afm-de`（Encoder）、`afm-dd`（Decoder）。权重来自 Hugging Face（`ariacompute/*`）或 ModelScope（`AriaCompute/*`）。需要中国镜像时设置 `OLLAYA_HUB`。

## 安装

从 **[Gitee Releases](https://gitee.com/ariacompute/ollaya/releases)** 下载对应平台发行包，解压并将 `ollaya` 加入 `PATH`。

## Ollaya CLI

先拉取 checkpoint，然后运行预设，也可以直接通过 HTTP 调用守护进程。

**Encoder（`afm-de`）**

```bash theme={null}
ollaya pull afm-de
ollaya run afm-de --preset triage "这个月订阅被扣了两次，我要退款。"
curl -s http://localhost:11435/api/decide \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "afm-de",
  "state": "这个月订阅被扣了两次，我要退款。",
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "由哪个团队处理？",
      "criteria": {
        "billing": "支付、发票与退款",
        "technical": "缺陷、错误与故障",
        "account": "登录、资料与设置"
      }
    },
    "refund": {
      "type": "noul",
      "instructions": "客户是否在申请退款？"
    }
  }
}'
```

**Decoder（`afm-dd`）**

```bash theme={null}
ollaya pull afm-dd
ollaya run afm-dd --preset triage "这个月订阅被扣了两次，我要退款。"
curl -s http://localhost:11435/api/decide \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "afm-dd",
  "state": "这个月订阅被扣了两次，我要退款。",
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "由哪个团队处理？",
      "criteria": {
        "billing": "支付、发票与退款",
        "technical": "缺陷、错误与故障",
        "account": "登录、资料与设置"
      }
    },
    "refund": {
      "type": "noul",
      "instructions": "客户是否在申请退款？"
    }
  }
}'
```

请求体和 `POST /v1/systemone` 是同一套 **System One** 形态：一个 `state` 加类型化 `questions`。Ollaya 用 `model` 字段指定模型，守护进程默认监听 `http://localhost:11435`。

## 守护进程

用 `ollaya serve` 常驻运行。Ollaya 提供兼容 System One 的 `POST /api/decide` 接口，默认监听 `http://localhost:11435`，已有的 System One 客户端改一下 base URL 就能用。

## Ollaya 与 Aria Engine 如何选择

| | [Aria Engine](/sdks/engine-runtime) | Ollaya |
| - | - | - |
| 定位 | 官方 AFM System One 运行时（`aria-engine`） | 多开放决策模型的本地守护进程 |
| AFM-D | `afm-de` / `afm-dd` | 目录拉取 + 本地 daemon |
| 协议 | `POST /v1/systemone` | 同形态 System One（`/api/decide`） |

需要咏唱引擎的发行版二进制和 FFI 时用 Engine；想要 pull / list / run 这种本地体验时用 Ollaya。

## 相关

* [AFM 基础模型](/concepts/models)：Encoder 与 Decoder、Hub、原语
* [Aria Engine](/sdks/engine-runtime)：官方 System One 运行时


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.