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.
  • 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.

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.