nanobot

nanobot is a lightweight terminal agent that configures providers and model presets in JSON. It can call ModelGo through its OpenAI-compatible API.

Prerequisites

1. Install nanobot

bash
python -m pip install nanobot-ai
nanobot onboard --wizard

The default config is ~/.nanobot/config.json.

2. Configure a ModelGo provider

Merge these fields into ~/.nanobot/config.json:

json
{
  "providers": {"modelgo": {
    "apiKey": "${MODELGO_API_KEY}",
    "apiBase": "https://api.modelgo.ai/v1"
  }},
  "modelPresets": {"ModelGo": {
    "provider": "modelgo",
    "model": "your-model-id",
    "maxTokens": 4096,
    "contextWindowTokens": 65536,
    "temperature": 0.1
  }},
  "agents": {"defaults": {"modelPreset": "ModelGo"}}
}
bash
export MODELGO_API_KEY="sk-your-token"

Leave apiType unset for a custom OpenAI-compatible endpoint.

3. Verify the connection

bash
curl https://api.modelgo.ai/v1/models -H "Authorization: Bearer $MODELGO_API_KEY"
nanobot agent -m "Describe this project in one sentence"

Troubleshooting

nanobot cannot find the model

Make sure modelPresets.ModelGo.provider matches providers.modelgo and that the JSON is valid.

401 or endpoint errors

Confirm the key is exported and apiBase is exactly https://api.modelgo.ai/v1.

Related docs