⚑ dependencies = [] (Python 3.10+ Stdlib Only) πŸ”’ Zero-Server Architecture (0 Daemons Β· 0 Open Ports Β· 0 CDNs) πŸ›‘οΈ Zero-LLM Fail-Closed Privacy Vault + SHA-256 Audit Ledger

Protect Private Docs, Cut Cloud Tokens by 78%–95%, and Sync 8 Coding Harnesses

Cortical is a pure-Python stdlib control plane, deterministic Zero-LLM Privacy Vault, lossless TOON compressor, and multi-runner local/hybrid orchestrator supporting Ollama, Unsloth Studio, LM Studio, llama.cpp, MLX, and vLLM.

⚑ Zero-LLM Stdlib
100%
Privacy Vault (MD/DOCX/XLSX/PPTX/PDF + SHA-256 Ledger) runs with zero local LLM
⚑ Lossless Roundtrip
-78.12%
TOON tabular compression vs pretty JSON (-62.09% vs compact JSON Β· 0 cloud tokens)
🧠 Hardware Auto-Ceiling
65,536 ctx
Safe 27B variable-quant context on 16 GB Unified RAM (fixes silent 4096 clipping)
πŸ”Œ Lean MCP 2026
8 Tools
Core cortical-mcp stdio surface (~4.5 ms handshake, incl. cortical next) + opt-in 5-tool cortical-wiki

πŸ›‘οΈ Spotlight: Fail-Closed Privacy Vault β€” Works 100% Without Any Local LLM Runner

Sanitize contracts, resumes, financial exports, and architecture specs using pure Python 3.10+ stdlib before any cloud agent sees a single token.

πŸ“„ Multi-Format Metadata Strip⚑ Zero-LLM

Extracts text while stripping hidden author/company XML metadata from .docx, .xlsx, .pptx, selectable .pdf, .md, .txt, and .jsonβ€”with zero third-party packages and zero LLM daemons.

πŸ”’ 3-Channel Fail-Closed Egress⚑ Zero-LLM

Masks Email, IBAN, Tax IDs, Phone, IPs, API secrets, and custom client/project terms while preserving 100.0% of technical identifiers (PostgreSQL, FastAPI, Kubernetes). Blocks max_security items from remote cloud MCP egress.

πŸ” Cryptographic SHA-256 Ledger⚑ Zero-LLM

Every ingest, sanitized read, and blocked cloud egress event is chained into a tamper-evident SHA-256 audit log (cortical vault audit --verify) that never stores raw PII.

🧠 Pluggable Multi-Runner Engine & 10 Reusable @role:* Model Slots

Never hardcode model tags or lock into a single local daemon. Bind semantic roles once and sync across all 8 coding harnesses.

🏎️ 7 Supported Local RunnersRunner-Neutral

  • Ollama (127.0.0.1:11434 β€” native /api/chat + dynamic num_ctx)
  • Unsloth Studio (127.0.0.1:8888/v1 β€” dynamic UD variable quantization)
  • LM Studio (127.0.0.1:1234/v1 β€” desktop GUI + OpenAI-compatible VLM/LLM server)
  • llama.cpp (llama-server :8080/v1) & Apple MLX (mlx_lm.server :8080/v1)
  • vLLM (127.0.0.1:8000/v1) & any custom OpenAI-compatible endpoint or LiteLLM Router (:4000/v1)

🎭 10 Semantic Model Roles@role:*

Reference abstract roles across rules, MCP offload, and LiteLLM routing instead of fragile model filenames:

@role:router Β· @role:ner Β· @role:fast_coder Β· @role:daily_coder Β· @role:reviewer Β· @role:summarizer Β· @role:deep_reasoner Β· @role:orchestrator Β· @role:vision Β· @role:embedder

Syncs idempotently across Antigravity, pi, Claude Code, Codex, OpenCode, OpenClaw, dsh, and Unsloth Studio.

βš–οΈ Transparent 2-Tier Capability Matrix

Everything in Tier 1 works out-of-the-box on any machine with Python 3.10+. Tier 2 activates automatically when you connect any local runner.

Capability Execution Tier Local Runner Needed? Details
Privacy Vault (Text, JSON, DOCX/XLSX/PPTX, Selectable PDF) ⚑ Tier 1 · Zero-LLM Stdlib No Deterministic PII + secret + custom-term masking, XML metadata stripping, fail_closed guard, and SHA-256 audit ledger.
Lossless TOON Compression & 8-Harness Sync ⚑ Tier 1 · Zero-LLM Stdlib No cortical_compress (-78.12% vs pretty JSON), cortical doctor, cortical sync --dry-run, and timestamped --rollback.
Zero-Server Interactive Control Plane (settings.html) ⚑ Tier 1 · Zero-LLM Stdlib No Standalone 6-domain HTML/CSS/JS SPA (zero CDNs, zero open ports) with 1-click Presets A/B/C and in-browser PII preview.
Image / Scanned-PDF OCR (cortical watch) & --ner 🧠 Tier 2 · Local Runner Yes (@role:vision / @role:ner) 100% offline multimodal OCR and extra unstructured NER via Ollama, Unsloth Studio, LM Studio, llama.cpp, MLX, or vLLM.
Zero-Cloud-Token Code Offload (cortical_local_offload) 🧠 Tier 2 · Local Runner Yes (@role:daily_coder / @role:reviewer) Reads local files directly on disk (-95.80% cloud input tokens) and summarizes/reviews locally.

πŸš€ Safe 4-Step Quickstart (Preview First with --dry-run + Instant --rollback)

Cortical never touches harness files silently. Benchmark, diagnose, preview the exact diff, and apply with an automatic rollback snapshot.

git clone https://github.com/ccancellieri/cortical.git
cd cortical && ./install.sh

# 1. Verify lossless TOON, Zero-LLM Privacy Vault & 8-tool MCP
.venv/bin/cortical bench --compare

# 2. Inspect OS/RAM/VRAM tier, Tier-1 Stdlib & detected runners
.venv/bin/cortical doctor

# 3. Preview exact harness diffs FIRST (modifies 0 files)
.venv/bin/cortical sync --dry-run

# 4. Apply with timestamped backup (undo anytime via --rollback)
.venv/bin/cortical sync
# Undo anytime: .venv/bin/cortical sync --rollback <backup_id>

πŸ–₯️ Test in Browser in 10 Seconds0 Install

Want to explore Cortical before cloning? Open the self-contained 6-Domain Zero-Server Control Plane right here on GitHub Pages:

  • Switch between Preset A (4 GB VRAM Hybrid), Preset B (16 GB Apple Silicon 27B), and Preset C (Remote Supervisor + fail_closed Guard).
  • Test live client-side PII masking in the Privacy Vault Redaction Studio.
  • Inspect @role:* bindings, multi-runner selection, and export secret-free cortical-profile.json bundles.
Open Interactive Control Plane (settings.html) β†’ Read Interactive Help Guide β†’