SLMAgents 2.0.0 · 10-Plane Pure-CPU Agent Harness · MIT Open Source

Deterministic Local AI Agents on Standard CPUs

Small models fail when wrapped in prompt-heavy loops built for 200B cloud APIs. SLMAgents 2.0 moves reliability into the systems layer via slm_harness—orchestrating 26 specialized agents across hybrid llama.cpp GGUF (Q4_K_M) and quantized INT4/INT8 CPU runtimes with <35ms Cascade Routing, GBNF JSON-Schema grammar decoding, a Watermark LRU MemoryArena, and self-healing verifiers at $0 API cost.

$git clone https://github.com/t00114218-stack/SLMAgents.git && ./SLMAgents/slm doctor
slm_harness // 10-Plane Execution Trace
● CPU ONLINE (n_gpu_layers=0)
$ ./slm ask "Verify Q3 settled revenue in @sales.db and 15% tax"
[Plane 6 · CascadeRouter]  stage=1 (file_sig)   latency=2.1ms   conf=0.98
  └─ DAG: SLMTextToSQL (@sales.db) ──► SLMMathAgent (SymPy tax check)
[Plane 2 · MemoryArena]    profile=balanced (4.7 GB)  rss=3,272 MB  evict=0
  └─ slot=code_sql: Qwen2.5-Coder-3B-Q4_K_M.gguf (warm on 7 P-cores)
[Plane 5 · GBNF Grammar]   schema=ToolCallEnvelope  speed=24.6 tok/s
  └─ sql: SELECT SUM(net_revenue) FROM q3_ledger WHERE status='settled';
[Plane 7 · SQLVerifier]    sqlite_explain=PASS  handle=artifact://9f3a81c04b12
[Plane 7 · SymPyVerifier]  expr=1250000 * 0.15  verified=$187,500.00 (PASS)
[Plane 1 · CheckpointWAL]  turn_id=ckpt_0194a   status=COMMITTED (612ms · $0.00)
24.6 tok/s
Qwen3-4B GGUF (Q4_K_M) on CPU
<35 ms
4-Stage Calibrated Cascade Router
0.03 ms
Warm 1024-d INT8 Vector Lookup
$0.00
Cloud API, Token & GPU Cost
01 / DISTRIBUTION & PACKAGING

Standalone OS & Individual Agent Harness Installers

Deploy the full 26-agent desktop & CLI suite or download a self-extracting single-agent harness installer for macOS, Windows, or Linux. Zero pre-installed Python or C++ build toolchains required.

macOS Installer
.dmg · 280 MB

Native macOS disk image with embedded Python 3.11, llama-cpp-python, ONNX Runtime, Opt-In Personalization Studio, Daily Concierge, Machine Control, and all 26 agents.

Arch: Apple Silicon (M1–M4) & Intel Target: /Applications/SLMAgents.app
Download .dmg
Windows 10 / 11
.exe · 2.8 MB

Native 64-bit Windows Setup executable (PE32+ .exe) that provisions Python 3.11, slm_harness, Opt-In Personalization Studio, Daily Concierge, and Desktop shortcut.

Arch: 64-bit Windows (x86_64) Target: %LOCALAPPDATA%\SLMAgents
Download Windows (.exe)
Linux AppImage
.AppImage · 3.4 MB

Standalone Linux desktop executable (.AppImage) for Ubuntu, Debian, Fedora, and Arch with Opt-In Personalization Studio, Daily Concierge, and ~/.local/bin/slm launcher.

Arch: x86_64 & ARM64 (aarch64) Target: ~/.local/share/slmagents
Download Linux (.AppImage)
Individual Agent + 10-Plane Harness OS Installer Builder 78 Bundles · ~450 KB each
Need only one specialized agent? Select an agent to download a minimal self-extracting installer containing just that agent package + slm_harness + ./slm CLI.
macOS (.command) Windows (.exe) Linux (.AppImage)
02 / SYSTEMS ARCHITECTURE

The 10-Plane Pure-CPU Agent Harness (slm_harness)

Instead of relying on fragile prompt engineering, slm_harness decomposes local agent execution into 10 deterministic systems planes—bounding RAM usage, enforcing valid tool schemas at the token sampler level, and verifying outputs before they reach the user.

01 · INGRESS & POLICY
Planes 8 & 9 · Surfaces & Guard
CLI (./slm), Offline Web Studio, OpenAI /v1 API & MCP Server gated by PII scrubber & risk lattice.
<5 ms Policy & PII Gate
02 · DISPATCH & DAG
Plane 6 · Cascade Router
4-stage deterministic-first router: MIME/Regex → FTS5 BM25 → 1024-d Embedding Margin → 0.8B Token-Trie.
<35 ms p95 Route Latency
03 · CONTEXT & MEMORY
Planes 3 & 4 · Artifact & 4-Tier
Stores large tables/files as artifact://<sha12> handles + SQLite FTS5 BM25 & INT8 HNSW vectors.
70–85% Token Reduction
04 · CPU COMPUTE
Planes 2 & 5 · Arena & GBNF
Watermark LRU MemoryArena governing hybrid llama.cpp GGUF (Q4_K_M) & INT4/INT8 ONNX models.
24.6 tok/s · 100% Valid JSON
05 · VERIFY & COMMIT
Planes 1, 7 & 10 · Verifiers & WAL
Self-healing SQLite EXPLAIN, Python AST, SymPy & Citation verifiers committed to SQLite WAL checkpoints.
<1.2 ms WAL Checkpoint

Planes 2 & 5 Hybrid GGUF + INT4/INT8 Runtime

Combines llama.cpp GGUF (Q4_K_M) for high-speed autoregressive reasoning (24.6 tok/s on Qwen3-4B CPU) with quantized INT4/INT8 ONNX encoders for sub-millisecond embeddings, reranking, OCR, and speech—governed by a Watermark LRU MemoryArena.

Planes 3 & 4 Artifact Scratchpad & 4-Tier Memory

Eliminates CPU prefill starvation by storing large tool payloads (DataFrames, SQL tables, scraped DOMs) out-of-context as content-addressed artifact://<sha12> handles and injecting only compact structural summaries into the prompt window.

Planes 6 & 7 Cascade Routing & Self-Healing Verifiers

Routes queries across all 26 agents in <35ms via a 4-stage cascade (Regex/File Signatures, SQLite FTS5 BM25, 1024-d Embedding Margin, and 0.8B Micro-Classifier) and validates every output via SQLite EXPLAIN QUERY PLAN, Python AST, SymPy, and span citations.

Plane Subsystem & Module Path Engineering Mechanism Measured CPU Budget
Plane 1 slm_harness.core.kernel
CheckpointStore
Deterministic state-machine execution loop with SQLite WAL transactional checkpoints supporting instant session branching (/fork, /rewind, /undo). <1.2 ms per WAL commit
Plane 2 slm_harness.runtime.arena
MemoryArena
Watermark LRU model governor enforcing strict RAM ceilings across 3 hardware profiles with zero-copy session sharing and automatic OOM tier step-down (8B → 4B → 3B → 0.8B). lite 2.6 GB · balanced 4.7 GB · power 8.2 GB
Plane 3 slm_harness.core.scratchpad
ArtifactScratchpad
Content-addressed artifact://<sha12> object store that keeps raw tables, JSON payloads, and code outputs out of the LLM context window. 70–85% prompt token reduction
Plane 4 slm_harness.memory.*
HybridMemoryStore
4-tier local memory hierarchy (L1 active window, L2 episodic summaries, L3 SQLite FTS5 BM25 + HNSW vector index, L4 project SLM.md rules). 0.03 ms warm INT8 vector lookup
Plane 5 slm_harness.runtime.gguf_backend
GrammarCompiler
Compiles Pydantic / JSON-Schema tool definitions into GBNF grammars enforced directly at the token sampler level—eliminating malformed JSON and hallucinated tool names. 100% schema-valid tool calls
Plane 6 slm_harness.router.cascade
CascadeRouter
4-stage deterministic-first router: Stage 1 File/Command Signatures → Stage 2 FTS5 BM25 Lexical → Stage 3 1024-d Embedding Margin → Stage 4 GBNF Micro-Classifier + DAG Planner. <35 ms p95 routing latency
Plane 7 slm_harness.verifiers.*
VerifierSuite
Deterministic post-execution verifiers (SQLite EXPLAIN QUERY PLAN, Python AST + sandbox, JSON Schema, SymPy equivalence, RAG span citations) with surgical error-span repair. Up to 2 self-healing repair turns
Plane 8 slm_harness.governance.*
PolicyGuard
Pre-execution security gate scanning shell commands, file paths, and SQL statements against destructive patterns and redacting PII (SSN, keys, tokens) in under 5ms. <5 ms policy & PII scan
Plane 9 slm_harness.cli & webui
SkillStore
Unified operator surfaces: Rich TUI (./slm chat with 18 slash commands), Offline Web Studio, OpenAI-compatible /v1/chat/completions server, MCP bridge, and .slm/skills/ repository. Zero external cloud dependencies
Plane 10 slm_harness.telemetry.*
TraceRecorder
Per-turn JSONL execution trace logging, live RAM/throughput HUD, and automated 26-agent regression benchmark harness (./slm bench). <0.4 ms trace overhead
03 / VERIFIED EXECUTION TRACES

Production Workloads on Standard CPUs

Inspect how the 10-Plane Harness orchestrates multi-step code execution, tabular data analysis, and context-distilled RAG with deterministic verification.

TRACE 01 · PLANE 6 DAG + PLANE 7 AST SANDBOX

Autonomous Code Synthesis & Sandboxed Verification

SLMOrchestrator decomposes a developer request, routes code synthesis to SLMCodeInterpreter (backed by Qwen2.5-Coder-3B GGUF Q4_K_M), validates syntax via Plane 7's Python AST verifier, and executes the script inside an isolated CPU subprocess.

  • [01]Stage 1 Router: Matches code intent in 1.8ms and selects code_sql specialist slot.
  • [02]Plane 7 AST Gate: Verifies imports against sandbox allowlist before subprocess execution.
  • [03]Zero-Leakage Output: Captures stdout, exit code, and runtime duration into an artifact handle.
trace_01_code_interpreter.py
# $ ./slm ask "Generate first 10 primes and compute mean"
from slm_orchestrator import SLMOrchestrator
from slm_code_interpreter import SLMCodeInterpreter

orch = SLMOrchestrator()
interp = SLMCodeInterpreter()

route = orch.route(
    question="Compute first 10 primes and their mean",
    agents=["RAG", "CodeInterpreter", "Math"]
)
res = interp.execute(
    "primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\n"
    "print({'count': len(primes), 'mean': sum(primes)/10})"
)
print(res)
[Plane 6 CascadeRouter] agent="CodeInterpreter" (2.4ms)
[Plane 7 PythonASTVerifier] syntax=PASS imports=ALLOW
[Plane 3 Scratchpad] stdout -> artifact://4c81e920ab11

{
  "status": "success",
  "exit_code": 0,
  "stdout": "{'count': 10, 'mean': 12.9}\n",
  "verifier": "PASS (PythonAST + SubprocessSandbox)"
}
TRACE 02 · PLANE 3 ARTIFACT SCRATCHPAD

Zero-Prefill-Bloat Tabular Data Analytics

Instead of dumping thousands of CSV rows into the prompt, SLMDataAnalyst registers the dataset in Plane 3's ArtifactScratchpad (artifact://<sha12>), passes only the compact column schema to the model, and executes verified Pandas aggregations locally.

  • [01]Out-of-Context Storage: 50,000-row CSV stays in memory/disk behind a 12-byte SHA handle.
  • [02]Schema-Only Prompting: Prompt consumes only 140 tokens instead of 45,000 tokens.
  • [03]Deterministic Aggregation: Exact numerical groupby and summary statistics computed on CPU.
trace_02_data_analyst.py
# $ ./slm ask "Group @q3_regional_sales.csv by region"
from slm_data import SLMDataAnalyst

analyst = SLMDataAnalyst()
report = analyst.analyze_file(
    file_path="q3_regional_sales.csv",
    query="Summarize revenue and margin by region"
)
print(report)
[Plane 3 Scratchpad] csv -> artifact://7d92a01bc44e
[Plane 3 SchemaDigest] cols=['region','rev','margin']

{
  "artifact_handle": "artifact://7d92a01bc44e",
  "summary": {
    "North America": {"rev": "$1.42M", "margin": "34.2%"},
    "EMEA":          {"rev": "$0.98M", "margin": "31.8%"},
    "APAC":          {"rev": "$0.76M", "margin": "36.5%"}
  }
}
TRACE 03 · PLANE 4 HYBRID MEMORY + PLANE 7 CITATION VERIFIER

Context-Distilled CPU RAG with Span Verification

SLMRag combines 1024-d mxbai-embed-large INT8 vectors with cross-encoder reranking (bge-reranker-base) to distill retrieval down to the top-2 high-purity passages—cutting CPU prefill latency by 75% while Plane 7 verifies every [1], [2] citation span.

  • [01]Hybrid Retrieval: SQLite FTS5 BM25 + INT8 cosine similarity in 0.03ms (warm cache).
  • [02]Context Distillation: Top-K=2 reranked chunks prevent sub-3B attention dilution.
  • [03]Citation Grounding: Plane 7 rejects ungrounded claims not backed by retrieved spans.
trace_03_grounded_rag.py
# $ ./slm ask "What is the SLA uptime in @msa.pdf?"
from slm_rag import SLMRag

rag = SLMRag(temperature=0.0, max_tokens=256)
answer = rag.answer(
    question="What is the SLA uptime and credit?",
    chunks=[
        "Sec 4.1: Provider guarantees 99.95% uptime [1].",
        "Sec 4.2: Downtime >21m/mo grants 10% credit [2]."
    ],
    instruction="Cite exact sections using [1], [2]."
)
print(answer)
[Plane 4 HybridRetriever] dim=1024 top_k=2 ttft=0.10s
[Plane 7 CitationVerifier] spans=2 grounding=1.00 PASS

{
  "answer": "Sec 4.1 guarantees 99.95% uptime [1]; "
            "Sec 4.2 grants a 10% credit [2].",
  "verified_citations": ["[1] Sec 4.1", "[2] Sec 4.2"],
  "grounded": true
}
04 / 26-AGENT SYSTEMS DIRECTORY

All 26 Specialized Local SLM Agents

Every agent in the monorepo is an independent Python package that plugs directly into the 10-Plane Pure-CPU Harness (slm_harness). Filter by domain, inspect the API reference, or download a standalone OS harness installer for any individual agent.

slm_rag Productivity

SLM RAG

Context-distilled offline Retrieval-Augmented Generation with 1024-d INT8 embeddings, cross-encoder reranking, and strict span citations.

Slot: embeddings + reranker + primary · Plane 7 Citation Verifier
slm_orchestrator Developer Tools

SLM Orchestrator

Multi-agent DAG router and topological task dispatcher powered by Plane 6 Cascade Routing (<35ms) and GBNF tool envelopes.

Slot: router (Qwen3.5-0.8B) + primary · Plane 7 DAG Verifier
slm_text_to_sql Developer Tools

SLM Text-to-SQL

Schema-aware SQL generator that validates every query against live DDL schemas using SQLite EXPLAIN QUERY PLAN self-repair.

Slot: code_sql (Qwen2.5-Coder-3B GGUF) · Plane 7 SQLite Verifier
slm_code_interpreter Developer Tools

SLM Code Interpreter

Synthesizes and executes Python code inside an isolated local subprocess with pre-execution AST verification and traceback self-repair.

Slot: code_sql (Qwen2.5-Coder-3B GGUF) · Plane 7 Python AST Gate
slm_summarizer Productivity

SLM Summarizer

Map-Reduce hierarchical document condensation engine with entity density preservation and strict bullet/length constraints.

Slot: primary (Qwen3-4B / Llama-3.2-3B) · Plane 7 Length Verifier
slm_cli Productivity

SLM CLI Agent

Translates natural language intents into POSIX/Zsh/Bash/PowerShell pipelines gated by Plane 8 destructive-command policy inspection.

Slot: code_sql · Plane 8 Shell Safety & Policy Gate
slm_data Data & Utilities

SLM Data Analyst

Loads CSV, Parquet, and Excel files via Plane 3 artifact:// handles to run Pandas statistical aggregations and chart synthesis offline.

Slot: code_sql + ArtifactScratchpad · Plane 7 Pandas Verifier
slm_json_cleaner Data & Utilities

SLM JSON Cleaner

Repairs truncated JSON payloads, unescaped quotes, and trailing commas using deterministic AST parsing and GBNF grammar constraints.

Slot: router / fast_json · Plane 5 GBNF + Plane 7 JSON Schema
slm_git_manager Developer Tools

SLM Git Repo Manager

Analyzes local Git diffs, staged hunks, and branch histories to generate Conventional Commits, PR changelogs, and conflict resolutions.

Slot: code_sql · Plane 7 Conventional Commit Verifier
slm_db_migration Developer Tools

SLM Database Migrator

Diffs source and target relational schemas to generate zero-downtime SQL migrations and SQLAlchemy/Django ORM definitions verified in SQLite.

Slot: code_sql · Plane 7 In-Memory SQLite Dry-Run Sandbox
slm_doc_parser Data & Utilities

SLM Document Parser

Converts PDF, DOCX, PPTX, and HTML files into structure-preserving Markdown chunks and normalized tables for downstream RAG indexing.

Slot: cpu_doc_pipeline + ArtifactScratchpad · Boundary Verifier
slm_vision_parser Data & Utilities

SLM Vision Parser

Offline quantized Vision-Language & OCR pipeline (Florence-2-base INT8) for extracting tables, charts, receipts, and diagrams on CPU.

Slot: vision_ocr (Florence-2 INT8) · OCR Bounding-Box Verifier
slm_pdf Productivity

SLM PDF Chat

End-to-end offline PDF ingestion, multi-column table extraction, and page-cited conversational Q&A over contracts and papers.

Slot: embeddings + reranker + primary · Page Citation Verifier
slm_web Web & Search

SLM Web Agent

DOM-distilled headless browser automation agent that maps accessibility trees to GBNF-constrained click, fill, and navigation actions.

Slot: primary + DOM Distiller · Plane 8 Origin Allowlist Gate
slm_scraper Web & Search

SLM Web Scraper

Strips scripts and boilerplate from live web pages and extracts typed JSON records conforming to user-supplied schemas.

Slot: primary + GBNF Schema · Plane 7 JSON Field Verifier
slm_search Web & Search

SLM Search Orchestrator

Decomposes research queries, executes multi-source retrieval, deduplicates passages via INT8 embeddings, and synthesizes cited answers.

Slot: embeddings + reranker + primary · Source Citation Verifier
slm_math Data & Utilities

SLM Math Agent

Combines step-by-step mathematical reasoning with deterministic SymPy symbolic verification for algebra, calculus, and financial modeling.

Slot: primary (Qwen3-4B) + SymPy · Plane 7 Symbolic Equivalence
slm_security Data & Utilities

SLM Security Audit

Scans prompts, code diffs, and model outputs for PII leakage (SSN, API keys, cards), shell injection, and OWASP vulnerabilities in under 5ms.

Slot: Plane 8 PolicyGuard + DeBERTa INT8 · PII Redaction Gate
slm_embeddings Data & Utilities

SLM Embeddings Server

High-throughput CPU vector service computing normalized 1024-d (mxbai-embed-large) and 384-d (bge-small) INT8 embeddings in 0.03ms warm.

Slot: embeddings (INT8 ONNX) · L2-Norm & Dimension Verifier
slm_email Productivity

SLM Email Assistant

Processes inbox streams 100% offline to classify priority/spam, extract action items with deadlines, and draft tone-matched replies.

Slot: primary + Plane 8 PII Filter · Action-Item Schema Verifier
slm_meeting Productivity

SLM Meeting Summarizer

Distills multi-speaker transcripts into structured Markdown action tables, owner assignments, and key decision logs.

Slot: primary + Map-Reduce · Speaker Attribution Verifier
slm_memory Productivity

SLM Memory Manager

Manages Plane 4's 4-tier persistent memory graph—extracting user facts, deduplicating entities, and retrieving hybrid BM25 + vector context.

Slot: Plane 4 SQLite FTS5 + HNSW · Fact Deduplication Verifier
slm_task_planner Productivity

SLM Task Planner

Decomposes complex engineering goals into topological DAGs with explicit step dependencies, assigned agents, and fallback branches.

Slot: primary + Plane 5 GBNF · Acyclic DAG Topology Verifier
slm_pkb Productivity

SLM PKB Agent

Indexes local Obsidian, Logseq, and Markdown vaults on CPU—discovering semantic clusters, bi-directional [[wikilinks]], and frontmatter tags.

Slot: embeddings (INT8) + primary · Vault Link Integrity Verifier
slm_voice Productivity

SLM Voice Agent

100% offline speech-to-text (Whisper-tiny.en INT8), low-latency local agent reasoning, and CPU neural text-to-speech (Kokoro-82M).

Slot: speech_stt + primary + speech_tts · Audio Frame Verifier
slm_translation Data & Utilities

SLM Translation Hub

Offline multilingual translation engine preserving Markdown, HTML, code blocks, and JSON keys across 20+ language pairs on CPU.

Slot: translation (NLLB-200 INT8) + primary · Markup Tag Verifier
05 / EMPIRICAL BENCHMARKS & RESEARCH

Systems Architecture & CPU Ablation Studies

Reproducible benchmarks measuring CPU token throughput, 4-stage router latency, memory arena RSS, and context distillation accuracy across sub-3B to 8B models.

Figure 1 · 120-Query CPU RAG Ablation Matrix (Sub-3B Models)
CPU RAG Context Distillation Benchmark Table
Figure 2 · Context Distillation Pipeline
SLMAgents Context Distillation Pipeline