AnRouter

在 Hermes Agent 中配置 AnRouter

通过 Hermes 桌面端或 CLI 把 AnRouter 添加为自定义端点,并验证可用。

Hermes 当前推荐通过 hermes model 配置自定义端点。Hermes 官方现行文档使用顶层 custom_providers 列表定义具名自定义端点;下面的手动配置遵循这一官方结构。

1. Hermes Desktop 图形化配置

  1. 首次启动时进入模型/provider 配置;之后可从设置中的模型配置入口重新打开。
  2. 选择 Local / custom endpoint,Endpoint 填 https://api.anrouter.com/v1,API Key 填 AnRouter 密钥。
  3. 模型填写准确 ID,例如 glm-5.3;若出现 API mode,选择 chat_completions。
  4. 保存后新建会话,先发送一条短消息验证。
Hermes Desktop 中已填写 AnRouter Endpoint 的 Local custom endpoint 配置
图中 Endpoint 已填写 https://api.anrouter.com/v1;下一行 API Key 请填写自己的 AnRouter 密钥,切勿公开截图。点击图片可查看原图。

2. 安装 CLI

# macOS / Linux / WSL2
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

hermes --version
hermes doctor

Windows PowerShell:iex (irm https://hermes-agent.nousresearch.com/install.ps1)

3. CLI 推荐:交互式配置

hermes model
ProviderCustom endpoint
API Base URLhttps://api.anrouter.com/v1
API KeyAnRouter API Key
Modelglm-5.3
API Modechat_completions
Context length可先留空让端点发现;如需手填,以模型目录为准

4. 可选:命名 provider 配置

# ~/.hermes/config.yaml
custom_providers:
  - name: anrouter
    base_url: https://api.anrouter.com/v1
    key_env: ANROUTER_API_KEY
    api_mode: chat_completions

model:
  provider: custom:anrouter
  default: glm-5.3
# ~/.hermes/.env
ANROUTER_API_KEY=your_anrouter_api_key

5. 验证

  1. 运行 hermes doctor 检查安装与配置。
  2. 启动 hermes,先发送短问题。
  3. 会话内使用 /model custom:anrouter:glm-5.3 切换;添加或修改 provider 则退出会话后运行 hermes model。
上下文要求:Hermes 的 Agent 工具流至少需要 64,000 Token。端点支持模型发现时应在向导中留空;只有在数值与当前 AnRouter 模型目录和实际端点行为一致时,才手动添加 context_length。

参考:Hermes Desktop · Hermes 自定义端点