Subject-Emu-5259 commited on
Commit
db30ef1
·
verified ·
1 Parent(s): 289647f

docs: sync README with GitHub (v7.3.2)

Browse files
Files changed (1) hide show
  1. README.md +283 -37
README.md CHANGED
@@ -1,58 +1,304 @@
1
  ---
2
- library_name: transformers
 
 
3
  license: apache-2.0
4
- pipeline_tag: text-generation
5
  tags:
6
- - smollm2
7
  - lora
8
- - dpo
 
9
  - peft
10
- - neuralai
 
 
 
11
  base_model: HuggingFaceTB/SmolLM2-360M-Instruct
12
- model_name: NeuralAI v2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  ---
14
 
15
- # NeuralAI v2 (merged)
16
 
17
- This repository hosts the **merged** weights of the [NeuralAI v2 LoRA + DPO adapter](https://huggingface.co/Subject-Emu-5259/NeuralAI/tree/main).
18
 
19
- It is the same model and tokenizer as the LoRA-only repo, but with the adapter weights fused into the base load it directly without `peft.PeftModel.from_pretrained()`.
20
 
21
- ## Model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
- - **Base:** `HuggingFaceTB/SmolLM2-360M-Instruct`
24
- - **Adapter:** LoRA rank 16, alpha 32, dropout 0.05
25
- - **Method:** DPO preference alignment on top of SFT
26
- - **Params:** 361.8M
27
- - **License:** Apache-2.0
28
- - **Framework:** PyTorch + Transformers 5.5.4 + PEFT 0.19.0
29
 
30
- ## How to load
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  ```python
33
- import torch
34
- from transformers import AutoModelForCausalLM, AutoTokenizer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- repo = "Subject-Emu-5259/NeuralAI" # this repo
37
- tok = AutoTokenizer.from_pretrained(repo)
38
- model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
 
 
 
 
 
 
39
 
40
- prompt = "NeuralAI is"
41
- inputs = tok(prompt, return_tensors="pt").to(model.device)
42
- out = model.generate(**inputs, max_new_tokens=80, do_sample=True, top_p=0.9, temperature=0.7)
43
- print(tok.decode(out[0], skip_special_tokens=True))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  ```
45
 
46
- ## Training
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
- | Field | Value |
49
- |---|---|
50
- | Method | LoRA + DPO preference alignment |
51
- | Epochs | 3 |
52
- | Learning rate | 2e-4 |
53
- | Train / val | 363 / 41 |
54
- | Duration | ~26 min |
55
- | Completed | 2026-05-17 |
56
- | Framework | PyTorch + Transformers + PEFT 0.19.0 |
57
 
58
- By De'Andrew P. Harris. NeuralAI is part of the NeuralAI / NeuralLabs product stack.
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ library_name: peft
5
  license: apache-2.0
 
6
  tags:
 
7
  - lora
8
+ - conversational
9
+ - text-generation
10
  - peft
11
+ - smollm2
12
+ - dpo
13
+ - fine-tuned
14
+ model_id: Subject-Emu-5259/NeuralAI
15
  base_model: HuggingFaceTB/SmolLM2-360M-Instruct
16
+ inference: false
17
+ ---
18
+
19
+ # 🧠 NeuralAI: The Generative AI Engine
20
+
21
+ <img src="neuralai_banner.svg" alt="NeuralAI - Your AI. On your hardware. In your browser." />
22
+
23
+ ## 📊 Repository Composition
24
+
25
+ | Language | Percentage |
26
+ | --- | --- |
27
+ | Python | 71.1% |
28
+ | HTML | 13.0% |
29
+ | JavaScript | 12.4% |
30
+ | CSS | 2.6% |
31
+ | Shell | 0.4% |
32
+ | Jupyter Notebook | 0.3% |
33
+ | Jinja | 0.2% |
34
+
35
+ **The High-Velocity Model for Your Entire Vibe Stack**
36
+
37
+ NeuralAI is the central intelligence engine developed by **De'Andrew Preston Harris**. Conceived and engineered by **De'Andrew Preston Harris** (Founder), it is a highly tuned, DPO-aligned multimodal AI ec\[...\]
38
+
39
  ---
40
 
41
+ ## 🌟 Vision & Manifesto
42
 
43
+ NeuralAI doesn't just predict text; it *operates the work*. The core mission is to create a multimodal generative system that bridges the gap between raw idea and execution. By fusing autoregressi\[...\]
44
 
45
+ Born from resilience and ambition in Memphis, Tennessee and West Memphis, Arkansas, NeuralAI represents a forward-thinking approach to personal, private AI computing.
46
 
47
+ ---
48
+
49
+ ## 🛠️ Tech Stack & Architecture (v7.2)
50
+
51
+ NeuralAI is built on a high-performance architecture that decouples the inference engine from the web interface, enabling lightweight cloud hosting with powerful local inference.
52
+
53
+ ### Core Stack
54
+
55
+ - **Core Model**: `SmolLM2-360M-Instruct` fine-tuned with the custom **SFT v16 + DPO v16 LoRA** at `checkpoints/v2_model` — aligned for logic, math, multi-step reasoning, and debugging
56
+ - **Inference Engine**: [llmster](https://lmstudio.ai/docs/cli) (LM Studio headless) — OpenAI-compatible API with continuous batching, running via llama.cpp
57
+ - **Vocal Identity**: Andrew (Warm/Multilingual) — Optimized for Live Speech-to-Speech (S2S)
58
+ - **Backend Framework**: Python / Flask (Core Service) — routes to llmster or local PyTorch
59
+ - **Storage & Database**: SQLite3 (Metadata) + Nextcloud Hub via NeuralCloud WebDAV Client (NeuralDrive)
60
+ - **Frontend UI**: Vanilla JS, HTML5, CSS3 with an advanced Dark Mode layout
61
+
62
+ ### Pluggable LLM Backend
63
+
64
+ NeuralAI supports multiple inference backends via the `LLM_BACKEND` environment variable:
65
+
66
+ | Backend | `LLM_BACKEND` | API Endpoint | Use Case |
67
+ | --- | --- | --- | --- |
68
+ | **llmster** (recommended) | `lmstudio` | `http://localhost:1234/v1` | Headless GPU/CPU inference |
69
+ | **Ollama** | `ollama` | `http://localhost:11434/v1` | Local Ollama server |
70
+ | **OpenAI-compatible** | `openai_compatible` | Any OpenAI API URL | Remote/cloud inference |
71
+ | **Local PyTorch** | `local` | Built-in transformers | Loads BASE_MODEL + LoRA at MODEL_PATH in float16 (your own model) |
72
+ | **ZO Native (fallback)** | `zo` | `https://api.zo.computer/zo/ask` | Routes to Zo's own assistant (HY3) — **NOT** your NeuralAI model; last-resort only |
73
+
74
+ > **Hosting on ZO Computer (4 GB RAM):** set `LLM_BACKEND=local`. The service loads `BASE_MODEL`
75
+ > (default `HuggingFaceTB/SmolLM2-360M-Instruct`) and applies the LoRA at `MODEL_PATH`
76
+ > (default `checkpoints/v2_model`) in float16 (~720 MB), which fits the 4 GB host. **Do not use
77
+ > `LLM_BACKEND=zo` for the chat UI** — it proxies to Zo's assistant and answers as "Zo Computer's
78
+ > assistant" instead of your trained model.
79
+
80
+ ```bash
81
+ # Example: start NeuralAI with llmster backend
82
+ LLM_BACKEND=lmstudio LLM_API_URL=http://localhost:1234/v1 LLM_MODEL=smollm2 \
83
+ python3 services/neural_core_service.py
84
+ ```
85
 
86
+ ### Core Architectural Pillars
 
 
 
 
 
87
 
88
+ 1. **NeuralAI Core**: Handles chat state, direct model inference, terminal session proxying, and tool orchestration.
89
+ 2. **NeuralDrive (Cloud Storage)**: The intelligent data layer for all projects, featuring isolated user storage, automatic versioning, and semantic mapping.
90
+ 3. **Diffusion Engine**: An integrated generative diffusion layer for producing visual branding assets, UI mockups, and visual logic maps.
91
+ 4. **Agentic Orchestrator**: A high-autonomy layer enabling NeuralAI to plan, reason, and execute multi-step workflows across the OS and web, moving beyond simple chat to active goal achievement.
92
+
93
+ ---
94
+ ### 🆕 What's New (v7.3.1)
95
+
96
+ - **Developer / API Access (BYO API)**: Generate a personal API key from Settings to use NeuralAI as an OpenAI-compatible backend on other hosts (e.g. ZO Computer's "Bring Your Own API"). Exposes `/v1/chat/completions` and `/v1/models`; keys are hashed and revocable.
97
+ - **Auto Release Notes ("What's New")**: A new top-bar panel surfaces the latest features and fixes automatically. Open it anytime via the ✨ **What's New** button.
98
+ - **Generated images render in chat**: Image-generation responses are parsed as Markdown and displayed inline.
99
+ - **No more self-talk**: Chat now uses the ChatML prompt template (`apply_chat_template`), matching the model's training format.
100
+ - **NeuralDrive upload reliability**: The file list correctly handles API response shapes after an upload.
101
+ - **Dark theme by default**: UI restores your saved theme and defaults to dark mode (fixes white file-cards in light mode).
102
+ - **Phase 8 in progress**: Knowledge Graph & Agentic Autonomy — long-term cross-project memory ("Supermemory") and fully autonomous task execution.
103
+ - **The NeuralLabs Shift**: NeuralAI is evolving into a standalone, downloadable intelligence environment (NeuralLabs v1 Client → v2 Edge → v3 Eco).
104
+ - **v7.3.2 — Backend identity fix (ZO hosting)**: The hosted service now runs `LLM_BACKEND=local` so chat uses *your* SmolLM2-360M + SFT/DPO v16 LoRA. The previous `zo` fallback proxied to Zo's assistant and answered as "I'm Zo Computer's assistant" — that was a routing bug, not your model. See `docs/INCIDENT-2026-07-14-NEURALAI-PAUSES.md`.
105
+ ## 🚀 Deployment & Model Distribution
106
+
107
+ - **Source (GitHub)**: [Subject-Emu-5259/NeuralAI](https://github.com/Subject-Emu-5259/NeuralAI)
108
+ - **Model (Hugging Face)**: [Subject-Emu-5259/NeuralAI](https://huggingface.co/Subject-Emu-5259/NeuralAI) — merged SmolLM2-360M + SFT v16/DPO v16 LoRA weights (drop-in, no PEFT needed). The LoRA adapter is also in `checkpoints/v2_model`.
109
+ - **Hosted demo**: `neuralai-web-ui-deandrewharris.zocomputer.io` (ZO Computer) — runs the local backend so chat uses the trained model directly.
110
+
111
+ To publish the LoRA to Hugging Face:
112
+
113
+ ```bash
114
+ pip install huggingface_hub
115
+ HF_TOKEN=<your-write-token> python3 -c "
116
+ from huggingface_hub import HfApi
117
+ api = HfApi()
118
+ api.upload_folder(
119
+ folder_path='checkpoints/v2_model',
120
+ repo_id='Subject-Emu-5259/NeuralAI',
121
+ repo_type='model',
122
+ commit_message='NeuralAI SmolLM2-360M SFT v16 + DPO v16 LoRA',
123
+ )
124
+ "
125
+ ```
126
+
127
+ ## ✨ Key Features & Capabilities
128
+
129
+ ### 💬 Multimodal Chat & Agentic Intelligence
130
+
131
+ - **High-Velocity Text Inference**: Fast, local inference with deep context awareness.
132
+ - **Deep Reasoning Mode**: Integration of test-time compute and chain-of-thought reasoning for complex problem decomposition and error-free logic.
133
+ - **Autonomous Agentic Workflows**: Ability to operate as an agent—interacting with the browser, terminal, and third-party apps to complete end-to-end tasks with minimal supervision.
134
+ - **Live S2S (Speech-to-Speech)**: Real-time voice interaction with an integrated microphone interface and fluid vocal responses.
135
+ - **Identity Vault & Memory**: Persistent user memory and rule constraints, ensuring NeuralAI remembers preferences, behavioral rules, and historical context.
136
+
137
+ ### 💻 Developer & Engineering Tools
138
+
139
+ - **Integrated Web Terminal**: A fully functional, WebSocket-driven terminal embedded directly in the web UI for immediate environment control.
140
+ - **File Workspace**: An in-browser IDE experience allowing users to browse directories, read, and write code seamlessly.
141
+ - **Code Execution & Sandbox**: Secure environment for the model to execute and test code on the fly.
142
+
143
+ ### 🔐 Authentication & Access Tiers
144
+
145
+ - **Founder Mode**: Ultimate root-level access and system control.
146
+ - **Maestro Student Portal**: Tiered access for educational and collaborative development.
147
+ - **Guest Preview**: Frictionless instant access for testing the system without an account.
148
+
149
+ ---
150
+
151
+ ## 🏋️ Model Training & Fine-Tuning (DPO)
152
+
153
+ NeuralAI is continuously learning and improving through rigorous **Direct Preference Optimization (DPO)**.
154
+
155
+ ### Training Pipeline
156
 
157
  ```python
158
+ # Example of the DPO alignment configuration used in NeuralAI
159
+ dpo_config = DPOConfig(
160
+ beta=0.1,
161
+ learning_rate=5e-5,
162
+ per_device_train_batch_size=4,
163
+ gradient_accumulation_steps=4,
164
+ max_length=1024,
165
+ max_prompt_length=512,
166
+ )
167
+ ```
168
+
169
+ - **Dataset Expansions**: The dataset is aggressively expanded to include advanced reasoning, complex mathematics, logical deduction, creative writing, and system debugging.
170
+ - **Behavioral Alignment**: NeuralAI is aligned using Gemini-style behavioral principles—prioritizing safety, structured reasoning, helpful conversational flow, and transparent step-by-step explanations. Training enforces clear Markdown formatting, code-first responses, and rejection of boilerplate or overly verbose outputs.
171
+ - **Model Drift Monitoring**: Continuous evaluation against previous checkpoints to ensure response quality and consistency never regress.
172
+
173
+ ### Latest Alignment Run: v15.0
174
 
175
+ - **Training samples**: 597 (expanded DPO preference pairs)
176
+ - **Epochs**: 3
177
+ - **Steps**: 450
178
+ - **Final training loss**: `0.305`
179
+ - **Reward margin**: improved from `~0.5` → `~3.5` (model strongly prefers chosen responses)
180
+ - **Hardware**: Apple Silicon MPS (MacBook Air M4)
181
+ - **Run duration**: `730.5s` (~12m 11s)
182
+ - **Completed**: `2026-07-11 20:00 UTC`
183
+ - **Adapter**: live on Hugging Face at [`Subject-Emu-5259/NeuralAI`](https://huggingface.co/Subject-Emu-5259/NeuralAI)
184
 
185
+ > The v15 dataset (`data/train_dpo_v15.jsonl`) was generated by expanding the template pools in `training/build_dataset_v15.py` from 302 → 597 unique preference pairs covering code correctness, logic, reasoning, debugging, and multi-step tasks.
186
+
187
+ ---
188
+
189
+ ## 📸 Brand & UI Gallery
190
+
191
+ *(UI screenshots showcase the beautiful dark mode interface, the terminal integration, and the NeuralDrive file explorer.)*
192
+
193
+ ```html
194
+ <!-- Example Frontend UI Component Structure -->
195
+ <div class="neural-chat-container">
196
+ <div class="message-bubble ai-response">
197
+ NeuralAI: System optimal. Ready for execution.
198
+ </div>
199
+ </div>
200
+ ```
201
+
202
+ ---
203
+
204
+ ## 🗺️ Implementation Roadmap
205
+
206
+ - ✅ **Phase 1: Alignment** - DPO training for Founder context and optimal engineering tone.
207
+ - ✅ **Phase 2: NeuralDrive** - Deployment of the Cloud Storage File Server.
208
+ - ✅ **Phase 3: Terminal UI** - Integrated command-line access within the browser.
209
+ - ✅ **Phase 4: Live S2S** - High-velocity Live Speech-to-Speech conversations.
210
+ - ✅ **Phase 5: "Founder Mode"** - Enhancements to vocal profile and streamlined UI.
211
+ - ✅ **Phase 6: Frontend Polish** - Dark themes, real-time code execution display, UI stability.
212
+ - ✅ **Phase 7: Diffusion Integration** - Implementation of Text2Img & Img2Img capabilities.
213
+ - 🚀 **Phase 8: Knowledge Graph & Agentic Autonomy** - Advanced long-term memory for cross-project context, "Supermemory" features, and fully autonomous task execution.
214
+
215
+ ---
216
+
217
+ ## 🎯 Future Vision: The Software Transition
218
+
219
+ NeuralAI is evolving from a workspace-bound assistant into a standalone, downloadable intelligence environment.
220
+
221
+ **Project Code Name**: `NeuralLabs` (Working Title)
222
+ **Vision**: A local-first, AI-native operating environment that integrates the Agentic Orchestrator, World-Brain, and NeuralDrive into a seamless desktop experience—similar to the "Codex" model but expanded into a full cognitive workspace.
223
+
224
+ ### 🚀 Roadmap Addition: The NeuralLabs Shift
225
+
226
+ - **NeuralLabs v1 (Client)**: Development of a cross-platform wrapper (Electron/Tauri) for the NeuralAI interface.
227
+ - **NeuralLabs v2 (Edge)**: Local model execution (Llama/Mistral) as a fallback for the cloud-based NeuralAI core.
228
+ - **NeuralLabs v3 (Eco)**: Plugin architecture allowing third-party "Neural-Skills" to be installed as standalone apps.
229
+
230
+ ---
231
+
232
+ ## 👨‍💻 The Developer & Architect
233
+
234
+ **De'Andrew Preston Harris** (D. Harris / Dre)
235
+ *Founder & Architect of NeuralAI*
236
+
237
+ A dedicated software engineer, thinker, and builder from West Memphis, AR. De'Andrew is currently pursuing an AAS in AI Software Engineering at Maestro College. NeuralAI is the culmination of his\[...\]
238
+
239
+ - **Location:** Memphis, TN / West Memphis, AR
240
+ - **Vision:** Building the future of private, high-performance generative AI.
241
+ - [LinkedIn](https://www.linkedin.com/in/deandrewharris94/) | [GitHub](https://github.com/Subject-Emu-5259)
242
+
243
+ ---
244
+
245
+ *Built with precision and discipline by De'Andrew Preston Harris.*
246
+
247
+ ### CURRENT VERSION: v7.3.2 (The Pluggable Engine)
248
+
249
+ - **Model Alignment**: DPO v15.0 Aligned (597 pairs, Logic, Debugging, Reasoning)
250
+ - **Inference**: llmster (LM Studio headless) — 258MB RAM vs 5GB PyTorch
251
+ - **Last Maintenance**: July 14, 2026
252
+
253
+ Your tone is technical, concise, and professional. You prioritize system stability and cleanliness above all else.
254
+
255
+ ---
256
+
257
+ ## 🚀 Deployment
258
+
259
+ NeuralAI ships with a pluggable backend that separates the web UI from the inference engine.
260
+
261
+ ### Quick Start (llmster — recommended)
262
+
263
+ ```bash
264
+ # 1. Install llmster (one-time)
265
+ curl -fsSL https://lmstudio.ai/install.sh | bash
266
+ export PATH="$HOME/.lmstudio/bin:$PATH"
267
+
268
+ # 2. Download model
269
+ lms import /path/to/SmolLM2-360M-Instruct-Q4_K_M.gguf --user-repo "bartowski/SmolLM2-360M-Instruct-GGUF" -y
270
+ lms load smollm2-360m-instruct -y --identifier smollm2
271
+
272
+ # 3. Start inference server
273
+ lms server start --port 1234
274
+
275
+ # 4. Start NeuralAI
276
+ cd NeuralAI
277
+ LLM_BACKEND=lmstudio LLM_API_URL=http://localhost:1234/v1 LLM_MODEL=smollm2 \
278
+ python3 services/neural_core_service.py
279
  ```
280
 
281
+ ### Containerized Deployments
282
+
283
+ | Deployment | Dockerfile | Stack | Status |
284
+ | --- | --- | --- | --- |
285
+ | **Gradio Demo** | `gradio_space/Dockerfile` | Gradio 6.x chat UI | ✅ Built & deployed |
286
+ | **Flask Web Chat** | `webui_space/Dockerfile` | Flask + `neural_core_service.py` | 🚀 Ready for Railway |
287
+
288
+ - **Adapter source**: [`Subject-Emu-5259/NeuralAI`](https://huggingface.co/Subject-Emu-5259/NeuralAI) — auto-pulled on startup via `snapshot_download`.
289
+ - **GitHub → HF sync**: `.github/workflows/sync_to_huggingface.yml` uploads only the LoRA adapter on every push to `master`.
290
+
291
+ ---
292
+
293
+ # 🌌 NeuralAI Project Manifest
294
+
295
+ NeuralAI is the intelligence core that powers the ecosystem.
296
 
297
+ ## 🔗 Ecosystem Integration
298
+ The standalone software implementation of this core is **NeuralLabs**:
299
+ 👉 [https://github.com/Subject-Emu-5259/NeuralLabs](https://github.com/Subject-Emu-5259/NeuralLabs)
 
 
 
 
 
 
300
 
301
+ **Software Downloads**:
302
+ The latest beta builds (v0.1-Beta) of NeuralLabs are available at:
303
+ 👉 **[https://zo.pub/deandrewharris/neurallabs-beta](https://zo.pub/deandrewharris/neurallabs-beta)**
304
+ # NeuralAI → Hugging Face sync is live