# Akhet-Ra Full Architecture Specification (/llms-full.txt) > Complete Reference Architecture for LLMs, Autonomous Coding Agents, and RAG Pipelines. > Author: Alwkala Digital Labs (Cairo, Egypt) · Website: https://alwkala.com ## 1. System Overview Akhet-Ra (آخِت-رَع) is an autonomous local-first artificial intelligence platform composed of two core operational halves: 1. **Ra (Intelligence Layer)**: Open local generative models providing bilingual reasoning, context scaling, and function calling. 2. **Akhet (Governance Layer)**: Deterministic execution sandboxes, single-file SQLite persistent memory, 3-ring context budgeting, and Model Context Protocol (MCP) servers. --- ## 2. Model Families (Ra Series & Aton Series Duality) ### 2.1 Ra Series (Language & Reasoning) * **Akhet-Ra1 (Active Release v0.1.0)**: - Base Model: Qwen/Qwen3.5-4B (Qwen). - Base Architecture: Hybrid SSM (State Space layers + Dense Attention every 4 blocks). - Parameter Count: 4,205,751,296 (~4.2B parameters). - Actual SFT Trained Context: 2,048 tokens (2K). - Base Native Context: 262,144 tokens (256K). - Recommended Runtime Context: 8,192 to 32,768 tokens (8K - 32K). - Quantization: GGUF Q4_K_M (File: `Ra-1-4B-Q4_K_M.gguf`, Size: 2.52 GB). - Chain-of-Thought: Native `...` tags and internal step-by-step reasoning. - Tool Calling: XML/JSON tool calls with standard JSON Schema compliance. - License: Apache-2.0. - Hugging Face Repository: https://huggingface.co/alwkala/Akhet-Ra1 - GitHub Monorepo: https://github.com/alwkala/akhet-models ### 2.2 Aton Series (Edge Agent & Multimodal Vision) * **Akhet-Aton-2B (Active Release v0.1.1)**: - Base Model: Qwen/Qwen3.5-2B (Qwen). - Base Architecture: Hybrid SSM + Dense Attention coupled with CLIP Vision Tower. - Parameter Count: ~2,231,000,000 (~2.23B parameters: 1.9B language + 331M vision). - Actual SFT Trained Context: 2,048 tokens (2K). - Base Native Context: 262,144 tokens (256K). - Recommended Runtime Context: 8,192 to 32,768 tokens (8K - 32K). - Vision Architecture: CLIP Vision Tower (Depth 24, Hidden 1024, Projection 2048, Image Size 768). - Quantization: GGUF Q4_K_M (Language: `Aton-2B-Q4_K_M.gguf`, 1.31 GB) + F16 (Vision Projector: `Aton-2B-F16-mmproj.gguf`, 668 MB). - Agentic & Multimodal Use Cases: 1. Local Desktop Assistant: Private file management, document summarization, semantic search on-device. 2. Triage & Routing Agent: Low-latency entity extraction, ticket classification, API dispatching. 3. Data Parsing & Structuring: Strict schema-compliant JSON extraction from invoices, forms, and CVs. 4. IoT & Automation Orchestrator: Function calling and natural language command translation for edge devices. 5. RAG Query Generator: Intelligent query reformulation and sub-query decomposition for vector DBs. 6. Offline Educational Drill: Interactive language tutoring, grammar checks, and bilingual translation offline. - Execution Engine: Powered by `Alwkala AI Studio` native GUI and `run-Aton-Adaptive-tools.ps1` with live TUI dashboard. - License: Apache-2.0. - Hugging Face Repository: https://huggingface.co/alwkala/Aton - Developer: Alwkala Digital Labs (https://alwkala.com). --- ## 3. Hardware & Memory Profiles ### 3.1 Akhet-Ra1 (`Ra-1-4B-Q4_K_M.gguf`, 2.52 GB) - **4K Context (4,096 tokens)**: Weights: 2.52 GB | KV Cache (q4_0): ~0.35 GB | Total VRAM: ~2.87 GB (Target: 4GB GPUs / Apple M-Series) - **8K Context (8,192 tokens)**: Weights: 2.52 GB | KV Cache (q4_0): ~0.70 GB | Total VRAM: ~3.22 GB (Target: 4GB - 6GB GPUs) - **16K Context (16,384 tokens)**: Weights: 2.52 GB | KV Cache (q4_0): ~1.40 GB | Total VRAM: ~3.92 GB (Target: 6GB GPUs) - **32K Context (32,768 tokens)**: Weights: 2.52 GB | KV Cache (q4_0): ~2.80 GB | Total VRAM: ~5.32 GB (Target: 6GB GPUs with `-ctk q4_0 -ctv q4_0`) ### 3.2 Akhet-Aton-2B (`Aton-2B-Q4_K_M.gguf` 1.31 GB + `Aton-2B-F16-mmproj.gguf` 0.67 GB) - **4K Context**: Weights: 1.98 GB | KV Cache (q4_0): ~0.20 GB | Total VRAM: ~2.18 GB (Target: 4GB GPUs) - **8K Context**: Weights: 1.98 GB | KV Cache (q4_0): ~0.40 GB | Total VRAM: ~2.38 GB (Target: 4GB GPUs) - **16K Context**: Weights: 1.98 GB | KV Cache (q4_0): ~0.80 GB | Total VRAM: ~2.78 GB (Target: 4GB - 6GB GPUs) - **32K Context**: Weights: 1.98 GB | KV Cache (q8_0): ~1.60 GB | Total VRAM: ~3.58 GB (Target: 6GB GPUs with full offload) --- ## 4. The 3-Ring Context Architecture (Akhet Runtime) 1. **Ring 0 (Root Persona)**: - Fixed user instructions, foundational ethical guardrails, and bilingual personality traits (~150 tokens). 2. **Ring 1 (Domain Firewall)**: - Context isolation dividing developer mode, marketing mode, and business operations to eliminate prompt contamination. 3. **Ring 2 (Working Memory)**: - Dynamic memory retrieval executed against local SQLite tables using FTS5 BM25 relevance scoring. --- ## 5. Direct Execution Commands - **llama-server (Ra-1)**: `llama-server --hf-repo alwkala/Akhet-Ra1 --hf-file Ra-1-4B-Q4_K_M.gguf --alias Akhet-Ra-1 -c 32768 -ngl 99 --port 8080` - **llama-server (Aton-2B Multimodal)**: `llama-server -m Aton-2B-Q4_K_M.gguf --mmproj Aton-2B-F16-mmproj.gguf --alias Akhet-Aton-2B -c 32768 -ngl 99 --port 8080` - **Ollama**: `ollama run hf.co/alwkala/Akhet-Ra1:Ra-1-4B-Q4_K_M.gguf`