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

# 在 DeepSeek Harness 中使用 LithosAI

> 通过 OpenAI Chat Completions API，将 DeepSeek Harness 直接接入 LithosAI。

## 开始之前

安装 DeepSeek Harness，在 [API Key](https://console.lithosai.cloud/keys?lang=zh) 页面创建 key，并在 [模型](https://console.lithosai.cloud/models?lang=zh) 页面选好模型。

<Note>
  DeepSeek Harness 目前是开发者预览版，配置格式可能随版本变化。以下步骤在 0.2.0-rc.2 和 0.2.1-rc.2 版本上测试过。
</Note>

<Steps>
  <Step title="设置 API key">
    在启动 DeepSeek Harness 的 shell 中，把 key 设为环境变量：

    ```bash theme={null}
    export LITHOSAI_API_KEY="your-key"
    ```

    桌面端会读取登录 shell 的环境变量，所以要把这一行加到 `~/.zshrc`，然后重启应用。在下一步配置好 LithosAI 之后，也可以改在 **设置 → 模型** 中填写 key：编辑 **LithosAI**，填入 key，然后选择 **保存**。DeepSeek Harness 会把它存到 `~/.dsh/.credentials.yaml`。
  </Step>

  <Step title="配置 LithosAI">
    以下配置以 `moonshotai/Kimi-K3-fast` 为例。

    按你运行 DeepSeek Harness 的方式，把配置添加到对应的 profile：

    * `dsh web`：`~/.dsh/profiles/web/cordis.patch.yml`
    * 桌面端：`~/.dsh/profiles/desktop/cordis.patch.yml`
    * `dsh headless`：`~/.dsh/profiles/headless/cordis.patch.yml`

    `llm-pi-ai` 是 DeepSeek Harness 接入第三方模型服务商的插件。DeepSeek Harness 自己也会写这个文件，比如在你切换模型或推理等级时。如果文件里已经有 `llm-pi-ai` 条目，不要再新增一个，只把 `lithosai:` 这一段复制到该条目的 `providers` 下。如果已经有 `agent-default-model` 条目，直接修改该条目。按所用模型设置 token 上限。

    <Accordion title="DeepSeek Harness 配置">
      ```yaml cordis.patch.yml theme={null}
      - id: llm-pi-ai
        config:
          providers:
            lithosai:
              displayName: LithosAI
              apiKeyEnv: LITHOSAI_API_KEY
              api: openai-completions
              baseURL: https://api.lithosai.cloud/v1
              compat:
                supportsReasoningEffort: true
                maxTokensField: max_tokens
              models:
                - id: moonshotai/Kimi-K3-fast
                  name: moonshotai/Kimi-K3-fast
                  contextWindow: 1048576
                  maxTokens: 32768
                  reasoningEfforts:
                    low: low
                    high: high
                    max: max
      - id: agent-default-model
        config:
          provider: lithosai
          model: moonshotai/Kimi-K3-fast
          reasoningEffort: high
      ```
    </Accordion>

    要添加其他模型或速度档位，复制 `providers.lithosai.models` 下的条目，把 `id` 和 `name` 设为[模型目录](https://console.lithosai.cloud/models?lang=zh)中的模型 ID，并按该模型调整 `contextWindow` 和 `maxTokens`。重启 DeepSeek Harness 使配置生效。
  </Step>

  <Step title="开始对话">
    用你配置好的 profile 启动 DeepSeek Harness。

    **Web UI**：运行以下命令：

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

    Web UI 会在浏览器中打开。如果没有自动打开，请打开命令输出的 URL，其中带有访问 token。

    **桌面端**：直接打开应用即可。如果出现欢迎页，选择 **添加 API Key**，再选择 **稍后配置**，不需要 DeepSeek 账号。

    **Headless**：在项目目录下运行，把任务作为参数传入。DeepSeek Harness 输出回答后退出。

    ```bash theme={null}
    npx @deepseek-ai/dsh headless "总结一下这个仓库"
    ```
  </Step>
</Steps>

## 模型与推理强度

* **模型与速度档位**：打开输入框中的模型菜单，选择 **模型**。
* **推理强度**：在同一菜单中选择 **推理等级**，再选 **Low**、**High** 或 **Max**。配置里的初始值是 **High**，之后你选择的等级会成为新的默认值。
* **Headless**：没有菜单。在 headless profile 的 `agent-default-model` 条目中修改 `model` 和 `reasoningEffort`。

所有 Agent 通用的问题见[常见问题](/zh/agent-integrations#常见问题)。

## 参考资料

* [DeepSeek Harness 模型配置](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/user/guide/providers.zh.md)
* [LithosAI 模型](https://console.lithosai.cloud/models?lang=zh)


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