# Aristotele — Complete Technical Reference (`v0.7.0`) Canonical URL: https://aristotele.vaked.dev/ Studio WebApp: https://aristotele.vaked.dev/studio.html Repository: https://github.com/8b-is/aristotele License / Author: 8b-is / PeetPedro --- ## 1. Architecture Summary Aristotele is a single-binary, OS-agnostic AI runtime (`macos/aarch64`, `linux/aarch64-musl`, `x86_64-apple-darwin`, `aarch64-unknown-none`) built in pure standard-library Rust with **zero external `crates.io` runtime dependencies** and **zero `unsafe` blocks/functions** across all workspace crates. 1. **aristotele-engine (`#![no_std]`-compatible)**: - Ternary quantization kernels (`pack5` 1.60 bpw, 2-bit) and Maple 20B-A1B (`ggml-org/llama.cpp#27000`) `TQ1_0` (`54B`/block, `1.69` bpw) & `TQ2_0` (`66B`/block, `2.06` bpw) codecs. - Zero-copy GGUF ternary scanner (`scan_gguf_tq_counts`), `eval_maple_moe_probe`, `HardwareProfile` cached once via `OnceLock`. - `aarch64-neon-4row-sdot` / Apple Metal LUT path and deterministic F_4=F_5=4 -> F_8=1 routing witness bands (`SPHIST/1` WAL). 2. **aristotele-ayefire**: - Local HTTP/1.1 + SSE + MCP/A2A loopback server (`http.rs`, `server.rs`), embedded zero-asset HTML/JS/CSS Studio (`webapp.rs`). - OpenAI-compatible (`/v1/chat/completions`), Anthropic-compatible (`/v1/messages`), MCP (`POST /mcp`, `GET /.well-known/mcp.json`), and A2A (`/.well-known/agent.json`, `POST /a2a`). - 23 built-in provider presets (local `kolibry`, `maple`, `ollama`, `lmstudio`, `vllm`, `llama.cpp`, `mlx-quant`, cloud APIs, and strict allowlisted CLI subscription bridges `claude`/`gemini`/`codex`/`ollama`). - Complete memory subsystem: Honcho conversational modeling, MemPalace wings/drawers/tunnels/diary + temporal KG triples, and Engram slot pinning. 3. **aristotele-cli**: - Commands: `aristotele`, `aristotele app`, `aristotele tui`, `aristotele verify`, `aristotele bench`, `aristotele doctor`, `aristotele mcp`, `aristotele setup`. - Flags: `--local-only`, `--provider `, `--model `, `--bind `, `--no-open`, `--once`. --- ## 2. Maple 20B-A1B Ternary MoE (`ggml-org/llama.cpp#27000`) - Reference checkpoint: `deepgrove/maple-preview` - Architecture: `24` transformer layers (`3:1` SWA-512 vs Global Attention — `18` SWA-512, `6` Global), `256` total experts with `8` active per token (`96.875%` MoE sparsity), `swiglu_clamp_exp = [7.0]`, `norm_topk_prob = true`. - Supported local serving: `llama-server -hf deepgrove/maple-preview --port 8080` coupled via `aristotele --provider maple app`. - Native HTTP probe: `POST /v1/maple/bench` and CLI `aristotele verify` / `aristotele bench`. --- ## 3. Firebase AI Logic & WebMCP Integration - Uses official Firebase JS Modular SDK `13.4.0` (`firebase-app.js`, `firebase-ai.js`, `firebase-app-check.js`). - Backends: - `google_ai` (`GoogleAIBackend` — Gemini Developer API, free-tier compatible) - `agent_platform` (`AgentPlatformBackend` / `VertexAIBackend` — Agent Platform Gemini API, canonical mapping of legacy `vertex_ai`) - Inference routing modes: `prefer_on_device`, `only_on_device`, `prefer_in_cloud`, `only_in_cloud`, plus local/LAN `local_rust`. - Multimodal inline payloads: `image/png`, `image/jpeg`, `image/webp`, `application/pdf`, `audio/mpeg`, `audio/wav`, `audio/ogg`, `video/mp4` (up to `15 MB` in Studio). - Tools Constraint & Execution: - When `google_search_grounding` is enabled, `{ googleSearch: {} }` is passed cleanly and grounding citations are appended in chat. - When `webmcp_tools` is enabled (and Search Grounding is off), `window.AristoteleWebMCP.declarations()` are passed as `{ functionDeclarations }` and returned `functionCalls()` are executed in-browser (`local_hardware_probe`, `maple_20b_a1b_probe`, `memory_palace_search`, `session_export_markdown`) and also registered on `navigator.modelContext`. --- ## 4. Built-In Skills (`GET /v1/skills` & `/skills/index.json`) 1. `maple_moe_probe` — Maple 20B-A1B Ternary MoE analysis (`256E/8A`, `TQ1_0` vs `pack5`). 2. `security_audit` — Security & Secret Audit across local workspace, HTTP headers, and key storage. 3. `repo_cartography` — Smart-Tree repository cartography & refactor boundary analysis. 4. `palace_recall` — MemPalace + Honcho synthesis across wings, KG triples, and user cards. 5. `lan_node_doctor` — LAN / Offline inference check for Ollama, vLLM, llama.cpp Maple, or MLX-QUANT. 6. `webmcp_bridge` — Browser WebMCP + Google Search Grounding hybrid tool flow. --- ## 5. LAN, On-Device & Offline Mode - Zero cloud lock-in: pass `--local-only` or set route to `only_on_device` / `local_rust`. - LAN / local OpenAI-compatible nodes supported out-of-the-box: - Ollama (`http://127.0.0.1:11434/v1`) - llama.cpp Maple 20B-A1B (`http://127.0.0.1:8080/v1`) - vLLM / SGLang (`http://127.0.0.1:8000/v1`) - LM Studio (`http://127.0.0.1:1234/v1`) - Custom LAN IP hosts (e.g. `http://192.168.1.x:11434/v1`). --- ## 6. `8b-is` Stack & Hugging Face Sovereign Models - **18 `8b-is` ecosystem integrations (`GET /v1/ecosystem`)**: `kolibry`, `omnispherepop (ospop)`, `MLX-QUANT` (Metal/CUDA/AVX2+VNNI, `12.80x` throughput, commit `d9d9b05693`), `design.vaked.dev`, `ayefire-family-hub`, `qwave`, `8c-chat`, `tf-locoformer`, `smart-tree`, `smart-vault`, `substack-mcp-rs`, `zeno`, `ayeos`, `RustyNanoKVM`, `crabcc`, `colibri`, `spherepop-kernel`, `rustybox`. - **13 Hugging Face models/datasets (`GET /v1/models/catalog`)**: - `deepgrove/maple-preview` - `eightb/nostd-rust-coder-ternary-engram-v1` - `eightb/smart-tree` - `eightb/omnispherepop-benchmarks` - `PeetPedro/Qwen3.8-27B-ColdFusion-Heretic-ManusDistill-v1` - `PeetPedro/qwen4_exp-8b-obliterated-abliterated-kompress-ultra` - `PeetPedro/omnispherepop-grpo-lab` - `PeetPedro/foundation64k-v5-muad-dib` - `PeetPedro/aurora-8b-voice-burn-rl` - `PeetPedro/quantal-classroom-1.6` - `PeetPedro/qwen2.5-coder-32b-heretic-swe-sft` - `PeetPedro/quantal-ternary` - `PeetPedro/kompress-v9` --- ## 7. Security Controls (`SEC-01` through `SEC-07`) - Loopback-only HTTP server with strict `Host` DNS-rebinding rejection. - Validated loopback `Origin` CORS + per-session cryptographic `X-Aristotele-Token` CSRF guard + `Content-Security-Policy` + `X-Frame-Options: DENY`. - Strict XSS escaping & `0` dynamic inline event handlers in `WEBAPP_HTML`. - Secretless curl invocations using private `0600` `--config` files (API keys never exposed in `argv`). - Atomic `0600` temp+rename persistence for API keys, Firebase config, settings, and memory files; OS entropy CSPRNG (`/dev/urandom`). - Strict CLI bridge binary allowlist (`claude`, `gemini`, `codex`, `ollama`) with sanitized env and path containment. - Symlink-safe workspace tool jail, input JSON nesting depth cap (`<= 64`), and server thread concurrency cap.