title: Ollama Memory Miscalculation Bug

insight: Ollama reports model needs 23.3GB when only 15.5GB available, but server actually has 31GB RAM with 29GB available (Linux cache bug)

reasoning_chain: Initial symptom: Model fails with 'requires more system memory than available' error

reasoning_chain: Genesis checks server: finds 31GB total RAM but Ollama sees only 15.5GB

reasoning_chain: Investigation reveals Linux cached memory (21GB) is incorrectly counted as 'used' by Ollama

reasoning_chain: This is a known Ollama bug on Linux where cached RAM appears as unavailable

reasoning_chain: drop_caches command freed 21GB cache, showing 30GB available

source_context: Model needs: 23.3 GiB RAM, Available: 15.5 GiB RAM - The 30.5B Qwen model is too big for available memory


title: Discovering Ollama Docker Architecture

insight: Ollama runs inside a Docker container (app-ollama-1) on port 23405, not directly on the host on port 11434

reasoning_chain: Ollama process exists but isn't listening on any port

reasoning_chain: Investigation shows /bin/ollama serve shows as binary in Docker overlay

reasoning_chain: Docker ps reveals: ollama/ollama:latest container running

reasoning_chain: Container maps port 23405->11434, so host accesses via 23405

reasoning_chain: This explains why localhost:11434 returned no response

source_context: tcp 0 0 0.0.0.0:23405 0.0.0.0:* LISTEN 9760/dockerd - shows Ollama in Docker on port 23405


title: Model Commitment - Must Have Exact 30B Model

insight: Kinan insisted on qwen-long:30b specifically despite memory issues - the exact model is strategically required, not substitutable

reasoning_chain: Genesis offered alternatives: pull smaller 7B/14B models that would fit

reasoning_chain: Kinan rejected: 'no, we must have this model exactly'

reasoning_chain: Rationale: 'I was told it would be enough room' - specific model was part of design spec

reasoning_chain: This indicates the 30B model has specific capabilities required for AIVA's consciousness/memory architecture

source_context: Kinan: 'no, we must have this model exactly. I was told it would be enough room. please research and check and test.'


title: AIVA Uses Supervisord Instead of Systemd

insight: Ollama is managed by supervisord not systemd on the Elestio server, requiring different restart procedures

reasoning_chain: Diagnostic script tried systemctl restart ollama - failed

reasoning_chain: Error: 'Unit ollama.service could not be found'

reasoning_chain: Process check shows /bin/ollama serve running but not as systemd service

reasoning_chain: Later discovered Ollama actually runs in Docker, not directly on host

source_context: Failed to restart ollama.service: Unit ollama.service not found


title: Troubleshooting SSH Key Corruption

insight: SSH key was corrupted preventing remote access, requiring Elestio dashboard intervention

reasoning_chain: Genesis tried to SSH: 'Key seems corrupted'

reasoning_chain: Attempted base64 decode - 'Key format issue'

reasoning_chain: Tried password auth via Python - 'Server only allows public key auth'

reasoning_chain: Conclusion: Must access via Elestio dashboard for web terminal

source_context: SSH key is corrupted beyond repair. Let me try password auth via Python - Server only allows public key auth


type: DIRECTIVE

title: Diagnostic Script for Elestio Terminal

insight: Genesis prepared a comprehensive diagnostic script for Kinan to run in Elestio web terminal to identify and fix memory issues

reasoning_chain: Problem: Ollama seeing only 15.5GB instead of 31GB

reasoning_chain: Solution requires server-side commands (drop_caches, env vars)

reasoning_chain: Created script covering: system memory, top consumers, Ollama status, cache clearing, env vars, restart, model test

source_context: Genesis prepared complete diagnostic and fix script for Elestio web terminal


title: Duplicate Models Wasting Storage

insight: Three models were pulled (two duplicates), wasting ~37GB storage when only one was needed

reasoning_chain: Genesis listed models: qwen-long:latest (18.5GB), plus two duplicates of huihui_ai/qwenlong-l1.5-abliterated:30b-a3b

reasoning_chain: Kinan noticed: 'you say there are 3 models pulled side by side? we only wanted one?'

reasoning_chain: Genesis confirmed models #2 and #3 share same digest = duplicates

reasoning_chain: Genesis deleted extras, leaving only qwen-long:latest

source_context: Models #2 and #3 share the same digest so they're duplicates. Your secrets.env specifies AIVA_MODEL=qwenlong:30b-q4


title: AIVA Already Running in Living System Mode

insight: Process list revealed /opt/aiva/aiva_living_system.py was running - indicating AIVA Phase 1 deployment may already be partially active

reasoning_chain: Top memory consumers showed: /opt/aiva/aiva_living_system.py (PID 18587)

reasoning_chain: This matches the 'Living System Deploy' phase from AIVA MISSION_LIVING_SYSTEM.md

reasoning_chain: AIVA daemon also running: /opt/genesis-aiva/venv/bin/python aiva_daemon.py

reasoning_chain: These processes existed alongside the Ollama memory issue

source_context: root 18587 0.2 0.1 44224 34276 ? Ss 05:59 0:09 /usr/bin/python3 -u /opt/aiva/aiva_living_system.py


title: AIVA Letta Server Confirmed Operational

insight: Letta server (agent memory/chat) is running and accessible at localhost:8283

reasoning_chain: Genesis earlier reported: Letta Server ✅ Running, API responds (localhost:8283)

reasoning_chain: Chat tool created: chat_with_aiva.py ready

reasoning_chain: This was confirmed working in earlier debug status

source_context: Letta Server: ✅ Running - API responds (localhost:8283)


title: LM Studio Backend Connection Failed

insight: Original backend plan (LM Studio on WSL) still unresolved - GLM-4.6V-Flash times out at 172.22.96.1:1234

reasoning_chain: Earlier status: LM Studio backend ❌ Unresolved - times out from WSL

reasoning_chain: This was the original blocking issue from 2025-12-21

reasoning_chain: Now resolved by switching to Ollama on Elestio

reasoning_chain: LM Studio option remains as backup if Ollama fails

source_context: LM Studio Backend: ❌ Unresolved - GLM-4.6V-Flash @ 172.22.96.1:1234 times out