Models Hub
Agent Tools

nanobot

A lightweight AI agent that connects to model services quickly via config.json.

Edit this page

Overview

nanobot is a lightweight AI agent that connects to common chat tools and lets you customize API endpoints through a single config.json configuration file. It relies on uv to manage the Python environment, making installation and startup extremely simple.

📦 Before You Start

What you need

  • uv installed
  • A working Models Hub Base URL (must end with /v1)
  • A working Models Hub API Key (generate it in the console)
  • The model name you want to use (such as claude-sonnet-4-6, gemini-2.5-flash, etc., which must match the model ID in the Models Hub console exactly)

🚀 Step 1: Install nanobot

uv tool install nanobot-ai

Extra Steps for Windows

Windows users need to add .local/bin to their environment variables so the nanobot command can be invoked directly:

$env:PATH = "$env:USERPROFILE\.local\bin;$env:PATH"

We recommend adding this to your PowerShell Profile to make it persistent.

Verify the Installation

nanobot --version

🔧 Step 2: Initialize and Edit the Configuration

1. Generate the Default Configuration

nanobot onboard

This command creates a configuration file in your home directory:

  • Windows: %USERPROFILE%\.nanobot\config.json
  • Linux / macOS: ~/.nanobot/config.json

2. Edit config.json

Configure providers and agents.defaults to point to Models Hub:

{
  "agents": {
    "defaults": {
      "model": "claude-sonnet-4-6",
      "provider": "modelsok"
    }
  },
  "providers": {
    "modelsok": {
      "apiKey": "your-modelsok-api-key",
      "apiBase": "https://modelsok.com/v1"
    }
  }
}

Key fields

  • apiBase must end with /v1
  • model must be a model ID actually exposed in the Models Hub console
  • Multiple providers can be configured side by side; agents.defaults.provider specifies which one to use by default

✅ Step 3: Launch and Verify

nanobot agent

After it starts, type any question (for example, "Hello, tell me what day of the week it is today"). If the model responds normally, the configuration was successful.

🔄 Switching Models

Simply edit agents.defaults.model in config.json, save it, and restart nanobot agent to switch models.

❓ FAQ

IssueSolution
nanobot command not foundWindows users need to add .local/bin to PATH
401 UnauthorizedConfirm that apiKey is filled in correctly in config.json
Model does not existCheck that the model field matches the Models Hub console exactly
Configuration changes have no effectConfiguration changes require restarting nanobot agent to take effect

On this page