Skip to content

Set up the analyst Since v0.2 ​

The analyst needs a model server. The managed setup uses llama-server from llama.cpp, which the product starts and watches. An external setup calls a model server you run yourself.

Before you begin ​

  • Role: administrator. The analyst section (like management and ha) is changed by administrators only, on every route: the settings form, a whole-document apply or import, a preview, a rollback and a pull all refuse a change to it from an operator. So nobody below admin can point managed.binary at another program.
  • Hardware and a model chosen: see Models and providers.

Install the runtime and the model ​

  1. The runtime. Install llama-server from llama.cpp (MIT). It is a separate program and not part of the Spalto package. On macOS: brew install llama.cpp. On Linux, use your distribution's package or a release from github.com/ggml-org/llama.cpp. Note the path (which llama-server).
  2. The model. It is not shipped with the product. Fetch it, or bring it.
  3. If you run a model server somewhere else (a GPU host), skip step 1 and use an external runtime (below).
sh
waap analyst model list
waap analyst model fetch -dir /var/lib/waap/models qwen3-8b

fetch downloads into /var/lib/waap/models by default (-dir DIR for another place), shows progress, and checks the size and SHA-256 pinned in the product. On a mismatch the file is discarded, and nothing half-downloaded is left behind.

Offline sites. Download the same file elsewhere (the Hugging Face repository Qwen/Qwen3-8B-GGUF), carry it on a disk, then import it. The file is checked against the same pinned SHA-256 and copied into place.

sh
waap analyst model import -dir /var/lib/waap/models Qwen3-8B-Q4_K_M.gguf

Both commands print the exact waap settings set analyst ... line to use next.

Turn it on and configure it ​

text
1. Open Monitor > Analyst > Settings and status (global administrators).
2. Choose the provider, or fill in the runtime fields. Help is under every field,
   and values are checked before saving.
3. Select Preview changes, add a comment and select Apply.
4. Select Send test prompt.
sh
waap settings get analyst
waap settings set analyst -m "enable analyst" enabled=true managed.binary=/opt/homebrew/bin/llama-server managed.model_file=/var/lib/waap/models/Qwen3-8B-Q4_K_M.gguf
waap analyst test
yaml
# analyst in the configuration
analyst:
  enabled: true
  runtime: managed
  managed:
    binary: /opt/homebrew/bin/llama-server
    model_file: /var/lib/waap/models/Qwen3-8B-Q4_K_M.gguf

Settings reference ​

Runtime ​

SettingWhat it doesDefaultAllowed valuesApplies in
enabledMaster switch.falsetrue, falseall
runtimemanaged: the product starts and restarts llama-server. external: you run a model server and the product only calls it.managedmanaged, externalall
endpointManaged: the loopback port the product starts the server on. External: where it listens.127.0.0.1:8091host:port or http://host:port (loopback only), unix:/abs/path, https://host:port (needs ca_file)all
providerA catalog id (waap analyst providers). Empty: use runtime and the keys below. A local provider fills in the runtime and its usual address. A cloud provider needs cloud.opt_in and api_key_file.emptycatalog idall
cloud.opt_inYour consent that questions and event data (secrets masked) go to the chosen cloud provider. Refused without it.falsetrue, falsecloud provider
modelModel name sent to the server.qwen3-8btextall
ca_filePEM file of the CA that signed an external https endpoint. Plain http off the loopback is refused.emptyabsolute pathexternal https
api_key_fileA file holding the key your model server or vendor expects as a bearer token (the first line that is not empty or a # comment). Never shown, logged or stored in the configuration; only the path is. A replaced file is picked up at the next question.emptyabsolute pathexternal runtime or cloud provider; refused for a managed runtime, which gets its own key

Managed runtime ​

SettingWhat it doesDefaultAllowed valuesApplies in
managed.binaryAbsolute path of llama-server.emptyabsolute pathmanaged
managed.model_fileAbsolute path of the .gguf file.emptyabsolute pathmanaged
managed.threadsCPU threads.0 (automatic)0 to 1024managed
managed.contextContext size in tokens. Bigger uses more memory.16384at least 2048, at most 1048576managed

Limits ​

SettingWhat it doesDefaultAllowed valuesApplies in
limits.tool_callsLook-ups the model may make for one answer.8up to 32all
limits.rowsRows in one look-up result.25up to 500all
limits.tool_bytesSize of one look-up result. A bigger result costs seconds of prompt processing on small hardware (16 KiB was about 18 s on an M1 Pro with the 8B model). Raise it on faster hardware.8 KiBup to 256 KiBall
limits.answer_tokensLongest answer: a safety cap against a model that keeps writing, not a target. It must fit in managed.context with the question and look-ups.4096up to 16384all
limits.timeoutTime allowed for one answer. A local 8B model on a laptop writes about 20 tokens per second, so a 4096-token answer needs about 3.5 minutes.5m5s to 15mall
limits.tool_timeoutTime allowed for one data look-up. A look-up that takes longer fails with timeout, and the model may retry. Narrowing the question to one application and a time window is the first remedy.10s1s up to limits.timeoutall
limits.queueQuestions allowed to wait. More are refused with "busy".4up to 1024all
limits.parallelAnswers generated at once. Each gets the whole context, so more means more memory.1up to 64all

Daily digest ​

SettingWhat it doesDefaultAllowed valuesApplies in
digest.enabledWrites a daily digest.falsetrue, falseactive node
digest.atTime of day, in the control plane's local time.07:00HH:MMdigest.enabled
digest.appsApplications to write for. Each must exist, so an application listed here cannot be deleted until you remove it from the list.empty (all)up to 64 application namesdigest.enabled

An explicit stored limits.* value is kept when defaults change.

How the managed runtime behaves ​

A managed runtime must use a loopback TCP port. The product starts llama-server bound to 127.0.0.1 only, with the tool-call template, one slot per parallel answer, an 8-bit key/value cache, flash attention, a 1 GiB prompt cache, and the server's own web page and slot listing switched off.

  • Restarts. If the process exits, it restarts with a growing delay (1 s up to 1 min). Health is checked every few seconds.
  • A hung process. Three failed health checks in a row after it was healthy, or not healthy within 120 s of starting (which allows for loading the model), stop it and restart it with the same growing delay.
  • A private key. Every start gets a new random API key (256 bits), handed over in a file only the product's user can read, in a private temporary directory removed when the process stops. It is never on the command line, in a log or in the status, so another local program cannot use the model server.
  • Port check. Before each start the product checks the port. If another process holds it (often a llama-server left over after the product was killed), nothing is started, the status says "port in use by another process", and it checks again every minute instead of restarting in a loop. Stop that process (lsof -i :8091) or choose another port.

External runtime ​

To use a model server you run yourself, set runtime: external, the endpoint, the model, and ca_file and api_key_file if the server needs them.

sh
waap settings set analyst -m "external model server" enabled=true runtime=external endpoint=https://gpu1.example:8443 ca_file=/etc/waap/gpu-ca.pem model=qwen3-14b

The server must support tool calls (llama-server needs --jinja).

Check the status ​

The Settings and status tab shows whether the analyst is on, whether the model answers, the model name, the process state (running, healthy, restarts, last problem, port in use), the queue, and the speed of the last answers (tokens per second). These details are for administrators.

For everyone else, GET /v1/analyst/status and waap analyst status show only whether the analyst is on and answers, the model name and the queue. The endpoint, error messages (which hold paths and addresses), the process details and the last answer's timing are left out.

Send test prompt (or waap analyst test) asks the model a tiny question. Do it after every change. The model is also checked before every question, so a stopped model gives a clear message at once.

Troubleshooting ​

SymptomCauseFix
Status says "port in use by another process"Another process holds the managed port.Stop it (lsof -i :8091) or choose another port.
Questions are refused with "busy"More questions waiting than limits.queue.Wait, or raise limits.queue.
A look-up fails with timeoutA slow event store or a wide question.Narrow the question to one application and a time window, or raise limits.tool_timeout.
The configuration is refused for a cloud providercloud.opt_in is off, or no api_key_file.Set both.