Skip to content
FlyCockpit
WS Model Proxy/ Nodes & Runtimes
WS Model Proxy logo

Nodes, Trust Tiers & Runtimes

WS Model ProxyRust + TypeScriptMIT
Repository

Understand the wsmp daemon, Relay-only vs Full-control trust boundaries, hardware detection, versioned runtimes, multi-node profiles, node secrets, and the full CLI reference.

Platforms: Linux, macOS, Windows (node) · Docker (server)

A node is any computer running wsmp. It maintains a single outbound WebSocket to your WS Model Proxy server, reports its hardware and runtime inventory, relays inference traffic to local model servers, and—when granted Full control—manages runtime lifecycles, shell commands, file operations, and browser terminals.

wsmp Daemon Architecture

  • Outbound relay: wsmp connects to wss://<server>/api/cli/ws using relay protocol 4.0 (ws-model-proxy.relay.v4) and sends a heartbeat every 20 seconds. If the connection drops, it reconnects automatically with exponential backoff from 1 second up to 5 minutes (with jitter).
  • Per-user service:
    • Linux: Installs a systemd user unit (wsmp.service) and enables systemd lingering (loginctl enable-linger <user>) so the node stays online after logout and starts at boot. Startable runtimes run as transient systemd user units inside per-rank slices (wsmp_i_*), which also require lingering.
    • macOS: Installs a launchd LaunchAgent (com.flycockpit.wsmp) logging to ~/Library/Logs/ws-model-proxy/relay.*.log.
    • Windows 11: Installs a Task Scheduler task (wsmp-relay-<account SID>) that starts at user logon without admin rights or a console window and logs to %LOCALAPPDATA%\ws-model-proxy\logs\relay.log (10 MiB rotation, 4 archives). It stops at logoff.
  • Pinned PATH hygiene: wsmp service install pins your shell’s absolute PATH entries while excluding world-writable directories and session-ephemeral paths (/run/user/<uid>, /tmp, /var/tmp, macOS /var/folders, and fnm_multishells). For fnm, it substitutes the default alias (fnm default <version>).
  • Non-root Linux policy: wsmp service install and interactive wsmp login refuse to run as root. Create a dedicated user (for example wsmp) in the video and render groups and enable lingering. For containers that must run as root without a service, enroll with --no-service and run wsmp run in the foreground (file tools stay off unless explicitly enabled with wsmp config set-file-tools-as-root on).

Hardware Detection and Unified Memory Placement

Run wsmp hardware (or wsmp hardware --json) to inspect what the node detects and reports to placement:

  • OS physical RAM (memoryGb): Total physical RAM (MemTotal plus BIOS VRAM carve-out on AMD APUs, hw.memsize on Apple silicon).
  • Accelerator memory (acceleratorMemoryGb): Dedicated GPU VRAM, AMD APU carve-out + GTT (capped by kernel TTM limits), Apple silicon wired GPU memory limit, or MemTotal on unified NVIDIA GB10 systems.

Placement enforces both budgets on unified nodes:

  • Subtracts 2 GiB OS headroom, reserved RAM, and reserved unified VRAM from physical RAM.
  • GPU-side claims (unified GPU VRAM and unified-kind runtime entries) consume both usable RAM and the shared accelerator budget (acceleratorMemoryGb minus unified reserved VRAM).
  • CPU entries (ramGb) and discrete GPU host RAM consume RAM only—and cannot use an AMD APU’s BIOS VRAM carve-out.
  • Operator hardware overrides declared in the web UI or via MCP always win over node config and auto-detection. On unified nodes, declare acceleratorMemoryGb (not memoryGb) to adjust the GPU-side cap.

Note: On Linux AMD APUs, default kernel GTT/TTM limits often cap GPU-addressable memory at roughly half of physical RAM. Raise ttm.pages_limit and ttm.page_pool_size (measured in 4 KiB pages; 1 GiB = 262144 pages, so 120 GiB = 31457280) as kernel boot parameters and reboot, then recheck wsmp hardware.

Trust Tiers: Relay-Only vs Full Control

Every node grants the server one of two trust levels, chosen during wsmp login and changeable at any time:

Capability Relay only Full control
Relay /v1/* requests to held runtimes Yes Yes
Start and stop already-held runtime definitions Yes (people only; agents refused) Yes
Push new or updated runtime definitions Frozen at downgrade Yes
Run one-off node commands & metric commands No (running commands stop on downgrade) Yes
Node file tools (read/write/edit) No Yes (within configured roots)
Browser terminals No Optional (--human-terminal on)
Set node secrets from server / remote self-update No (local CLI only) Yes

The Node-Local Escalation Boundary

wsmp trust          # print current trust level
wsmp trust relay    # lower trust immediately (allowed from anywhere or the dashboard)
wsmp trust full     # raise trust (interactive terminal at the node only)

Lowering trust takes effect immediately—even remotely from the dashboard—and freezes held runtime definitions while cancelling running node commands.

Raising trust to Full control can only happen locally at the node. wsmp trust full requires interactively typing full, accepts no --yes flag or environment override, and refuses execution from any process started by wsmp (anything inheriting WSMP_JOB, inside wsmp.service / wsmp_i_* / systemd-run cgroups, descending from the relay, or detached from a login session such as cron, at, or cloud-init). The same guard covers wsmp secret set|remove, wsmp config set-*, wsmp service install|uninstall|restart, wsmp logout, wsmp terminal approve, wsmp recover --apply, and wsmp update.

Warning: This check is a best-effort guard against agents escalating their own privileges through the server—not an OS sandbox. Anything executed at Full control runs as your OS user account and can inspect credentials, edit files, or install persistent user services that survive lowering trust. If you distrust what ran at Full control, reinstall the node.

Runtimes

A runtime is a versioned inference server (or resource-claiming service) definition managed on the server and synced to nodes (up to 128 held definitions per node).

Runtime Types and Supported Engines

  • Always-on runtimes (address): Point at an inference server already managed outside WMP (baseUrl, optional auth referencing a WSMP_SECRET_*, and custom headers). WMP probes health automatically and never starts or stops it. By default only loopback hosts are permitted unless extra hosts are added with wsmp config set-runtime-hosts.
  • Startable runtimes (launch): Define commands and resource requirements that WMP starts and stops across one or more nodes. Built-in presets cover vLLM (chat, embeddings, speech-to-text), SGLang, llama.cpp, Docker Compose, Ollama, LM Studio, and custom engines (other).
    • management: "process": The node owns the process inside its per-rank systemd user slice (or Windows job object). A stop command is optional; WMP terminates everything in the slice (SIGTERM, then SIGKILL after 10 s) and proves all processes exited and reserved ports are free. Daemonizing inside a process runtime fails with process_detached.
    • management: "service": For engines that hand off to another supervisor (such as Docker Compose or systemd services). Requires explicit stop and status commands (status exits 0 when running and 3 when stopped; stub commands like true or exit 0 are rejected).

Example Docker Compose service launch block:

{
  "management": "service",
  "commands": [
    {
      "start": "cd /srv/llm && docker compose up -d",
      "stop": "cd /srv/llm && docker compose down",
      "status": "cd /srv/llm && out=$(docker compose ps --status running -q) || exit 1; [ -n \"$out\" ] || exit 3"
    }
  ]
}

Multi-Node Runtimes, Reservations, and Placeholders

Startable runtimes support single-node or multi-node launches (groupSize 1–64 with fabric networking), an idempotent prepare step (ideal for fetching model weights so profiles work on fresh nodes), optional afterJoin, readiness and health probes, interactive steps (run by a human in an operator terminal), and up to 8 cross-node reservations (for launchers that SSH into worker nodes themselves).

Available command template placeholders:

  • {{port}}, {{dist_port}}
  • {{node_rank}}, {{nnodes}}, {{head_addr}}
  • {{memory_gb}}, {{gpu_ids}}, {{vram_gb}}, {{memory_fraction}}
  • {{fabric_ip}}, {{fabric_iface}}, {{fabric_rdma_device}}

Every runtime command runs in a scrubbed environment populated with declared launch.secrets, CUDA_VISIBLE_DEVICES / HIP_VISIBLE_DEVICES (with CUDA_DEVICE_ORDER=PCI_BUS_ID), and WSMP_RESERVATION_COUNT / WSMP_RESERVATION_<index>_{NODE,NODE_ID,GPUS} when reservations are attached.

Versioning, Stop Proofs, and Request Compatibility

  • Immutable versions: Every definition edit creates a new version. Limit edits apply live; launch changes require restarting running instances (restartRunning).
  • Stop proofs: Stopping instances keep their memory, GPU, and port claims reserved until the node proves the stop (empty slice/job + free ports, plus status exit 3 for service runtimes). If a node cannot prove a stop (for example port_held_outside_runtime or offline for 10 minutes), the instance shows needsOperator: "MARK_STOPPED". Only a human can force-free unproven capacity via Release resources.
  • Request compatibility (compat): WMP inspects each ready loopback engine’s /openapi.json (and learns from HTTP 400 rejections) to drop unknown non-semantic fields automatically (unknownFieldPolicy: "auto" | "forward" | "strict"). Semantic fields (tools, structured outputs, reasoning controls, sampling parameters) are never dropped unless listed in allowDropSemanticFields. Up to 32 rewriteRules (rename, drop, default, clamp, mapRole) can also be configured per runtime version.

One-Click Profiles and Placement Previews

Profiles pin exact runtime versions onto a chosen set of owned nodes so you can switch your entire fleet between workloads (for example coding models vs batch transcription) in a single click.

  • Placement previews: Both starting a runtime and applying a profile support a preview step that calculates free RAM, accelerator memory, GPUs, ports, node labels, reservations, and which running instances would be stopped before you confirm.
  • Hold lines: Humans can mark a node as on hold in the web app so automatic placement and profile applies leave it untouched.

Node Secrets

Secrets required by runtimes (such as Hugging Face tokens or upstream API keys) are stored locally on the node—never sent to or stored in the WMP database. The server sees only secret names (WSMP_SECRET_ followed by 1–64 uppercase letters, digits, or _).

wsmp secret set WSMP_SECRET_HF_TOKEN   # prompts with hidden input
wsmp secret list                       # prints names and timestamps, never values
wsmp secret remove WSMP_SECRET_HF_TOKEN

At Full control, the web UI or an authorized agent (node_secret_set) can also write secrets to the node without ever reading them back.

Remote Self-Update and Browser Terminals

  • Node self-update: Full-control nodes running via wsmp service install can be updated from the Nodes page (Linux, WSL, macOS; Windows when WMP_AGENT_UPDATE_WINDOWS=true) or locally via wsmp update. For script installs, wsmp downloads the archive beside the binary, verifies its SHA-256 and --version, saves the current binary as wsmp.prev, arms a persistent rollback deadman timer (180 s default, survives reboots), restarts (exit code 75), and confirms once connected and healthy for 30 seconds. Unconfirmed builds roll back automatically. Disable browser-triggered updates with wsmp config set-remote-updates off.
  • Browser terminals: Enabled opt-in via --human-terminal on or wsmp config set-human-terminal on at Full control only. Supports optional per-browser identity approval (wsmp config set-terminal-approval on), concurrency caps (wsmp config set-max-terminals <1-32>), and shell selection on Windows (pwsh, powershell, cmd, wsl:<distro>).

wsmp CLI Reference

Commands that print data accept --json (except wsmp service). Logs write to stderr (-v, -vv, -q, --log-format json).

Enrollment and Lifecycle

Command Description
wsmp login <url> [--code <code>] Enroll this node. Flags: --slug <name> (3–63 lowercase alphanumeric + hyphens), --trust full|relay, --human-terminal on|off, --service / --no-service, --replace (confirm Replace code), --yes (-y, still requires --trust), --json. Also reads WSMP_ENROLL_CODE.
wsmp status Show relay connection state, service/lingering warnings, held runtimes, and instances.
wsmp hardware Print detected OS memory, accelerator memory, GPUs, and placement notes.
wsmp run Run the relay in the foreground (used by the service unit).
wsmp logout Forget this node’s local credential.

Service, Trust, Secrets, and Runtimes

Command Description
wsmp service install|uninstall|restart|status Manage the per-user systemd unit, launchd agent, or Windows scheduled task.
wsmp service logs [-f] [-n <lines>] View relay service logs (default 100 lines).
wsmp trust [relay|full] Inspect trust, lower to Relay only, or interactively raise to Full control.
wsmp secret set|list|remove [<name>] Manage node-local WSMP_SECRET_* values.
wsmp runtime list List locally held runtimes and instances (phase, ports, units, stop proof).
wsmp runtime test <slug|handle|id> Send a direct readiness/model-list probe from the node; prints status and latency.
wsmp update [--force] / wsmp update status Install the server’s matching wsmp version or inspect the last update receipt.

Configuration, Terminals, and Recovery

Command Description
wsmp config path|init|show Locate, initialize, or display the node configuration file.
wsmp config set-server <url> [--public-origin <origin>] Change server URL (restart required).
wsmp config set-slug <name> Change the saved node name.
wsmp config set-file-roots <dir>... / clear-file-roots Restrict directories accessible to node file tools (default: home directory).
wsmp config set-file-tools on|off Enable or disable node file tools (default: on).
wsmp config set-file-tools-as-root on|off Permit file tools when running as root/elevated.
wsmp config set-runtime-hosts [host...] Allow non-loopback hosts for always-on runtimes.
wsmp config set-human-terminal on|off Allow or disallow browser terminals.
wsmp config set-terminal-approval on|off Require explicit node approval for each browser identity.
wsmp config set-max-terminals <1-32> Cap simultaneous browser terminals on this node.
wsmp config set-terminal-shell <id>|default Windows: set default shell (pwsh, powershell, cmd, wsl:<distro>).
wsmp config set-remote-updates allowed|off Allow or block updates triggered from the web app.
wsmp terminal fingerprint Display this node’s terminal fingerprint shown in browsers.
wsmp terminal approve <code> / approvals list|revoke Approve, list, or revoke browser terminal identities.
wsmp recover [--apply] [--scan] List or finish interrupted Unix file-tool writes.
wsmp completions <shell> Generate shell completion scripts.

Exit Codes

Code Meaning
0 Success.
1 Runtime error.
2 CLI usage error.
3 Target not found (e.g. wsmp runtime test).
4 Missing, revoked, or rejected credential (HTTP 401); run wsmp login. Systemd does not auto-restart on 4.
5 Relay protocol mismatch (HTTP 426 or upgrade_cli / upgrade_server); upgrade wsmp or the server. Systemd does not auto-restart on 5.
75 Self-update installed; exiting so the service manager launches the new binary.
128 + sig Stopped cleanly by signal (129 SIGHUP, 130 SIGINT, 143 SIGTERM).