Chuyển đến nội dung chính
Một CLI agent AI nhẹ. Repo chính thức: https://github.com/HKUDS/nanobot
Giao thức: tương thích OpenAI
  • Base URL: https://api.orcarouter.ai/v1 (phải chứa /v1)

Cài đặt

Yêu cầu uv trước, rồi cài lệnh nanobot:
uv tool install nanobot-ai

Cấu hình

Sửa ~/.nanobot/config.json:
{
  "agents": {
    "defaults": {
      "model": "orcarouter/auto",
      "provider": "custom",
      "maxTokens": 4096,
      "temperature": 0.1
    }
  },
  "providers": {
    "custom": {
      "apiKey": "sk-orca-...",
      "apiBase": "https://api.orcarouter.ai/v1"
    }
  }
}

Chạy

nanobot agent -m "Reply with exactly: OK" --no-logs --no-markdown
Mong đợi câu trả lời OK.

Ghi chú

  • Dùng provider custom được định nghĩa sẵn — đừng tự bịa ra tên provider của riêng bạn. Các tên tùy chỉnh sẽ bị bỏ qua và bạn nhận lỗi provider 'None'.
  • Đừng thêm trường apiType vào provider custom. Chỉ provider openai tích hợp sẵn mới hỗ trợ apiType; thêm nó vào custom sẽ thất bại khi xác thực.
  • Base URL giữ phần đuôi /v1, và agents.defaults.provider phải được đặt thành custom.
  • Tên model dùng định dạng vendor/model. Thay orcarouter/auto bằng một model cụ thể như anthropic/claude-opus-4.8 hoặc google/gemini-2.5-flash.

Bật suy luận / thinking

Đặt reasoningEffort dưới agents.defaults (hoặc một mục modelPresets). Giá trị hợp lệ: none / low / medium / high / max. Bỏ qua nó (hoặc null) sẽ theo mặc định của model.
{
  "agents": {
    "defaults": {
      "model": "anthropic/claude-sonnet-4.6",
      "provider": "custom",
      "maxTokens": 16000,
      "reasoningEffort": "high"
    }
  },
  "providers": { "custom": { "apiKey": "sk-orca-...", "apiBase": "https://api.orcarouter.ai/v1" } }
}
maxTokens phải lớn hơn ngân sách thinking. nanobot dịch reasoningEffort: high thành một thinking.budget_tokens của Anthropic; nếu maxTokens (ví dụ mặc định 4096) nhỏ hơn, upstream trả về 400 max_tokens must be greater than thinking.budget_tokens. Tăng maxTokens lên ~16000 sẽ khắc phục. (Đã kiểm chứng: trả về ✻ 391.)