Laya-MLX System 1 Decision Plane

Sanctum enforces a strict subscription-first and local $0 doctrine. Speed matters. Instincts must be instant. Until now, agent decision-making lived at two brittle extremes: fragile keyword regex matching that broke under the slightest phrasing shift, or heavy frontier generative models that introduced seconds of unwanted latency and unpredictable cloud token expenses. The deployment of laya-mlx bridges this gap completely, establishing a dedicated, zero-cost System 1 decision plane that runs entirely on local silicon.
Architecture
Section titled “Architecture”Speed is the foundation. haus.sanctum.laya runs as a persistent background daemon on 127.0.0.1:1989. It hosts the ModernBERT-large backbone (aac6fef/laya-mlx, ~421M parameters, ~803 MB FP16 safetensors) directly in Apple Silicon unified memory via MLX. No remote API can match it.
[User Prompt / Telemetry] │ ▼[~/.sanctum/lib/laya.py] ──(HTTP POST <15ms)──► [haus.sanctum.laya :1989] │ │ ▼ (fail-soft fallback) ▼[score_prompt() / Heuristics] [MLX FP16 Decision Head] │ ▼ Typed Outputs: - Choice (Route) - Score (Salience) - Noul (Boolean)Service Contract
Section titled “Service Contract”- Endpoint:
http://127.0.0.1:1989GET /_health: Health, model name, dtype (bfloat16), uptime, request counter, and live Metal memory telemetry (metal_active_mb,metal_cache_mb,metal_peak_mb).POST /predict: Input state string + typed question schema (choice,score,noul).
- Resident Footprint: ~43 MB process RSS, ~803 MB Metal buffer (capped with 128 MB cache limit via
mx.set_cache_limit, OS footprint 887 MB; see The Three-Gigabyte Reflex). - Qui-Gon Triage Level: P1.5 (Permanent daemon, exempt from P2/P3 eviction).
- Latency: 11ms–70ms typical inference on Apple Silicon.
Consumer Integrations
Section titled “Consumer Integrations”1. sanctum-code Routing & Diagnostics
Section titled “1. sanctum-code Routing & Diagnostics”sanctum-code queries :1989 on every auto-route task. If Laya returns a valid route (feature, ops, quick, review, hard), it applies the typed decision and calibrated confidence. If the daemon is stopped, it transparently falls back to heuristic regex scoring.
Health status is surfaced directly via sanctum-code doctor.
2. Thalamus Global Workspace (thalamusd.py on :1988)
Section titled “2. Thalamus Global Workspace (thalamusd.py on :1988)”Thalamus arbitrates the global broadcast workspace for Sanctum agents. When agents post events without an explicit salience score, Thalamus automatically invokes Laya’s semantic salience scoring (score_salience()), dynamically weighting urgent system events vs routine heartbeats based on text semantics. Thalamus also provides a dedicated POST /salience endpoint for real-time salience queries.
3. Sentinel Anomaly Triage (sharepoint-bridge-sentinel.py)
Section titled “3. Sentinel Anomaly Triage (sharepoint-bridge-sentinel.py)”Sanctum sentinels monitor critical paths like the SharePoint / M365 authenticated bridge. Before escalating consecutive failures to Force Flow CRITICAL pages, sharepoint-bridge-sentinel.py queries Laya’s triage_incident(). If diagnosed as a transient network timeout rather than an origin crash or auth failure, operator pager alerts are suppressed during temporary ISP jitter while maintaining immediate alerting on hard failures.
4. Sanctum CRM & Jocasta Privacy Firewall (sanctum_crm/lib.py)
Section titled “4. Sanctum CRM & Jocasta Privacy Firewall (sanctum_crm/lib.py)”In partner and work sessions (CRM_SESSION=work), Sanctum enforces strict privacy firewalls. Any communication draft, persona synthesis, or incoming text is passed through Laya’s semantic privacy filter (filter_privacy()). If classified as private_family with $\ge 60%$ probability, the operation immediately fails closed (PermissionError), protecting personal family communications from crossing into professional workspaces.
Operational Verification
Section titled “Operational Verification”# Check daemon healthcurl -s http://127.0.0.1:1989/_health | jq .
# Test Thalamus semantic saliencecurl -s -X POST http://127.0.0.1:1988/salience \ -H "Content-Type: application/json" \ -d '{"content": "CRITICAL: Primary database connection pool exhausted"}' | jq .
# Test sentinel dry runpython3 ~/.sanctum/sentinels/sharepoint-bridge-sentinel.py --dry
# Run full sanctum-code selftest suitesanctum-code selftestLocal neural triage gives the estate instant reflexes without cloud latency or token cost. Under our living force architecture, Qui-Gon guards RAM while Jocasta enforces privacy boundaries. The System 1 decision plane stands watchful, silent, and fast.