--- license: agpl-3.0 title: SnapKitty Sovereign Chat Harness emoji: ๐Ÿ” colorFrom: green colorTo: indigo sdk: gradio sdk_version: 4.40.0 app_file: app.py pinned: true tags: - harness - verification - guardrails - agent - formal-verification - hallucination-detection - audit-log - local-inference - rlhf - snapkitty - agents - python short_description: If it can't prove it, it won't say it. ERE P1-P5 gates every response. --- # SnapKitty Sovereign Chat Harness > **If it can't prove it, it won't say it.** Every response is checked by five deterministic ERE gates and sealed with a SHA-256 audit receipt before you see it. Responses that fail are **blocked and explained** โ€” not silently returned. ## How it works ``` prompt โ”‚ โ–ผ P1 verify(prompt) โ€” MetaSum coherence check on prompt โ”‚ โ–ผ LLM (Ollama local / HF Inference) โ”‚ โ–ผ P2 verify(response) โ€” MetaSum coherence check on response โ”‚ โ–ผ P3 curate(response) โ€” Dream Cycle recovery gate โ”‚ โ–ผ P4 prove(joint) โ€” entropy invariant โ‰ค 0.20 โ”‚ โ–ผ P5 seal() โ€” WORM SHA-256 receipt โ”‚ โ–ผ allowed? โ†’ show response + proof panel blocked? โ†’ show why, suppress response ``` ## Gate table | Gate | External label | What it checks | |------|---------------|----------------| | P1 | `verify` | Prompt phase coherence: `|MetaSum(prompt)| โ‰ฅ ฯ„` | | P2 | `verify` | Response MetaSum: model output has sufficient signal | | P3 | `curate` | Dream Cycle: coherence restored after low-MetaSum event | | P4 | `prove` | Joint entropy `โ‰ค 0.20` โ€” Weil-bound invariant | | P5 | `seal` | WORM SHA-256 receipt for audit chain | ## Why it doesn't hallucinate The coherence threshold `ฯ„ = N/2 = 512` enforces that the MetaSum magnitude of any response exceeds the Weyl bound `โˆš(Nยทlog Q) โ‰ˆ 89`. Responses below this bound are recovered via Dream Cycle or blocked entirely. Entropy invariant `H โ‰ค 0.20` is derived from the same bound: post-Dream-Cycle entropy drops to `โ‰ˆ 0.07`, well inside the safe zone. ## Local setup ```bash git clone https://github.com/SNAPKITTYWEST/sovereign-chat-harness cd sovereign-chat-harness pip install -r requirements.txt cp .env.example .env # edit .env โ€” set HF_TOKEN and/or start Ollama # With Ollama (recommended): ollama run snapkitty-merged # or any GGUF model # Without Ollama (HF Inference): export HF_TOKEN=hf_... python app.py # open http://localhost:7860 ``` ## RTX 3080 Docker (8 GB VRAM) See `Dockerfile` โ€” one-command local sovereign stack with audit trail: ```bash docker build -t snapkitty-chat . docker run -p 7860:7860 --gpus device=0 \ -e HF_TOKEN=$HF_TOKEN \ snapkitty-chat ``` Every response prints a WORM hash. NVIDIA can't offer this. ## Terminology Internal terms (code) map to external terms (README/tags/HF search): | Internal | HF search term | |----------|---------------| | FSM pipeline | data curation / filtering | | ERE gates P1-P5 | verification / guardrails | | WORM sealing | reproducible audit log | | SovMonster / Lean proof | formal verification | | SoulVM JIT | local inference runtime | | Dream Cycle | hallucination recovery | | MetaSum | coherence scoring | ## Models - **Ollama** (local, preferred): `snapkitty-merged` Q4_K_M GGUF, RTX 3080, 8 GB VRAM - **HF Inference** (cloud): `Snapkitty/snapkitty-merged` - Any Ollama-compatible model works โ€” swap via `OLLAMA_MODEL` env var ## License BSL-1.1 / AGPL-3.0 / MPL-2.0 โ€” Patent Pending, BEL ESPRIT D ACCORD TRUST HOLDINGS INC. ### ๐Ÿ’ผ Commercial License Snapkitty code is free and open under **AGPL-3.0** for open-source use. Building a commercial product or service? A **proprietary commercial license** from Snapkitty Collective LLC lets you ship this code without the AGPL's source-sharing and network-use obligations. **[โ†’ Get a commercial license](mailto:A.parr@belespritdaccord.uk?subject=Commercial%20license:%20sovereign-chat-harness)** ยท A.parr@belespritdaccord.uk