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

# wiseflow

> 了解如何在 wiseflow 的 .env 中配置 LLM_API_BASE，接入 siflow endpoint，让信息挖掘与情报聚合任务使用算秩模型。

[wiseflow](https://github.com/TeamWiseFlow/wiseflow) 是一款开源的信息挖掘 / 情报聚合工具，从网页等信源中按你的关注点提炼信息。它通过原生 OpenAI SDK 调用大模型，任意 OpenAI 兼容服务均可，因此可以接入算秩模型推理服务。

本文以 `glm-5.2` 为例。完整模型清单与价格见 [模型广场](https://console.siflow.cn/model-inference/models)。

## 配置

在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建一个 API Key。在项目根目录的 `.env` 中填写：

```bash theme={null}
LLM_API_BASE="https://api.siflow.cn/model-api/v1"
LLM_API_KEY="<您的 API Key>"
PRIMARY_MODEL="glm-5.2"
SECONDARY_MODEL="glm-5.2"
```

| 字段                | 说明                                                                            |
| ----------------- | ----------------------------------------------------------------------------- |
| `LLM_API_BASE`    | siflow OpenAI 兼容端点（base URL，含 `/v1`）：`https://api.siflow.cn/model-api/v1`     |
| `LLM_API_KEY`     | 您在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建的 API Key |
| `PRIMARY_MODEL`   | 主模型 ID，如 `glm-5.2`                                                            |
| `SECONDARY_MODEL` | 用于初筛的次要模型（可与主模型相同）                                                            |

## 验证

wiseflow 通过 `core/llms/openai_wrapper.py`（原生 OpenAI SDK）读取以上配置调用模型。启动任务后，模型调用即走 siflow endpoint：

```python theme={null}
import asyncio
from core.llms.openai_wrapper import openai_llm

print(asyncio.run(openai_llm(
    [{"role": "user", "content": "Reply with exactly: OK"}],
    model="glm-5.2",
)))
# → OK
```

正式运行 `python core/run_task.py`，提炼出的信息会落库到 PocketBase（默认 `http://127.0.0.1:8090/_/`）。

## 常见问题

* **使用 0.3.x 版本**（如 tag `v0.3.8`）：仓库 `master` 分支已改为其它产品，经典 Python + PocketBase 版本在版本化 tag 上。
* **`LLM_API_BASE` 填 base URL 且含 `/v1`**：`https://api.siflow.cn/model-api/v1`；wiseflow 用原生 OpenAI SDK，不限定供应商。
* 模型 ID 以 [模型广场](https://console.siflow.cn/model-inference/models) 为准。
