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

# Obsidian Copilot

> 了解如何在 Obsidian Copilot 中添加 custom chat model，接入 siflow endpoint，并使用算秩模型进行笔记问答和写作。

[Obsidian Copilot](https://github.com/logancyang/obsidian-copilot) 是 [Obsidian](https://obsidian.md) 的 AI plugin。它可以与笔记对话、生成内容和运行命令。其 custom-model 支持可通过 OpenAI-compatible endpoint 连接到 siflow endpoint。

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

## 配置

请先在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建 API Key。

1. 打开 **Settings → Copilot → Model**，然后单击添加模型。此时会打开 **Add Custom Chat Model** 弹窗。

2. 填写所需字段。

   | 参数         | 示例                                                                             |
   | ---------- | ------------------------------------------------------------------------------ |
   | Model Name | `glm-5.2`                                                                      |
   | Provider   | **OpenAI Format**                                                              |
   | Base URL   | `https://api.siflow.cn/model-api/v1`                                           |
   | API Key    | 您在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建的 API Key。 |

   配置时请注意以下事项：

   * **Provider** 必须选择 **OpenAI Format**。这是 custom OpenAI-compatible endpoint 对应的选项。OpenAI、Anthropic 等具名 providers 会指向它们的官方服务。
   * Base URL 字段提示为 "leave it blank unless you are using a proxy"，但对于 siflow 这样的 custom endpoint，必须填写 `https://api.siflow.cn/model-api/v1`。
   * 如果使用依赖 tool calling 的 Copilot 功能，请选择原生支持 tool calling 的模型。

3. 在 **Model Capabilities** 下勾选 **CORS**。

   桌面应用访问 custom endpoint 需要 CORS。否则 **Test** 按钮会提示 "Connection successful, but requires CORS to be enabled"。

4. 单击 **Test** 验证连接。预期看到 "Model verification successful!"，然后单击 **Add Model**。

<img src="https://mintcdn.com/siflow/MnqDOrFLyFtwF7sA/model-inference/media/obsidian-add-model.png?fit=max&auto=format&n=MnqDOrFLyFtwF7sA&q=85&s=559b0d4fda1478e07c6e73f903f2f0bc" alt="Obsidian Copilot 中添加自定义聊天模型接入 siflow endpoint" width="2316" height="1640" data-path="model-inference/media/obsidian-add-model.png" />

## 验证

打开 Copilot chat pane，在底部模型选择器中选择 `glm-5.2`，然后发送消息。如果正常回复，即表示连接成功。

<Info>
  Assistant 可能会自称为 "Obsidian Copilot"，而不是底层模型名称。这是 plugin 自身的 system prompt，不是路由问题；模型选择器仍会显示正在使用的算秩模型。
</Info>

<img src="https://mintcdn.com/siflow/MnqDOrFLyFtwF7sA/model-inference/media/obsidian-chat-reply.png?fit=max&auto=format&n=MnqDOrFLyFtwF7sA&q=85&s=8efb5635b40cbed4c0fb1f8f2d89b3d4" alt="Obsidian Copilot 使用算秩模型在笔记中对话" width="2316" height="1640" data-path="model-inference/media/obsidian-chat-reply.png" />
