You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Codette Adapter Training Lab

Codette is an experimental AI research system for recursive reasoning, multi-perspective cognition, and ethical AI alignment, created by Jonathan Harrison.

This repository contains the complete training pipeline, inference server, and 8 trained LoRA adapters for the Codette cognitive architecture running on Llama 3.1 8B.

Model Weights

All 8 adapters are included in two formats:

Format Directory Size Use Case
GGUF (f16) adapters/*.gguf ~924 MB llama.cpp inference with hot-swap
PEFT SafeTensors adapters_peft/*/ ~79 MB HuggingFace / transformers fine-tuning

Base model required: meta-llama/Llama-3.1-8B-Instruct (or any Llama-3.1-8B variant with hidden_size=4096)

Key Metrics

Metric Value Context
Phase Coherence (Gamma) 0.9835 11-agent convergence
AEGIS Ethical Alignment (Eta) 0.961 6-framework ethical governance
Cocoon Coherence 0.994 Memory state stability
Memory Phase Stability 0.969 Cross-session persistence
Tension Decay 91.2% 200-agent embodied simulation

Cognitive Subsystems (10 active)

Subsystem Module Purpose
Reasoning Forge reasoning_forge/forge_engine.py 6-agent multi-perspective debate + synthesis
Epistemic Metrics reasoning_forge/epistemic_metrics.py RC+xi tension/coherence tracking
Quantum Spiderweb reasoning_forge/quantum_spiderweb.py 5D belief propagation + attractor detection
Cocoon Sync reasoning_forge/cocoon_sync.py Fernet-encrypted federated state sync
AEGIS reasoning_forge/aegis.py 6-framework ethical governance (utilitarian, deontological, virtue, care, ubuntu, indigenous)
Nexus Signal Engine reasoning_forge/nexus.py Pre-corruption detection via entropy + FFT + intent vectors
Living Memory reasoning_forge/living_memory.py Emotionally-tagged memory cocoons with SHA-256 anchors
Guardian reasoning_forge/guardian.py 3-layer protection (sanitizer + ethical anchor + trust calibrator)
Resonant Continuity reasoning_forge/resonant_continuity.py Psi_r wavefunction: emotion x energy x frequency x intent
Perspective Registry reasoning_forge/perspective_registry.py 12 perspectives (8 LoRA-backed + 4 prompt-only with fallback)

Architecture

codette-training-lab/
โ”œโ”€โ”€ dataset_engine/          # Dataset generation pipeline
โ”‚   โ”œโ”€โ”€ template_registry.py # Rich template pools per adapter
โ”‚   โ”œโ”€โ”€ answer_generator.py  # Structured educational answer generation
โ”‚   โ”œโ”€โ”€ dataset_generator.py # Main generator with dedup + validation
โ”‚   โ””โ”€โ”€ templates/           # JSON template definitions
โ”‚
โ”œโ”€โ”€ reasoning_forge/         # Multi-agent reasoning dataset refinement
โ”‚   โ”œโ”€โ”€ agents/              # Newton, Quantum, Ethics, Philosophy, DaVinci, Empathy
โ”‚   โ”œโ”€โ”€ critic_agent.py      # Quality evaluation agent
โ”‚   โ”œโ”€โ”€ synthesis_engine.py  # Multi-perspective synthesis
โ”‚   โ”œโ”€โ”€ problem_generator.py # Reasoning problem generation
โ”‚   โ””โ”€โ”€ forge_engine.py      # Orchestrator
โ”‚
โ”œโ”€โ”€ training/                # LoRA training scripts
โ”‚   โ”œโ”€โ”€ train_adapter.py     # Single adapter training (4-bit LoRA)
โ”‚   โ”œโ”€โ”€ train_all_adapters.py# Sequential multi-adapter training
โ”‚   โ”œโ”€โ”€ merge_adapters.py    # Merge LoRA into base model
โ”‚   โ””โ”€โ”€ configs/             # Training hyperparameters
โ”‚
โ”œโ”€โ”€ evaluation/              # Benchmarks and quality assurance
โ”‚   โ”œโ”€โ”€ reasoning_metrics.py # Multi-dimensional scoring
โ”‚   โ”œโ”€โ”€ benchmark_runner.py  # Automated evaluation
โ”‚   โ”œโ”€โ”€ dataset_validator.py # Dataset quality checks
โ”‚   โ”œโ”€โ”€ failure_analyzer.py  # Weakness detection
โ”‚   โ””โ”€โ”€ prompts/             # Benchmark test sets
โ”‚
โ”œโ”€โ”€ observatory/             # Experiment tracking and monitoring
โ”‚   โ”œโ”€โ”€ metrics_logger.py    # Training run logging
โ”‚   โ”œโ”€โ”€ performance_tracker.py # Improvement trends
โ”‚   โ”œโ”€โ”€ dataset_quality_monitor.py
โ”‚   โ””โ”€โ”€ dashboard.py         # ASCII status dashboard
โ”‚
โ”œโ”€โ”€ research/                # Source research documents
โ”‚   โ”œโ”€โ”€ papers/              # Published manuscripts
โ”‚   โ”œโ”€โ”€ frameworks/          # RC+xi, quantum equations, perspectives
โ”‚   โ””โ”€โ”€ experiments/         # Cocoon simulations, logs
โ”‚
โ”œโ”€โ”€ datasets/                # Generated training datasets (JSONL)
โ”œโ”€โ”€ adapters/                # Trained LoRA adapters
โ”œโ”€โ”€ scripts/                 # Pipeline orchestration
โ”‚   โ”œโ”€โ”€ run_full_pipeline.py # End-to-end pipeline
โ”‚   โ””โ”€โ”€ hf_job.yaml          # HuggingFace job config
โ””โ”€โ”€ configs/                 # System configuration
    โ”œโ”€โ”€ adapter_registry.yaml
    โ””โ”€โ”€ pipeline_config.yaml

Adapters

Adapter Domain Target Examples System Prompt
Newton Analytical physics reasoning 3000 Newtonian analytical precision
DaVinci Creative invention thinking 2500 Creative inventiveness
Empathy Emotional understanding 2500 Deep empathy and EQ
Philosophy Conceptual reasoning 2000 Philosophical depth
Quantum Probabilistic thinking 2000 Quantum probabilistic thinking
RC+xi Recursive cognition 3000 RC+xi framework reasoning
Multi-Perspective Synthesis across lenses 2500 Multi-perspective synthesis
Systems AI architecture 2000 System architecture design

Training Pipeline

research documents
      โ†“
dataset extraction (template-based generation)
      โ†“
synthetic reasoning expansion (counterexamples, variations)
      โ†“
dataset validation (dedup, quality filter)
      โ†“
reasoning forge (multi-agent critique + refinement)
      โ†“
adapter training (4-bit LoRA on Llama 3.1 8B)
      โ†“
benchmark evaluation (multi-dimensional reasoning metrics)
      โ†“
observatory logging (track improvement over time)

Quick Start

Install dependencies

pip install -r requirements.txt

Generate all datasets

python -m dataset_engine.generate_all

Run full pipeline

python scripts/run_full_pipeline.py --all

Generate + validate only

python scripts/run_full_pipeline.py --generate --validate

Train a single adapter

python -m training.train_adapter \
  --dataset datasets/newton_reasoning.jsonl \
  --adapter-name newton \
  --output-dir adapters/newton

Run benchmarks

python -m evaluation.benchmark_runner --prompts evaluation/prompts/reasoning_tests.json

View dashboard

python -m observatory.dashboard

Dataset Format

All datasets use chat-format JSONL:

{
  "messages": [
    {"role": "system", "content": "You are Codette, a recursive multi-perspective reasoning AI."},
    {"role": "user", "content": "Explain the conservation of momentum using a real-world example."},
    {"role": "assistant", "content": "Conservation of momentum states that in a closed system..."}
  ]
}

Reasoning Forge

The Reasoning Forge refines training data through multi-agent debate:

concept โ†’ problem generator โ†’ agent analysis โ†’ critic evaluation โ†’ synthesis โ†’ training example

Agents: Newton (physics), Quantum (probability), Ethics (alignment), Philosophy (meaning), DaVinci (creativity), Empathy (emotion)

Each agent analyzes from its perspective, the critic scores quality, and the synthesis engine produces a unified multi-perspective response.

Base Model

  • Model: meta-llama/Llama-3.1-8B-Instruct
  • Method: QLoRA (4-bit quantization)
  • LoRA config: rank=16, alpha=32, target=q/k/v/o projections

Research Background

Codette implements the RC+xi (Recursive Convergence + Epistemic Tension) framework for structured multi-perspective reasoning. The system coordinates 11 reasoning perspectives in parallel before synthesizing a final response.

Key research documents in research/:

  • RC+xi Framework specification
  • Quantum Cosmic Multicore experiment
  • Codette Research Equations (8 core quantum mathematics)
  • Multi-perspective reasoning architecture

Inference Server

Codette includes a full web UI for interactive multi-perspective chat:

# Launch the web UI (default port 5000)
python inference/codette_server.py

# Or use the batch file
codette_web.bat

The UI features:

  • Real-time adapter hot-swap (0ms switching via llama.cpp LoRA slots)
  • Quantum spiderweb visualization of belief propagation
  • Live AEGIS ethical alignment tracking
  • Nexus signal analysis panel
  • Memory cocoon emotional profiling
  • Resonance wavefunction display

LoRA Configuration

method: QLoRA (4-bit NF4 quantization)
rank: 16
alpha: 32
dropout: 0.05
target_modules: [q_proj, k_proj, v_proj, o_proj]
total_training_examples: 20,500

RC+xi Framework

The core theoretical framework โ€” Recursive Convergence + Epistemic Tension โ€” coordinates 11 reasoning perspectives:

  1. Newton (analytical physics) โ†’ newton adapter
  2. DaVinci (creative invention) โ†’ davinci adapter
  3. Empathy (emotional intelligence) โ†’ empathy adapter
  4. Philosophy (conceptual reasoning) โ†’ philosophy adapter
  5. Quantum (probabilistic thinking) โ†’ quantum adapter
  6. RC+xi Consciousness โ†’ consciousness adapter
  7. Multi-Perspective Synthesis โ†’ multi_perspective adapter
  8. Systems Architecture โ†’ systems_architecture adapter
  9. Human Intuition โ†’ prompt-only (fallback: empathy)
  10. Resilient Kindness โ†’ prompt-only (fallback: empathy)
  11. AEGIS Ethics โ†’ prompt-only (fallback: consciousness)

Requirements

  • Python 3.10+
  • PyTorch 2.1+ (CUDA, ROCm, or XPU backend)
  • 16GB+ RAM (CPU training) or GPU with 8GB+ VRAM
  • llama.cpp with GGUF support (for inference server)
  • ~1-3 hours per adapter (CPU) or 20-40 min (A10/A100 GPU)

Hardware Tested

  • Intel Arc 140V (8GB) โ€” PyTorch 2.10.0+xpu, native XPU backend
  • NVIDIA GPUs via CUDA (A10, A100, RTX series)
  • CPU-only mode supported

License

MIT โ€” Research project by Jonathan Harrison. Experimental AI development.

Downloads last month
1
GGUF
Model size
13.6M params
Architecture
llama
Hardware compatibility
Log In to add your hardware

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Raiff1982/codette-training-lab

Adapter
(1761)
this model

Space using Raiff1982/codette-training-lab 1

Evaluation results