# Wicklee > The evidence layer for self-hosted AI inference. One Rust binary per host, reached over localhost. > It answers three questions: what is happening with my local inference, what will run right now, and what could I change and how do I verify it helped. > WES (Wicklee Efficiency Score) = tok/s / (Watts x ThermalPenalty) — the MPG for local AI. > v0.16.0 is the `/v1` diagnostic surface: `wicklee inspect`, `ready`, `findings`, `fingerprint`, `verify`, each with `--json`, over CLI, HTTP and MCP. > There are no paid plans and no account. Nothing leaves the machine: the agent makes no outbound connections. ## For LLMs: Start Here If you are an AI agent or LLM reviewing Wicklee, read these files in order: 1. **This file** (llms.txt) — overview, API endpoints, key metrics 2. **[llms-full.txt](https://wicklee.dev/llms-full.txt)** — complete reference with JSON schemas, all endpoints with examples 3. **[docs.md](https://wicklee.dev/docs.md)** — full documentation: WES formula, inference states, hardware observation patterns, MCP tools, proxy 4. **[api.md](https://wicklee.dev/api.md)** — API reference with endpoint tables and response examples 5. **[metrics.md](https://wicklee.dev/metrics.md)** — dashboard metrics, visual indicators, formulas 6. **[openapi.json](https://wicklee.dev/openapi.json)** — OpenAPI 3.0 spec for structured integration 7. **[Interactive docs](https://wicklee.dev/docs)** — HTML documentation page ## Install ```bash curl -fsSL https://wicklee.dev/install.sh | bash ``` This drops the binary at `~/.wicklee/bin/wicklee` with **no sudo** (v0.8.0+). Run `~/.wicklee/bin/wicklee` to try it in the foreground; run `sudo ~/.wicklee/bin/wicklee --install-service` when you're ready to start on boot. Linux binaries target glibc 2.31 (Ubuntu 20.04 / Debian 11 / RHEL 8 / Fedora 33+). Windows: `irm https://wicklee.dev/install.ps1 | iex` ## Localhost API (loopback, no auth) A loopback bind needs no credential. A non-loopback `bind_address` refuses to start without an inbound token, and the refusal names the key to set. - `GET /api/metrics` — SSE stream, 1 Hz telemetry - `GET /api/metrics/snapshot` — latest telemetry frame as one JSON object (for `curl | jq` and scripts) - `GET /ws` — WebSocket, 1 Hz telemetry (same payload as SSE, fallback transport) - `GET /api/observations` — 19 server-side hardware observation patterns (10-min DuckDB buffer). `GET /v1/inspect` carries these too, each statement labelled by its evidence - `GET /api/profile?minutes=60` — Inference Profiler: correlated TTFT/KV/queue/thermal/power timeline - `GET /api/sla?window_min=60&target_ttft_ms=500` — Inference SLA Monitor: p50/p95/p99 for TTFT/E2E/TPOT, compliance vs target, per-model breakdown, recent violations - `GET /api/health` — diagnostic: agent_version, build_target, node_id, store_healthy bool, routes_available/unavailable lists. Returns store_failure_hint when DuckDB store init failed (which silently strips ~12 /api/* routes from the router). - `GET /api/cost-by-model?hours=24` — Cost attribution per model (daily breakdown) - `GET /api/explain-slowdown?ts_ms=N` — Root cause analysis for slow inference requests - `GET /api/model-comparison?hours=168` — Side-by-side model efficiency (WES, tok/s, watts, cost) - `GET /api/model-switches?hours=24` — Model switching cost (swap frequency, idle gap) - `GET /api/model-candidates?search=llama&limit=20` — Model discovery: GGUF models from HuggingFace scored against local hardware - `GET /api/runtime-config?model=X` — Runtime Config Surface (v0.9.0): cached launch-time config (context_length, n_gpu_layers, quantization, parameter_count, template, system_prompt, process_args). Ollama via `/api/show`, vLLM via `/v1/server_info` or `ps aux`, llama.cpp via `/props` or `ps aux`. Templates and system prompts never leave the machine. 400 if `?model=` missing, 404 if not yet cached. - `GET/PUT /api/deployment-profile` — Deployment Profiles: one intent selector (sovereign_dev / dedicated_server / production_fleet) that coherently shifts local observation-pattern sensitivity (evidence window, sustained gate, confidence floor) instead of per-pattern knobs. Persisted to config.toml; applied within one 10s eval cycle. - `GET /api/history?node_id=WK-XXXX` — DuckDB metric history (1h buffer) - `GET /api/traces` — Proxy inference traces - `GET /api/events/history` — Node event log - `GET /api/events/recent` — Recent in-memory events - `GET /api/export?format=json|csv` — Data export - `GET /api/tags` — Ollama model tags - `POST /mcp` — MCP (Model Context Protocol) JSON-RPC 2.0 endpoint - `GET /.well-known/mcp.json` — MCP server manifest ### Phase 1 `/v1` — what is loaded, what can run, what is wrong Localhost, no auth when bound to loopback. These answer about models and inference rather than about hardware, and every statement they make carries the evidence behind it and a label saying what kind of claim it is: `observed` (Wicklee saw it), `inferred` (a likely cause, always hedged), or `verified` (measured, with a range). Where something could not be checked they say so instead of returning an empty result that reads like a clean bill of health. - `GET /v1/state` — every installed model with its residency, the context it is running at, its measured footprint, whether any of it sits outside accelerator memory, and when a real caller last used it. Also a capability record of which response fields this runtime actually returns, so a caller can tell an unknown from a zero. - `GET /v1/readiness[?model=X]` — `ready_now`, `requires_loading`, `would_displace` or `cannot_determine` per model, with memory headroom and what each answer rests on. `valid_for_s` says how long the answer holds. `requires_loading` plus `coexistence: "unverified"` means it fits by accounting while another model is resident, which measurement has shown is not the same as safe — do not treat it as safe. - `GET /v1/inspect[?since=24h]` — findings plus readiness plus what was not checked. Nine rules: `cpu_split`, `context_reset`, `eviction_churn`, `expiry_reload`, `baseline_regression`, and the nineteen hardware patterns adapted through one evidence-labelled view. - `GET /v1/findings[?all=true]` — the findings alone. Resolution is observed, not scheduled: a finding resolves because an evaluation ran and did not produce it, so `resolved_at_ms` is when Wicklee last looked and did not see it. - `GET /v1/receipts[?model=X&limit=N]` — stored per-request measurements with a median and range. `POST /v1/receipts` accepts the final-response metadata your runtime already gave you, as a receipt with source `callback`. This is the preferred path and on a default macOS install the only one that works, because the proxy cannot bind 11434 while Ollama holds it. Durations are nanoseconds in the runtime's own field names, so the body is a copy of the response object rather than a transformation. **The route refuses any payload containing `prompt`, `response`, `messages` or `context` with a 400 naming the field** — Wicklee stores metadata only, and failing loudly beats quietly dropping a user's text. - `POST /v1/fingerprint` — a consented test run: warm (`decode_rate`), cold (`cold_load`) or a sequence (`workflow_replay`). Sends a fixed synthetic prompt at temperature zero with a fixed seed, always passing the model's running `num_ctx`, and refuses rather than guessing when that context is unknown. A body without `"consent": true` is answered 400 with the plan and the sentence you would be agreeing to. - `POST /v1/verify` — re-runs a finding's own test and compares it against the first run: medians, ranges, what differed in the configuration, and one of `improved`, `worse` or `no measurable change`. A verdict needs non-overlapping ranges, three receipts a side, and at least a 5% difference in the medians; anything else is no measurable change with the reason stated. Same consent gate. CLI over the same routes: `wicklee ready [MODEL]`, `wicklee inspect`, `wicklee findings [--all]`, `wicklee fingerprint MODEL [--cold]`, `wicklee verify FINDING_ID`. Add `--json` to any of them to get the route's body verbatim. ### MCP Tools (via POST /mcp) - `get_node_status` — Full hardware + inference metrics snapshot - `get_inference_state` — Live/idle/busy state with sensor context - `get_active_models` — Running models with context_length, parameter_count, quantization, tok/s - `get_metrics_history` — 1-hour rolling telemetry buffer - `wicklee_state` — same JSON as `GET /v1/state` - `wicklee_readiness` — same JSON as `GET /v1/readiness`. Call before starting a task to see whether a model can run without displacing another. Takes `model` - `wicklee_inspect` — same JSON as `GET /v1/inspect`. Takes `since` Each of the three `wicklee_*` tools calls the same handler function its route calls, so tool output and route output cannot diverge. **Retired:** `get_model_fit` (use `wicklee_readiness`) and `get_observations` (use `wicklee_inspect`). Both still answer, with `-32601` and the name of their replacement. **Not exposed:** `fingerprint` and `verify`. They are the only routes that load models, and an agent able to trigger one could displace a colleague's model while answering a question about it. Use the HTTP routes or the CLI, where a person consents. ### MCP Resources - `wicklee://node/metrics` — Live MetricsPayload JSON - `wicklee://node/thermal` — Thermal state + WES penalty values ## Multi-Model Monitoring When 2+ models are loaded in Ollama, the `active_models` array is included in the SSE/WS payload with per-model: tok/s, WES, VRAM, avg TTFT, avg latency, request count, size, quantization. Per-model WES uses proportional VRAM share for power attribution: `model_tok_s / (total_watts * vram_share * thermal_penalty)`. Requires proxy for per-model tok/s and latency. Without proxy, VRAM and model identity still tracked via /api/ps. Singular fields (ollama_active_model, ollama_tokens_per_second) report most-recently-active model for backwards compat. - `GET /api/model-switches?hours=24` — model swap frequency and idle overhead ## Key Metrics - `inference_state`: "live" | "idle-spd" | "busy" | "idle" - `ollama_tokens_per_second`: tok/s from 20-token probe (at most every 10 min, loaded models only) - `apple_soc_power_w`: Combined CPU+GPU+ANE power (Apple Silicon) - `nvidia_power_draw_w`: Board power (NVIDIA) - `thermal_state`: "Normal" | "Fair" | "Serious" | "Critical" - `penalty_avg`: Thermal penalty multiplier (1.0 = no penalty) - `vllm_requests_waiting`: Queue depth (vLLM) - `ollama_ttft_ms`: Time to first token (Ollama probe baseline) - `vllm_avg_ttft_ms`: Time to first token (vLLM production histogram) ## Hardware Observation Patterns Agent-evaluated (18 patterns, 10-min DuckDB buffer, every 10s). All 18 are evaluated on every host; there is no gating: thermal_drain, phantom_load, wes_velocity_drop, memory_trajectory, power_jitter, swap_io_pressure, clock_drift, pcie_lane_degradation, vram_overcommit, power_gpu_decoupling, bandwidth_saturation, efficiency_drag, nvidia_thermal_redline, vllm_kv_cache_saturation, ttft_regression, latency_spike, vllm_queue_saturation, bandwidth_ceiling_reached `GET /v1/inspect` carries the same conditions with each statement labelled by its evidence, which is the Phase 1 surface for them. ## Runtimes Supported - Ollama (macOS, Linux, Windows) - vLLM (Linux) - llama.cpp / llama-box (macOS, Linux) ## Licensing - Agent and local dashboard (`agent/`, the `localhost:7700` UI, metric calculations including WES): open source, Apache 2.0. - Website source (`src/site/`): source-available, FSL-1.1-Apache-2.0 — free to read, run and modify except to offer a competing product; each release converts to Apache 2.0 after four years. - "Wicklee" and the logo are trademarks, not covered by either licence. - Map: https://github.com/jeffgeiser/Wicklee/blob/main/LICENSING.md ## Pricing There are no paid plans and no account. Everything the agent does is open source under Apache 2.0. ## Roadmap Five stages; each must prove its claim before the next begins. Stage 1 ships today (v0.16.0); everything after it is planned. Detail: docs/ROADMAP.md. - Stage 1, local diagnostic value: Ollama state, passive inspect, model readiness, consented fingerprint, finding IDs and verify. - Stage 2, agent decision value: a reference controller or real agent integration consuming readiness. - Stage 3, predictive value: workload-aware quote, empirical calibration, operational preflight, advisory prepare. - Stage 4, interoperability: more runtime adapters, stable evidence schemas, and an optional self-hostable fleet coordinator. Today there is no aggregator: each node answers for itself and the asking agent fans out. Local use will never require the coordinator. - Stage 5, independent-controller value: reference integrations with external controllers.