Hermes Agent 是一款終端 AI 編程工具,可以通過隨用隨付、Coding Plan 或 Token Plan 團隊版接入阿里雲百鍊。
安裝 Hermes Agent
-
在終端中執行以下命令安裝 Hermes Agent,安裝指令碼會自動安裝 Python、Git 等依賴。
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash說明Windows 不支援原生安裝,請先安裝 WSL2,在 WSL2 中運行以上命令。
-
安裝完成後,重新載入終端環境。
source ~/.bashrc # 如果使用 zsh,改為 source ~/.zshrc -
運行以下命令驗證安裝。若有版本號碼輸出,則表示安裝成功。
hermes --version
配置接入憑證
通過 hermes config set 命令配置接入參數,根據所選方案填入對應的 Base URL 和 API Key:
-
Token Plan 團隊版:按坐席訂閱,按 token 消耗抵扣 Credits。
-
Coding Plan:固定月費訂閱,按模型調用次數計量。
-
隨用隨付:按實際調用量後付費。
Token Plan 團隊版
將 YOUR_API_KEY 替換為 Token Plan 團隊版專屬 API Key。可用模型請參考 Token Plan 團隊版支援的模型。
hermes config set model.provider custom
hermes config set model.base_url https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
hermes config set model.api_key YOUR_API_KEY
hermes config set model.default qwen3.6-plus
以上命令將配置寫入 ~/.hermes/config.yaml。也可以直接編輯該檔案,寫入以下內容:
Coding Plan
將 YOUR_API_KEY 替換為 Coding Plan 專屬 API Key。可用模型請參考 Coding Plan 支援的模型。
hermes config set model.provider custom
hermes config set model.base_url https://coding-intl.dashscope.aliyuncs.com/compatible-mode/v1
hermes config set model.api_key YOUR_API_KEY
hermes config set model.default qwen3.6-plus
以上命令將配置寫入 ~/.hermes/config.yaml。也可以直接編輯該檔案,寫入以下內容:
隨用隨付
將 YOUR_API_KEY 替換為阿里雲百鍊 API Key。可用模型請參考OpenAI 相容 - 支援的模型。
base_url 按地區設定,API Key 需與所選地區對應:
-
華北2(北京):
https://dashscope.aliyuncs.com/compatible-mode/v1 -
新加坡:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1 -
美國(維吉尼亞):
https://dashscope-us.aliyuncs.com/compatible-mode/v1
hermes config set model.provider custom
hermes config set model.base_url https://dashscope-intl.aliyuncs.com/compatible-mode/v1
hermes config set model.api_key YOUR_API_KEY
hermes config set model.default qwen3.6-plus
以上命令將配置寫入 ~/.hermes/config.yaml。也可以直接編輯該檔案,寫入以下內容:
驗證配置
配置完成後,執行以下命令發送一條測試訊息:
hermes chat -q "你好"
如果返回正常的回複,則配置成功。如需切換模型,通過 -m 參數指定:
hermes chat -m qwen3.6-plus
常見問題
錯誤碼
配置過程中遇到報錯,請參考對應計費方案的常見問題文檔:
-
Coding Plan:Coding Plan 常見問題
-
Token Plan 團隊版:Token Plan 團隊版常見問題
配置後仍串連到 OpenRouter
Hermes Agent 預設使用 OpenRouter 作為推理供應商。接入阿里雲百鍊時,model.provider 必須設定為 custom。請執行以下命令確認:
hermes config set model.provider custom