nanobot
nanobot tutorial โ Lightweight AI agent that reads its API endpoint from a single config.json, making EasyRouter integration trivial.
Project Introduction
nanobot is a lightweight AI agent that plugs into common chat tools. Configuration lives in a single config.json, so pointing it at EasyRouter is a two-line change. It relies on uv for Python environment management, keeping install and launch simple.
๐ฆ Prerequisites
What you'll need
- uv installed
- An EasyRouter endpoint (must end with
/v1) - An EasyRouter API key (generated in the console)
- A model ID exactly matching one exposed by your EasyRouter console (e.g.
claude-sonnet-4-6,gemini-2.5-flash)
๐ Step 1: Install nanobot
uv tool install nanobot-aiExtra step for Windows
Add .local/bin to your PATH so the nanobot command is directly callable:
$env:PATH = "$env:USERPROFILE\.local\bin;$env:PATH"Consider persisting it in your PowerShell Profile.
Verify
nanobot --version๐ง Step 2: Initialise & edit config
1. Generate the default config
nanobot onboardThe config file is created at:
- Windows:
%USERPROFILE%\.nanobot\config.json - Linux / macOS:
~/.nanobot/config.json
2. Edit config.json
Set providers and agents.defaults to point at EasyRouter:
{
"agents": {
"defaults": {
"model": "claude-sonnet-4-6",
"provider": "easyrouter"
}
},
"providers": {
"easyrouter": {
"apiKey": "your-easyrouter-api-key",
"apiBase": "https://easyrouter.io/v1"
}
}
}Field notes
apiBasemust end with/v1modelmust be a real model ID exposed by your EasyRouter console- You can declare multiple providers;
agents.defaults.providerchooses which one is active
โ Step 3: Launch & verify
nanobot agentSend any test message (e.g. "Hello, what day is today?"). A normal response means you're set.
๐ Switching models
Edit agents.defaults.model in config.json and restart nanobot agent.
โ Troubleshooting
| Issue | Fix |
|---|---|
nanobot command not found | Windows: add .local/bin to PATH |
| 401 Unauthorized | Confirm apiKey is correctly set in config.json |
| Model not found | Make sure model matches your EasyRouter console exactly |
| Config changes don't apply | Restart nanobot agent to reload |