LLM Configuration π‘ BETA
Resolve the LLM provider from Vault first, verify the consumer in source, and prove a real completion after a change.
Admin guide Β· LLM configuration runbook
| When to use | Before you start | Steps | Verify | Roll back |
|---|---|---|---|---|
| Changing provider, model or key, diagnosing a failed completion | Vault write access, test session | Read source, set Vault, restart if needed, complete a turn | Completion succeeds, no secret in files | Restore prior Vault value, re-run check |
When to use
Use this runbook when completions fail or when provider configuration must change.
Before you start
- LLM settings are read from Vault at
secret/gbo/{org_id}/{branch_id}/{bot_id}, then the nil path, then the globalsecret/gbo/llm. Fields includellm-url,llm-server,llm-key,llm-model,llm-provider,system-promptandhistory-limit. - Environment variables (
LLM_URL,LLM_MODEL,LLM_KEY) are a fallback only when Vault has no value. - The provider is built at boot: a Vault-only change needs a restart of the caching process. A bot's
config.csvedit reloads on ETag change without a restart. - Do not copy a model name, context size or performance number from an older page. Read the value from the deployment or the source.
Steps
# 1. Find the consumers of the LLM keys before changing anything.
grep -RIn "llm-url\|llm-model\|llm-key" botserver/src botserver/crates \
--include='*.rs' | head -30
# 2. Read the per-bot ids from the database; never from memory.
psql -h localhost -U postgres -d botserver -c \
"SELECT id, name, org_id, branch_id FROM bots WHERE name = '<bot>';"
# 3. Read Vault credentials without printing the secret value.
source <(grep -E '^VAULT_' "${WORKSPACE}/.env")
export VAULT_ADDR="$VAULT_ADDR"
export VAULT_CACERT="${WORKSPACE}/botserver-stack/conf/system/certificates/ca/ca.crt"
export VAULT_TOKEN=$(cat /tmp/vault-token-gb 2>/dev/null || echo "$VAULT_TOKEN")
VAULT_BIN="${WORKSPACE}/botserver-stack/bin/vault/vault"
# 4. Update the per-bot path with the new chat-completions URL and model.
# VAULT_BIN kv put secret/gbo/<org_id>/<branch_id>/<bot_id> \
# llm-url=<url> llm-model=<model>
# 5. Restart the process that cached the provider, then complete one turn.
sudo incus exec <container> -- systemctl restart botserver
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/health
Verify
| Check | Command / surface | Pass condition |
|---|---|---|
| Consumer | source grep | key is read by the LLM path |
| Scope | bots query |
per-bot path uses the resolved ids |
| Vault | vault kv get |
new value stored, old key removed |
| Restart | process start time | provider rebuilt after a Vault change |
| Completion | one chat turn | response streams without an auth error |
| Logs | botserver.log |
no credential printed |
Roll back
π΄ Put the previous Vault values back and restart the caching process again, then complete a turn. A leaked key is revoked at the provider and recorded through the rotation runbook and incident response.