AiMetrics

Lightweight, on-device assistant metrics (SoT §36/§37). Tracks how often the deterministic path handles a request vs. how often we fall back to the model, plus model latency — so we can verify "deterministic commands cost 0 LLM calls" and later judge whether prefix-caching actually helps. No data leaves the device; only aggregate counters are logged.

Functions

Link copied to clipboard
fun recordLlm(latencyMs: Long, ok: Boolean, promptChars: Int)

One model invocation completed (or failed).

Link copied to clipboard

One user request entered the pipeline (deterministic or not).

Link copied to clipboard

Human-readable snapshot (e.g. for a debug/settings readout).