Local or external provider without exposing the key
AI Chat uses local Ollama by default. You can point it at a service with your own key straight from the panel — no file editing, no platform restart.
In the panel (per bot)
Settings → “AI provider”. Pick the service, endpoint and model, paste your key, then hit “Test connection” before saving: the button shows the real reason a call failed (HTTP status and what the service replied) instead of a generic “ok”.
- Local Ollama — no key, no cost
- OpenAI, Groq, OpenRouter, DeepSeek, Together, LM Studio, vLLM, llama.cpp, LiteLLM
- Anthropic
- Google Gemini
- Your own service (custom)
- — The key is write-only: it goes in and never comes back. The panel only shows the last 4 characters.
- — Changing the endpoint with the key field left empty keeps the key you already saved.
- — The configuration only takes effect when the bot restarts — the provider is resolved when the plugin is built.
- — Only the bot's owner sees this section. The platform checks ownership on read and write.
- — If the configuration is invalid, the bot still starts and only the AI reply is switched off.
On the server (global)
Applies to every bot and is what the plugin falls back to when a bot has no configuration of its own. `external` is still available for existing setups: exact URL + Bearer.
AI_PROVIDER=external
AI_ENDPOINT=https://your-endpoint/v1/generate
AI_API_KEY=write-only-key
AI_MODEL=model
AI_TIMEOUT_MS=15000
AI_RATE_LIMIT_PER_MINUTE=12
AI_ALLOWED_ACTIONS=follow,come,stop,collect,equipSafety rules
- ✓ The key never uses NEXT_PUBLIC_ and never returns to the browser — not even in the response that confirms the save.
- ✓ It lives in a permission-restricted file (0600), not in the database.
- ✓ Responses pass through schema and size limits.
- ✓ attack and mine are blocked by default.
- ✓ Delay, onlyWhisper, and per-player rate limits are enforced.
For local Ollama
AI_PROVIDER=ollama
OLLAMA_URL=http://127.0.0.1:11434
AI_MODEL=llama3.2:1bIf the AI doesn't answer
The chat swallows errors on purpose (an AI failure must not take the bot down), so silence in chat is the normal behaviour when something breaks. Use “Test connection”: it reports the status and the detail the service returned. If the test passes and chat still doesn't answer, check that the requested action is on the allowlist.