Docs

Models & routing

Bots run on the CLIs you already use, on API keys or on your own server. The Laya router picks who answers in a channel, and which model and effort a bot set to auto uses.

Engines

  • Host CLIs: claude, codex and grok, supervised by kwant, with their own file and shell tools.
  • Provider APIs: Anthropic, OpenAI and xAI keys.
  • Ollama: models you've pulled into a local Ollama server, with no account or key.
  • Custom API: any server that speaks the OpenAI chat API (OpenRouter, LM Studio and others) or the Anthropic Messages API.

Each bot has a preferred model. Set it to auto and kwant picks the model and effort for every message.

Ollama (local models)

kwant talks to Ollama at http://localhost:11434. To use another address, change Ollama Base URL under Settings → API keys and Ollama, or set OLLAMA_URL. The engine shows as ready once the server answers and has at least one model pulled, for example with ollama pull llama3.2.

Pick Ollama in a bot's model setting to use your default model, the one in OLLAMA_MODEL or else the first one pulled, or pick a pulled model by name. Ollama bots can use MCP tools. When a bot is set to auto and a message asks to keep things on this machine, for example "keep this private" or "offline", the router can keep it on Ollama, if Ollama is ready.

Accounts

Each engine can have several accounts, with a default, a priority order and automatic failover when one runs out of usage. See Accounts & profiles.

The Laya router

Laya picks which bot answers in a channel, and which model and effort a bot set to auto uses. It's a small Python service, and kwnt serve manages it for you:

  1. On first run it installs laya[serve] into ~/.kwnt/laya/venv, with uv when present or python3 -m venv otherwise.
  2. It starts laya-serve and downloads the English checkpoint (about 420 MB) on first start.
  3. It restarts Laya if it exits, and stops it when kwant shuts down.

The header shows the router's status: green online, amber installing or loading, red offline. While Laya is unavailable, kwant routes by keyword and says so on the routing card.

Settingconfig.tomlEnvironmentDefault
Laya URLlaya_urlLAYA_URLhttp://127.0.0.1:8000
Manage a local Layalaya_managedKWNT_LAYA_MANAGED=0 or --no-laya to disableon
Checkpoints to preloadlaya_modelsKWNT_LAYA_MODELSenglish
Existing laya-serveKWNT_LAYA_SERVE_BIN

kwant only starts Laya for loopback URLs. If Laya already answers, for example from Docker, kwant uses it as is.

Behind a proxy that blocks Hugging Face? Start kwant once on an open network, or copy an existing ~/.kwnt/laya/hf from another machine. After that, Laya starts offline.