程式工具
Hermes Agent
將 Hermes Agent 連接到 TokenLab
在 Hermes 中將 TokenLab 作為具名模型提供者 (named model provider) 使用,同時保留您現有的帳戶和工具權限。
讓我的 Agent 進行設定
將此任務複製到您電腦上已執行的 Agent:
Read this guide and help me connect Hermes to TokenLab:
https://tokenlab.sh/docs/zh-TW/integrations/hermes-agent
Check my installed version and active configuration first.
Preserve existing accounts, providers, permissions and other settings.
Back up local files and show proposed changes.
Have me enter any API key locally; never ask for, print or paste it in chat.
Check configuration loading first.
Explain any paid request test separately before running it.安裝或檢查 Hermes
請遵循官方安裝指南。它提供適用於 Apple Silicon macOS 和 Windows 的桌面安裝程式,以及適用於 Linux 和原生 Windows 的 CLI 路徑。請檢查您系統的需求;如果已安裝 Hermes,則可跳過安裝步驟。
選項:可還原的設定
請使用 TokenLab Skills 0.1.3 中包含的 Hermes 輔助工具來搭配官方 Hermes 0.21.3 使用。它會預覽並備份變更,僅新增一個具名提供者,並保留 YAML 註解、帳戶、預設模型和權限。請先閱讀設定參考。
將 SKILL_DIR 設定為已安裝的 tokenlab-api-integration 資料夾,並將 HERMES_PYTHON 設定為 hermes --version 顯示的 Hermes 安裝路徑中的 Python:macOS/Linux 為 venv/bin/python,Windows 為 venv\Scripts\python.exe。PowerShell 使用 $SkillDir 和 $HermesPython。請使用該現有環境;此輔助工具不會安裝全域 Python 套件。
"$HERMES_PYTHON" "$SKILL_DIR/scripts/configure_hermes.py" --model gpt-5.6-luna
"$HERMES_PYTHON" "$SKILL_DIR/scripts/configure_hermes.py" --model gpt-5.6-luna --apply& $HermesPython "$SkillDir/scripts/configure_hermes.py" --model gpt-5.6-luna
& $HermesPython "$SkillDir/scripts/configure_hermes.py" --model gpt-5.6-luna --apply套用後,請跳過下方的「手動合併」步驟。請遵循輔助工具列印出的啟動與載入指令;它會自動偵測 active_profile。設定檢查不會驗證金鑰。使用 --restore 預覽還原,然後加上 --apply 以還原原始位元組。衝突、後續編輯、受管理的設定以及 WSL 會停止自動設定;若遇到這些情況,請保留這些設定並使用手動方式。
設定具名提供者
找到作用中的 Hermes 目錄:若已設定則為 HERMES_HOME,否則為 ~/.hermes (Windows 為 %LOCALAPPDATA%\hermes)。備份 config.yaml,然後合併以下項目,切勿取代其他設定。此範例使用 Chat Completions;請選擇支援此格式與工具呼叫的現行模型。
備份作用中的設定。僅新增 TokenLab 項目,並保留現有的提供者、帳戶、預設模型選擇和權限。如果該名稱已被使用,請選擇另一個名稱並更新指令。若要復原設定,僅需移除您新增的項目或還原其先前的備份。
providers:
tokenlab:
api: https://api.tokenlab.sh/v1
key_env: TOKENLAB_API_KEY
transport: chat_completions
default_model: gpt-5.6-luna在 API keys 中建立金鑰。請將其以 TOKENLAB_API_KEY 的形式在本機 Hermes 目錄的 .env 檔案中輸入,或在啟動 Hermes 的處理程序環境中輸入。切勿將金鑰貼入對話中,也不要將其放入提供者 YAML 檔案內。
檢查設定並發送請求
使用 hermes config get providers.tokenlab.api 檢查新增的提供者;它應該顯示 https://api.tokenlab.sh/v1。保持現有的 model 區段不變。使用下方的明確提供者與模型啟動新工作階段;若要使用您之前的預設值,請在不帶這些旗標的情況下正常啟動。設定檢查不會驗證金鑰。
hermes chat --provider custom:tokenlab --model gpt-5.6-luna準備好消耗 TokenLab 餘額時,請發送簡短的文字請求。檢查回應及其在 Requests 中的對應記錄。確認無誤後,再嘗試唯讀工具任務。輔助模型和選用工具可以擁有獨立的提供者或金鑰。
還原或疑難排解
如果提供者顯示為未知,請檢查已安裝的版本以及目前的提供者格式。若發生驗證錯誤,請檢查本機環境和金鑰狀態,切勿列印出金鑰。若要復原設定,請還原先前的模型選擇,並僅移除您新增的 TokenLab 項目。
在同一個 Agent 中產生影像與影片
Hermes 也可以透過 TokenLab MCP server 建立影像和短片。每次產生都會從相同的 TokenLab 餘額中扣款。將此項目合併到同一個 config.yaml 中:
mcp_servers:
tokenlab:
command: "npx"
args: ["-y", "@tokenlabai/mcp-server@0.6.48"]
env:
TOKENLAB_MCP_TOOL_PROFILE: "core"
TOKENLAB_API_KEY: "<TOKENLAB_API_KEY>"Hermes 僅會將列出的 env 傳遞給伺服器,因此請將此本機檔案中的 <TOKENLAB_API_KEY> 取代為您的金鑰,且不要分享它。執行 hermes mcp test tokenlab,或在開啟的工作階段中輸入 /reload-mcp。然後嘗試:
Call get_model_pricing for nano-banana-2, then use create_image with nano-banana-2 at 1k to make a photo of a matte black coffee mug on a white desk.create_video 會回傳一個任務 ID。Agent 會呼叫 get_task_status 直到影片準備就緒。Skill 指南提供了整合指引。選擇此提供者時,並不強制要求使用 MCP 或 Skills。