Hermes Agent · 手动配置
当前配置结构
| 文件 | 用途 |
|---|---|
~/.hermes/config.yaml | 模型、终端、压缩、记忆和工具等非敏感设置 |
~/.hermes/.env | API Key、Token、密码等 secrets |
~/.hermes/auth.json | OAuth provider 凭据 |
HERMES_HOME 可切换 Hermes profile 目录。不要改变系统 HOME 来模拟 profile;官方文档明确将 HERMES_HOME 与操作系统用户目录分开。
推荐:使用 provider 向导
# 在聊天外运行:添加 provider、OAuth、API Key 或 custom endpoint
hermes model
# 查看当前配置
hermes config
# 打开 config.yaml
hermes config edit
# 检查升级后缺失项
hermes config check聊天内的 /model 只能切换已经配置好的 provider/model,不能新增 provider 或完成 OAuth。旧版页面把 hermes config set provider.<name>... 与 api_mode 写成所有 provider 的必填 schema;当前官方文档不支持这种概括,已撤下。
OpenAI 兼容 custom provider
Hermes 官方说明 custom endpoint 应实现 /v1/chat/completions。最稳妥的方式是在 hermes model 中选择 Custom endpoint。如需命名多个 custom provider,可使用官方 custom_providers schema:
custom_providers:
- name: foropencode
base_url: https://foropencode.com/v1
key_env: FOROPENCODE_API_KEY
model:
provider: custom:foropencode
default: gateway-model-id并把 Key 放到 ~/.hermes/.env:
FOROPENCODE_API_KEY=sk-xxxforopencode.com 是第三方网关,不是 Nous Research、OpenAI 或 Anthropic。gateway-model-id 必须替换为网关实际模型列表中的值。
环境变量引用
config.yaml 支持 ${VAR_NAME} 引用环境变量。密钥仍应放在 .env:
auxiliary:
vision:
api_key: ${VISION_API_KEY}
base_url: ${VISION_BASE_URL}Hermes 的辅助模型可能处理视觉、网页摘要或其他工具任务。即使主聊天使用某个 provider,也要在 hermes portal info、hermes tools 和配置中核对辅助任务最终路由,避免误解数据流。
验证与切换
hermes config check
hermes model
hermesprovider 切换不要求重启,历史、记忆和 skills 会保留。切换前确认这些持久内容是否适合发送给新的 provider,并从不含敏感数据的最小请求开始。
资料来源:Hermes Configuration · AI Providers · NousResearch/hermes-agent(2026-07-26 核对)