Skip to content
Matthew chen edited this page Sep 30, 2026 · 1 revision

Welcome to the dual-loop-controller wiki!

Welcome to the Dual-Loop Cognitive Controller Wiki

Welcome to the official documentation wiki for Dual-Loop Cognitive Controller (HADL v3.1.0) — an open-source, model-agnostic Cognitive Operating System (Cognitive OS) for Large Language Models (LLMs) and Vision-Language Models (VLMs).


🧭 Wiki Navigation

Topic Description Link
Cognitive OS Architecture Deep dive into the 5 Computational Brain Organs [[Architecture: Cognitive OS
Latent Reconstructive Hologram Candès-Tao compressed sensing & FISTA recovery for 27B → 2B zero-OOM inference [[Latent Reconstructive Hologram
Benchmarks & Validation HA-COGBENCH, Qwen3.8-27B OOM Profiler, Web Game Arena [[Benchmarks & Validation
Python SDK & API Reference Complete class, method, and function documentation [[API Reference & SDK
Security & Sandboxing Compliance matrix SEC-01 to SEC-11, AST sandboxing [[Security & Sandboxing
CLI & Production Deployment Command-line guide, Windows .bat launchers, vLLM & CUDA graphs [[CLI & Production Deployment
Mathematical Formulations Theorems, Lyapunov proofs, and active inference equations [[Mathematical Formulations

🏛️ What is HADL?

HADL (Hardware-Aligned Autopoietic Latent Deliberation) bridges the gap between reactive autoregressive next-token prediction and autonomous human-grade cognition.

Unlike Chain-of-Thought (CoT) prompting which pollutes the context window with thousands of discrete scratchpad tokens, HADL operates inside continuous latent manifolds:

  • Zero Output Token Waste: 0 extra tokens generated during System 2 reasoning.
  • Continuous State Space: Deliberation occurs over latent vectors $\mathbb{R}^{D}$.
  • Zero Interference: Memories are consolidated into orthogonal nullspaces ($P_{null} = I - V V^T$) guaranteeing $0.000000$ catastrophic forgetting.
  • Hardware Alignment: Enables 27B/30B foundation models to run on 8GB consumer GPUs at 34.60 tok/s with zero OOM errors.

📦 Quick Installation

# Core package from PyPI
pip install dual-loop-controller==3.1.0

# With Hugging Face Transformers & Accelerate
pip install "dual-loop-controller[llm]==3.1.0"

💡 Quick Start in 3 Lines

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from dual_loop import attach

# Load any model (Qwen, Gemma, LLaMA, Mistral, GLM-4)
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct", torch_dtype=torch.bfloat16, device_map="auto")

# Attach Dual-Loop Cognitive Controller
model = attach(base_model, k_steps=2, enable_allostatic_modulation=True)

# Generate with deliberative System 2 reasoning
output = model.generate(**inputs, max_new_tokens=64)

🤝 Community & Support