context length exceeded 怎麼解?
context length exceeded 的官方解法:先用 /compress 壓縮目前 session,用 /usage 看用量;長期解法是在 config.yaml 的 model.context_length 明確設定模型實際上限。
這頁適合誰:長對話或大量工具輸出後撞到 context 上限的人。
步驟
-
壓縮目前 session
在對話中輸入斜線指令。
/compress -
檢查用量與偵測到的上限
啟動時會顯示偵測到的 context 上限,對話中可查。
/usage -
在 config.yaml 明確設定
特別是自架 / 本地模型,要把 context_length 設成伺服器實際能力。
model: context_length: 131072
完成後怎麼驗證
- 壓縮後對話恢復正常
- 啟動訊息顯示的 context 上限符合模型實際規格
常見問題
本地模型特別容易撞到?
官方 FAQ 提醒用 Custom endpoint(如 Ollama)時要把 context length 設成伺服器實際能力,偵測值不一定正確。
相關頁
- Hermes Agent macOS 下載與安裝教學
- Hermes Agent Windows 下載與安裝教學(Desktop / PowerShell / WSL2)
- Hermes Agent Linux 下載與安裝教學
- Hermes Agent WSL2 完整安裝教學(Windows 使用者進階路線)
- Hermes Agent 模型供應商與 API key 設定教學
- OpenClaw 搬家到 Hermes Agent 完整教學(官方 hermes claw migrate)
- hermes: command not found 怎麼解?
- API key not set / API key 無效怎麼解?
- Hermes requires Python 3.11 or newer 怎麼解?
- Telegram 接 Hermes Agent 常見坑與解法
- 官方 Issue 精選問答
- 學校解法卡