Connect nanobot to ModelGo: Setup & Troubleshooting

nanobot is a lightweight terminal agent that configures providers and model presets in JSON, so it can call ModelGo through its OpenAI-compatible API. You need an API key from the ModelGo Console and a logical model ID from the Model Catalog.

1. Install

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

2. Configure a ModelGo provider

Merge these fields into ~/.nanobot/config.json, keeping your existing channels and tools settings:

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="mgk_your_api_key"

Set apiBase to https://api.modelgo.ai/v1; do not append /chat/completions.

3. Verify

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: confirm MODELGO_API_KEY is exported.
  • 404: apiBase must be exactly https://api.modelgo.ai/v1.

Related docs