Skip to content

1 安装 Hermes ​

Linux、macOS 或 WSL2 可使用安装脚本。

  1. 安装
bash
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
  1. 运行并配置

Setup

bash
hermes setup
配置项建议 / 值
Setup mode选择 Quick Setup
Provider选择 Custom endpoint / OpenAI-compatible
Base URLhttps://maas-api.cn-huabei-1.xf-yun.com/v2
APIKEY填写 APIKEY
Model IDspark-x2.5
Context length按实际授权的上下文长度填写
  1. 环境变量方式

Linux / macOS

bash
export OPENAI_BASE_URL="https://maas-api.cn-huabei-1.xf-yun.com/v2"
export OPENAI_API_KEY="<你的 APIKEY>"
  1. config.yaml 示例

YAML

yaml
model:
  default: spark-x2.5
  provider: custom
  base_url: https://maas-api.cn-huabei-1.xf-yun.com/v2

APIKEY 建议通过 Hermes 的凭证流程保存,避免将明文密钥写入共享配置文件。

  1. 开始使用

聊天

bash
hermes chat

切换模型

text
/model custom:spark-x2.5