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

# DeepSeek Harness

[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 是 DeepSeek 开源的 Agent Harness，采用 “everything is a plugin” 的设计理念。它提供网页界面，可以通过自定义提供方接入 OpenAI-compatible endpoint，因此可以连接算秩 Model Inference API，并在 DeepSeek Harness 中使用算秩模型运行 Agent 任务。

本文仅以 npm 运行方式为例，DeepSeek Harness 也支持源码运行，具体方式请参考其官方文档。

## 配置

### 1. 安装 Node.js

DeepSeek Harness 需要 Node.js 运行环境。打开终端，运行以下命令检查是否已安装：

```bash theme={null}
node -v
```

如果终端返回版本号，表示 Node.js 已安装。如果未安装，请前往 [Node.js 官网](https://nodejs.org/en/download)下载安装。

### 2. 启动 DeepSeek Harness

在终端运行：

```bash theme={null}
npx @deepseek-ai/dsh web
```

首次运行时会下载依赖，可能需要等待一段时间。启动完成后，DeepSeek Harness 会默认打开本地网页界面：

```text theme={null}
http://127.0.0.1:3080/
```

<Warning>
  DeepSeek Harness 仍处于开发者预览阶段，版本升级可能带来不兼容变更。它可以执行模型生成的代码和命令；运行 Agent 前，请确认当前工作区、权限和将要执行的操作。
</Warning>

### 3. 添加算秩作为提供方

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

进入 DeepSeek Harness 网页界面后，打开 **设置 > 模型**，然后选择 **添加自定义提供方**。

填写以下字段，然后提交创建。

<img src="https://mintcdn.com/siflow/VXMspryITbv2kIJw/model-inference/media/deepseek-harness-provider-config.png?fit=max&auto=format&n=VXMspryITbv2kIJw&q=85&s=b2089e320d3e31acc24ae0da2870d20e" alt="DeepSeek Harness 添加算秩自定义提供方" width="2884" height="1346" data-path="model-inference/media/deepseek-harness-provider-config.png" />

| 字段     | 填写值                                                                                                                                                                 |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 提供方 ID | 自定义提供方 ID，例如 `siflow`。建议使用小写字母。                                                                                                                                     |
| 显示名称   | 自定义显示名称，例如 `siflow`。                                                                                                                                                |
| API 地址 | `https://api.siflow.cn/model-api/v1`                                                                                                                                |
| API 协议 | `openai-completions`                                                                                                                                                |
| API 密钥 | 您在 [API 密钥管理](https://console.siflow.cn/model-inference/api_keys) 页面创建的 API Key。请妥善保管 API Key，不要将其提交到 Git，也不要粘贴到公开 issue、日志或截图中。                                    |
| 模型目录   | 单击 **获取可用模型**，获取模型列表，或手动添加模型 ID。可用模型和价格请参考 [模型广场](https://console.siflow.cn/model-inference/models)。需要运行会调用工具的 Agent 任务时，请选择支持 Function Calling / tool calling 的模型。 |

### 4. 选择运行配置

回到 DeepSeek Harness 主界面，在开始任务前确认以下配置：

* **工作区**：选择 Agent 要访问的工作区。DeepSeek Harness 会在该工作区范围内读取文件、运行命令或执行任务。
* **模型**：在模型选择器中选择刚刚添加的算秩模型。
* **模式**：根据任务需要选择运行模式。DeepSeek Harness 提供 **标准模式**、**PTC 模式**、**极简模式** 和 **创造模式**。首次验证接入时，可以保持默认的标准模式。

<img src="https://mintcdn.com/siflow/VXMspryITbv2kIJw/model-inference/media/deepseek-harness-run-config.png?fit=max&auto=format&n=VXMspryITbv2kIJw&q=85&s=1cf370da6be7cf04534d073ce802accf" alt="DeepSeek Harness 选择算秩模型、工作区和运行模式" width="2832" height="1362" data-path="model-inference/media/deepseek-harness-run-config.png" />

## 验证

选择算秩模型后，发送一个简单任务，例如：

```text theme={null}
请用 3 个要点说明生成式 AI 在软件开发中的典型用途。
```

如果 DeepSeek Harness 正常返回回复，即表示配置成功。
