Vai al contenuto principale
Una CLI per agenti IA leggera. Repo ufficiale: https://github.com/HKUDS/nanobot
Protocollo: compatibile con OpenAI
  • Base URL: https://api.orcarouter.ai/v1 (deve includere /v1)

Installazione

Richiede prima uv, poi installa il comando nanobot:
uv tool install nanobot-ai

Configurazione

Modifica ~/.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"
    }
  }
}

Esecuzione

nanobot agent -m "Reply with exactly: OK" --no-logs --no-markdown
Aspettati la risposta OK.

Note

  • Usa il provider predefinito customnon inventare un nome di provider tuo. I nomi personalizzati vengono ignorati e ottieni un errore provider 'None'.
  • Non aggiungere un campo apiType al provider custom. Solo il provider integrato openai supporta apiType; aggiungerlo a custom fallisce la validazione.
  • Il base URL mantiene il /v1 finale, e agents.defaults.provider deve essere impostato su custom.
  • I nomi dei modelli usano il formato vendor/model. Sostituisci orcarouter/auto con un modello specifico come anthropic/claude-opus-4.8 o google/gemini-2.5-flash.

Abilitare thinking / reasoning

Imposta reasoningEffort sotto agents.defaults (o una voce modelPresets). Valori validi: none / low / medium / high / max. Omettendolo (o null) si segue il default del modello.
{
  "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 deve essere maggiore del budget di thinking. nanobot traduce reasoningEffort: high in un thinking.budget_tokens di Anthropic; se maxTokens (ad es. il default 4096) è più piccolo, l’upstream restituisce 400 max_tokens must be greater than thinking.budget_tokens. Aumentare maxTokens a ~16000 risolve il problema. (Verificato: restituisce ✻ 391.)