nanobot
nanobot 是一款輕量級 AI 智慧體,通過單個 config.json 配置檔案自定義 API 端點。基於 uv 管理 Python 環境,安裝與啟動都是一行命令。
前置要求
| 項 | 要求 |
|---|---|
| uv | 已安裝 |
| WRouter | 一把可用 sk- Token |
安裝
bash
uv tool install nanobot-aiWindows 額外步驟
把 %USERPROFILE%\.local\bin 加到 PATH,確保 nanobot 可呼叫:
powershell
$env:PATH = "$env:USERPROFILE\.local\bin;$env:PATH"建議寫入 PowerShell Profile 持久化。
驗證安裝
bash
nanobot --version配置
1. 生成預設配置
bash
nanobot onboard配置檔案位置:
- Linux / macOS:
~/.nanobot/config.json - Windows:
%USERPROFILE%\.nanobot\config.json
2. 修改 config.json
json
{
"agents": {
"defaults": {
"model": "claude-sonnet-4-6",
"provider": "wrouter"
}
},
"providers": {
"wrouter": {
"apiKey": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"apiBase": "https://wrouter.ai/v1"
}
}
}欄位要點:
| 欄位 | 說明 |
|---|---|
apiBase | 必須以 /v1 結尾 |
model | 必須與 WRouter 控制台中的模型 ID 完全一致 |
provider(defaults 下) | 指向 providers 下定義的某個鍵 |
可同時配置多個 provider,agents.defaults.provider 決定預設使用哪個。
啟動
bash
nanobot agent傳送任意 prompt(如"你好")有響應即配置成功。
切換模型
修改 agents.defaults.model,儲存後重啟 nanobot agent。
已知限制
- nanobot 設計上極簡,複雜 Agent 編排能力在 Hermes 或 AionUi 等更重的 Agent 裡。