> ## 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.

# Open WebUI

> 了解如何配置 Open WebUI 的 OpenAI-compatible backend，接入 siflow endpoint，并通过浏览器界面使用算秩模型对话。

[Open WebUI](https://github.com/open-webui/open-webui) 是一个自托管的大语言模型 Web 界面。它可以连接 OpenAI-compatible backends，因此可以指向 siflow endpoint，并在浏览器中与算秩模型对话。

以下步骤使用 Open WebUI v0.11.0；较新的版本可能略有差异。可用模型（例如 `glm-5.2`、`DeepSeek-V4-Flash`）和价格请参考 [模型广场](https://console.siflow.cn/model-inference/models)。

## 配置

在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建 API Key，然后在启动 server 前设置两个环境变量：

```bash theme={null}
export OPENAI_API_BASE_URL="https://api.siflow.cn/model-api/v1"
export OPENAI_API_KEY="<Your API Key>"
open-webui serve --port 8080
```

| 变量                    | 说明                                                                             |
| --------------------- | ------------------------------------------------------------------------------ |
| `OPENAI_API_BASE_URL` | siflow OpenAI-compatible endpoint：`https://api.siflow.cn/model-api/v1`。        |
| `OPENAI_API_KEY`      | 您在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建的 API Key。 |

<Note>
  `export` 只在当前 shell session 中有效。如需长期生效，请将两行配置添加到 `~/.bashrc` 或 `~/.zshrc`。
</Note>

打开终端输出的 URL，例如 `http://localhost:8080`，并创建第一个账号。第一个账号会成为 administrator。

设置上述两个变量后，Open WebUI 会自动从 siflow endpoint 读取模型列表，不需要逐个模型配置。

其他 connections 和 per-model options 位于 **Admin Settings → Connections**。如果依赖 Open WebUI 的 tool/function 功能，请选择原生支持 tool calling 的模型。

<img src="https://mintcdn.com/siflow/MnqDOrFLyFtwF7sA/model-inference/media/openwebui-chat.png?fit=max&auto=format&n=MnqDOrFLyFtwF7sA&q=85&s=2dd7c5b4919827cd4f7313910e2af181" alt="Open WebUI 中选择算秩模型进行对话" width="2880" height="1800" data-path="model-inference/media/openwebui-chat.png" />

## 验证

在 chat 顶部模型选择器中选择一个算秩模型并发送消息。如果正常回复，即表示连接成功。

## 常见问题

* 如果模型选择器为空，请确认两个变量是在启动 `open-webui serve` 的同一个 shell 中 export 的，并确认 `GET https://api.siflow.cn/model-api/v1/models` 携带您的 key 后能返回列表。
