Upload README.md
Browse files
README.md
CHANGED
|
@@ -7,175 +7,6 @@ tags:
|
|
| 7 |
- local-llm
|
| 8 |
license: apache-2.0
|
| 9 |
---
|
| 10 |
-
|
| 11 |
-
# Lambda Mindlink Memotron
|
| 12 |
-
|
| 13 |
-
A three-hemisphere cognitive AI architecture running entirely locally via llama-cpp-python.
|
| 14 |
-
|
| 15 |
-
## Architecture
|
| 16 |
-
|
| 17 |
-
* **Logic AI** — Left hemisphere: analytical, structured reasoning
|
| 18 |
-
* **Muse AI** — Right hemisphere: creative, intuitive synthesis
|
| 19 |
-
* **Lambda Mind** — Stem brain: vector synthesis of both hemispheres
|
| 20 |
-
* **Condensatron** — Post-level memory compression (surprise extraction)
|
| 21 |
-
* **Fractaltron** — Second-order fractal compression of memory capsules
|
| 22 |
-
|
| 23 |
-
## Models Used
|
| 24 |
-
|
| 25 |
-
Download the GGUFs from Hugging Face and place in `ai-models/`:
|
| 26 |
-
|
| 27 |
-
* [google/gemma-4-E2B-it](https://huggingface.co/...) — development/debug
|
| 28 |
-
* [Qwen/Qwen3-...](https://huggingface.co/...) — optional swap-in
|
| 29 |
-
|
| 30 |
-
## Install
|
| 31 |
-
|
| 32 |
-
```bash
|
| 33 |
-
pip install llama-cpp-python --extra-index-url \
|
| 34 |
-
https://abetlen.github.io/llama-cpp-python/whl/cu121 # adjust for your CUDA version
|
| 35 |
-
pip install -r requirements.txt
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
## Run
|
| 39 |
-
|
| 40 |
-
```bash
|
| 41 |
-
python main.py
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
## Memory Architecture of the KV cache
|
| 45 |
-
|
| 46 |
-
1. If at startup `N_MEMORY_CAPSULES_TO_LOAD > 0`, then the Memory Capsule and the response are appended to garden["M"], already being Memory Capsules.
|
| 47 |
-
2. The user chat is appended to the garden["Z"] being uncompressed.
|
| 48 |
-
3. condensatron: If the garden["n_tok_tot"]["Z"] > CONDENSATRON_THRESHOLD_LEVEL`: start condensatron_cycle.
|
| 49 |
-
4. fractaltron: If the `HEMISPHERES[brain_type]["loader"]["n_ctx"] - (CONDENSATRON_THRESHOLD_LEVEL + RESERVED_FOR_PROMPT)`:
|
| 50 |
-
1. Check and process garden["Z"] posts with condesatron and append to garden["M"]
|
| 51 |
-
2. Now process part of garden["M"] with the fractaltron_cycle
|
| 52 |
-
|
| 53 |
-
```
|
| 54 |
-
[Instructions] → [garden["M"] memory capsules] → [garden["Z"] post-level cache]
|
| 55 |
-
↑ Fractaltron ↑ Condensatron
|
| 56 |
-
```
|
| 57 |
-
|
| 58 |
-
---
|
| 59 |
-
|
| 60 |
-
## Setup
|
| 61 |
-
|
| 62 |
-
```bash
|
| 63 |
-
# --- Linux RedHat Fedora ------ #
|
| 64 |
-
# First you must install the c++ compiler
|
| 65 |
-
# to compile the llama-cpp-python package
|
| 66 |
-
sudo dnf install -y cmake gcc-c++ python3-devel
|
| 67 |
-
|
| 68 |
-
# Navigate to the project folder
|
| 69 |
-
cd lambda-mindlink-memotron
|
| 70 |
-
# Create the virtual environment
|
| 71 |
-
python -m venv .venv
|
| 72 |
-
# Activate the virtual environment
|
| 73 |
-
source .venv/bin/activate
|
| 74 |
-
|
| 75 |
-
# ------ llama-cpp-python ------ #
|
| 76 |
-
# ROCm AMD Ryzen iGPU support version
|
| 77 |
-
CMAKE_ARGS="-DGGML_HIPBLAS=on" pip install llama-cpp-python
|
| 78 |
-
# CPU-only version
|
| 79 |
-
pip install llama-cpp-python
|
| 80 |
-
|
| 81 |
-
# Nvidia CUDA version (not tested)
|
| 82 |
-
pip install llama-cpp-python --extra-index-url \
|
| 83 |
-
https://abetlen.github.io/llama-cpp-python/whl/cu121
|
| 84 |
-
|
| 85 |
-
# Uninstall any previous failed attempts
|
| 86 |
-
pip uninstall llama-cpp-python -y
|
| 87 |
-
# ------------------------------ #
|
| 88 |
-
|
| 89 |
-
# Install the project requirements
|
| 90 |
-
pip install -r requirements.txt
|
| 91 |
-
```
|
| 92 |
-
|
| 93 |
-
## Run Lambda
|
| 94 |
-
|
| 95 |
-
```bash
|
| 96 |
-
# Open your Terminal
|
| 97 |
-
# Navigate to the project folder
|
| 98 |
-
cd lambda-mindlink-memotron
|
| 99 |
-
|
| 100 |
-
# Linux: Activate the virtual environment
|
| 101 |
-
source .venv/bin/activate
|
| 102 |
-
|
| 103 |
-
# Start Lambda
|
| 104 |
-
python main.py
|
| 105 |
-
```
|
| 106 |
-
|
| 107 |
-
---
|
| 108 |
-
|
| 109 |
-
## Memory: Startup
|
| 110 |
-
|
| 111 |
-
> Load the basic vector synthesis memory into the garden["M"]
|
| 112 |
-
|
| 113 |
-
Note: this requires to compute each Memory Capsule one-by-one for the KV cache.
|
| 114 |
-
|
| 115 |
-
```bash
|
| 116 |
-
# Find and set the variable in config.py
|
| 117 |
-
# Default settings (~10k tokens)
|
| 118 |
-
N_MEMORY_CAPSULES_TO_LOAD: int = 4
|
| 119 |
-
```
|
| 120 |
-
|
| 121 |
-
---
|
| 122 |
-
|
| 123 |
-
## RAM estimate (three 4B Q6_K instances)
|
| 124 |
-
|
| 125 |
-
| Component | ~Size |
|
| 126 |
-
|-----------|-------|
|
| 127 |
-
| 3× model weights | ~10.5 GB |
|
| 128 |
-
| 3× KV caches (6144 ctx) | ~1.0 GB |
|
| 129 |
-
| OS + overhead | ~2.0 GB |
|
| 130 |
-
| **Total** | **~13.5 GB** |
|
| 131 |
-
|
| 132 |
-
---
|
| 133 |
-
|
| 134 |
-
## Folder structure
|
| 135 |
-
|
| 136 |
-
```
|
| 137 |
-
lambda-mindlink-memotron/
|
| 138 |
-
├── ai-models/
|
| 139 |
-
| └── CoT_/
|
| 140 |
-
├── db/
|
| 141 |
-
├── model-readme/
|
| 142 |
-
├── prompt/
|
| 143 |
-
├── main.py
|
| 144 |
-
├── config.py
|
| 145 |
-
├── requirements.txt
|
| 146 |
-
└── README.md
|
| 147 |
-
```
|
| 148 |
-
|
| 149 |
-
---
|
| 150 |
-
|
| 151 |
-
## Future milestones (from the flowchart)
|
| 152 |
-
|
| 153 |
-
| Milestone | Description |
|
| 154 |
-
|-----------|-------------|
|
| 155 |
-
| **X-factor (Awareness)** | News / web feed input routed to Garden['X'] |
|
| 156 |
-
| **Y-factor (Consciousness)** | Self-reflection loop — the "I think therefore I am" |
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
|
| 180 |
# Lambda Mindlink Memotron
|
| 181 |
|
|
|
|
| 7 |
- local-llm
|
| 8 |
license: apache-2.0
|
| 9 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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