// CONTENTS Part 10 · AI operations

// PART 10

Model providers

Chapter 41 / 60 2 min read English Part 10 of 15

LLM settings have one source of truth: Vault. Environment variables and config.csv are fallbacks and per-bot behavior, never the credential store.

Where settings live

Scope Location Fields
Global fallback Vault secret/gbo/llm url, model, openai_key (+ provider keys)
Per-bot Vault secret/gbo/{org_id}/{branch_id}/{bot_id} llm-url, llm-server, llm-key, llm-model, llm-provider, system-prompt, history-limit
Environment fallback LLM_URL / LLM_MODEL / LLM_KEY used only when Vault has no value
Per-bot behavior the bot’s config.csv llm-url, llm-model, llm-key, temperature/token knobs

Resolution: per-bot Vault path → nil path → global secret/gbo/llm → environment. The provider is auto-detected from the URL pattern; all LLM settings are read through ConfigManager::get_config().

# Set the global fallback
vault kv put secret/gbo/llm url=<chat-completions-url> model=<model> openai_key=<api-key>

# Set a per-bot override (resolve ids from the database, not from memory)
psql -h localhost -U postgres -d botserver -c   "SELECT org_id, branch_id, id FROM bots WHERE name = '<bot>';"
vault kv put secret/gbo/<org_id>/<branch_id>/<bot_id>   llm-url=<chat-completions-url> llm-model=<model> llm-key=<api-key>

# The provider is built at boot — restart to apply
sudo incus exec bot -- systemctl restart botserver

Local models

The bundled engine is llama.cpp, pinned per platform in botserver/3rdparty.toml (b7345 for Linux x86_64 CPU/Vulkan, macOS and s390x; b12189 for Linux arm64; b12483 for Windows with CPU, CUDA 12.4/13.5 and Vulkan variants). The models the wizard fetches are DeepSeek R1 Distill Qwen 1.5B (Q3_K_M) for chat and BGE Small EN v1.5 (bge-small-en-v1.5-f32.gguf) for embeddings, both checksum-enforced. GGUF quantizations Q3_K_M/Q4_K_M/Q5_K_M trade size for quality; F16/F32 are full precision.

Server knobs in config.csv:

Key Effect
llm-server-gpu-layers layers offloaded to GPU (0 = CPU only)
llm-server-ctx-size context window; more context = more memory
llm-server-parallel concurrent requests
llm-server-cont-batching continuous batching for multi-user throughput
llm-cache / llm-cache-ttl / llm-cache-semantic / llm-cache-threshold response caching, including similarity-based hits

Timeouts an operator should know

Variable Default Meaning
LLM_READ_TIMEOUT_SECS 120 first-chunk read timeout — the knob when a provider stalls before the first token
LLM_TURN_TIMEOUT_SECS 300 per-turn ceiling — a CPU-only provider must prefill the whole prompt before the first token, so the ceiling is configurable

BotModels (media)

Vision, STT and TTS run in the BotModels Python service, reached through BOTMODELS_URL / BOTMODELS_API_KEY (its own .env carries the model paths and engine selections). BASIC keywords IMAGE, VIDEO, AUDIO, SEE call it; /api/product reports media_capabilities.botmodels.available with the platform reason when it is not available (no darwin pythonbox, no aarch64 archive).

Found a mistake? Open an issue · All books

// SEARCH ESC
Pagefind · 236 pages · 4 books Enter to open ↑ ↓ to move