Subject-Emu-5259 commited on
Commit
653f331
·
verified ·
1 Parent(s): e0cd1d7

Sync model card to match GitHub README

Browse files
Files changed (1) hide show
  1. README.md +248 -79
README.md CHANGED
@@ -1,96 +1,265 @@
1
  ---
2
- base_model: HuggingFaceTB/SmolLM2-360M-Instruct
 
3
  library_name: peft
4
- model_name: NeuralAI
5
- model_type: adapter
6
  license: apache-2.0
7
- language:
8
- - en
9
  tags:
10
- - text-generation
11
- - dpo
12
- - lora
13
- - peft
14
- - smollm2
15
- - reasoning
16
- - code-generation
17
- - debugging
18
- - multi-step-reasoning
19
- - edge-ai
20
- pipeline_tag: text-generation
21
- inference:
22
- parameters:
23
- max_new_tokens: 512
24
- temperature: 0.7
25
- top_p: 0.95
26
- repetition_penalty: 1.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  ---
28
 
29
- # NeuralAI v15.0 DPO-Aligned LoRA Adapter
30
 
31
- NeuralAI is a DPO-aligned LoRA adapter for [SmolLM2-360M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-360M-Instruct), fine-tuned for expert-level reasoning, code generation, debugging, and multi-step logic tasks.
32
 
33
- ## Highlights
34
 
35
- - **597 DPO preference pairs** covering code correctness, logic, reasoning, debugging, and multi-step tasks
36
- - **Reward margin**: improved from ~0.5 to ~3.5 (model strongly prefers chosen responses)
37
- - **Final training loss**: 0.305
38
- - **Edge-optimized**: Runs on CPU with 4GB RAM no GPU required
39
- - **Gemini-style alignment**: Helpful, structured, conversational tone with step-by-step explanations
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
- ## Quick start
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  ```python
44
- from transformers import AutoModelForCausalLM, AutoTokenizer
45
- from peft import PeftModel
 
 
 
 
 
 
 
 
46
 
47
- base_model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct")
48
- tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct")
49
- model = PeftModel.from_pretrained(base_model, "Subject-Emu-5259/NeuralAI")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
- messages = [{"role": "user", "content": "Write a Python function to check API health."}]
52
- inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
53
- output = model.generate(inputs, max_new_tokens=256, temperature=0.7, top_p=0.95)
54
- print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=True))
 
 
 
 
 
 
 
55
  ```
56
 
57
- ## Training details
58
-
59
- | Parameter | Value |
60
- |---|---|
61
- | Base model | HuggingFaceTB/SmolLM2-360M-Instruct |
62
- | Method | DPO (Direct Preference Optimization) |
63
- | Dataset | 597 preference pairs (v15 expanded) |
64
- | Epochs | 3 |
65
- | Steps | 450 |
66
- | Final loss | 0.305 |
67
- | Reward margin | ~3.5 |
68
- | LoRA rank | 16 |
69
- | Hardware | Apple Silicon MPS (MacBook Air M4) |
70
- | Duration | ~12 minutes |
71
- | Completed | 2026-07-11 |
72
-
73
- ## Framework versions
74
-
75
- - PEFT: 0.17.1
76
- - TRL: 0.24.0
77
- - Transformers: 4.57.6
78
- - PyTorch: 2.8.0
79
-
80
- ## Use cases
81
-
82
- - **Code generation and debugging**: Multi-step reasoning for code correctness
83
- - **Logic and math**: Complex problem decomposition
84
- - **Edge deployment**: CPU-optimized for local/private AI
85
- - **Agentic workflows**: Tool-use and multi-step task execution
86
-
87
- ## Citation
88
-
89
- ```bibtex
90
- @inproceedings{rafailov2023direct,
91
- title = {{Direct Preference Optimization: Your Language Model is Secretly a Reward Model}},
92
- author = {Rafael Rafailov and Archit Sharma and Eric Mitchell and Christopher D. Manning and Stefano Ermon and Chelsea Finn},
93
- year = 2023,
94
- booktitle = {NeurIPS 2023},
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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` (DPO v15.0 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 | Legacy/development mode |
72
+
73
+ ```bash
74
+ # Example: start NeuralAI with llmster backend
75
+ LLM_BACKEND=lmstudio LLM_API_URL=http://localhost:1234/v1 LLM_MODEL=smollm2 \
76
+ python3 services/neural_core_service.py
77
+ ```
78
 
79
+ ### Core Architectural Pillars
80
+
81
+ 1. **NeuralAI Core**: Handles chat state, direct model inference, terminal session proxying, and tool orchestration.
82
+ 2. **NeuralDrive (Cloud Storage)**: The intelligent data layer for all projects, featuring isolated user storage, automatic versioning, and semantic mapping.
83
+ 3. **Diffusion Engine**: An integrated generative diffusion layer for producing visual branding assets, UI mockups, and visual logic maps.
84
+ 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.
85
+
86
+ ---
87
+
88
+ ## ✨ Key Features & Capabilities
89
+
90
+ ### 💬 Multimodal Chat & Agentic Intelligence
91
+
92
+ - **High-Velocity Text Inference**: Fast, local inference with deep context awareness.
93
+ - **Deep Reasoning Mode**: Integration of test-time compute and chain-of-thought reasoning for complex problem decomposition and error-free logic.
94
+ - **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.
95
+ - **Live S2S (Speech-to-Speech)**: Real-time voice interaction with an integrated microphone interface and fluid vocal responses.
96
+ - **Identity Vault & Memory**: Persistent user memory and rule constraints, ensuring NeuralAI remembers preferences, behavioral rules, and historical context.
97
+
98
+ ### 💻 Developer & Engineering Tools
99
+
100
+ - **Integrated Web Terminal**: A fully functional, WebSocket-driven terminal embedded directly in the web UI for immediate environment control.
101
+ - **File Workspace**: An in-browser IDE experience allowing users to browse directories, read, and write code seamlessly.
102
+ - **Code Execution & Sandbox**: Secure environment for the model to execute and test code on the fly.
103
+
104
+ ### 🔐 Authentication & Access Tiers
105
+
106
+ - **Founder Mode**: Ultimate root-level access and system control.
107
+ - **Maestro Student Portal**: Tiered access for educational and collaborative development.
108
+ - **Guest Preview**: Frictionless instant access for testing the system without an account.
109
+
110
+ ---
111
+
112
+ ## 🏋️ Model Training & Fine-Tuning (DPO)
113
+
114
+ NeuralAI is continuously learning and improving through rigorous **Direct Preference Optimization (DPO)**.
115
+
116
+ ### Training Pipeline
117
 
118
  ```python
119
+ # Example of the DPO alignment configuration used in NeuralAI
120
+ dpo_config = DPOConfig(
121
+ beta=0.1,
122
+ learning_rate=5e-5,
123
+ per_device_train_batch_size=4,
124
+ gradient_accumulation_steps=4,
125
+ max_length=1024,
126
+ max_prompt_length=512,
127
+ )
128
+ ```
129
 
130
+ - **Dataset Expansions**: The dataset is aggressively expanded to include advanced reasoning, complex mathematics, logical deduction, creative writing, and system debugging.
131
+ - **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.
132
+ - **Model Drift Monitoring**: Continuous evaluation against previous checkpoints to ensure response quality and consistency never regress.
133
+
134
+ ### Latest Alignment Run: v15.0
135
+
136
+ - **Training samples**: 597 (expanded DPO preference pairs)
137
+ - **Epochs**: 3
138
+ - **Steps**: 450
139
+ - **Final training loss**: `0.305`
140
+ - **Reward margin**: improved from `~0.5` → `~3.5` (model strongly prefers chosen responses)
141
+ - **Hardware**: Apple Silicon MPS (MacBook Air M4)
142
+ - **Run duration**: `730.5s` (~12m 11s)
143
+ - **Completed**: `2026-07-11 20:00 UTC`
144
+ - **Adapter**: live on Hugging Face at [`Subject-Emu-5259/NeuralAI`](https://huggingface.co/Subject-Emu-5259/NeuralAI)
145
+
146
+ > 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.
147
+
148
+ ---
149
 
150
+ ## 📸 Brand & UI Gallery
151
+
152
+ *(UI screenshots showcase the beautiful dark mode interface, the terminal integration, and the NeuralDrive file explorer.)*
153
+
154
+ ```html
155
+ <!-- Example Frontend UI Component Structure -->
156
+ <div class="neural-chat-container">
157
+ <div class="message-bubble ai-response">
158
+ NeuralAI: System optimal. Ready for execution.
159
+ </div>
160
+ </div>
161
  ```
162
 
163
+ ---
164
+
165
+ ## 🗺️ Implementation Roadmap
166
+
167
+ - **Phase 1: Alignment** - DPO training for Founder context and optimal engineering tone.
168
+ - **Phase 2: NeuralDrive** - Deployment of the Cloud Storage File Server.
169
+ - **Phase 3: Terminal UI** - Integrated command-line access within the browser.
170
+ - **Phase 4: Live S2S** - High-velocity Live Speech-to-Speech conversations.
171
+ - **Phase 5: "Founder Mode"** - Enhancements to vocal profile and streamlined UI.
172
+ - **Phase 6: Frontend Polish** - Dark themes, real-time code execution display, UI stability.
173
+ - **Phase 7: Diffusion Integration** - Implementation of Text2Img & Img2Img capabilities.
174
+ - 🚀 **Phase 8: Knowledge Graph & Agentic Autonomy** - Advanced long-term memory for cross-project context, "Supermemory" features, and fully autonomous task execution.
175
+
176
+ ---
177
+
178
+ ## 🎯 Future Vision: The Software Transition
179
+
180
+ NeuralAI is evolving from a workspace-bound assistant into a standalone, downloadable intelligence environment.
181
+
182
+ **Project Code Name**: `NeuralLabs` (Working Title)
183
+ **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.
184
+
185
+ ### 🚀 Roadmap Addition: The NeuralLabs Shift
186
+
187
+ - **NeuralLabs v1 (Client)**: Development of a cross-platform wrapper (Electron/Tauri) for the NeuralAI interface.
188
+ - **NeuralLabs v2 (Edge)**: Local model execution (Llama/Mistral) as a fallback for the cloud-based NeuralAI core.
189
+ - **NeuralLabs v3 (Eco)**: Plugin architecture allowing third-party "Neural-Skills" to be installed as standalone apps.
190
+
191
+ ---
192
+
193
+ ## 👨‍💻 The Developer & Architect
194
+
195
+ **De'Andrew Preston Harris** (D. Harris / Dre)
196
+ *Founder & Architect of NeuralAI*
197
+
198
+ 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\[...\]
199
+
200
+ - **Location:** Memphis, TN / West Memphis, AR
201
+ - **Vision:** Building the future of private, high-performance generative AI.
202
+ - [LinkedIn](https://www.linkedin.com/in/deandrewharris94/) | [GitHub](https://github.com/Subject-Emu-5259)
203
+
204
+ ---
205
+
206
+ *Built with precision and discipline by De'Andrew Preston Harris.*
207
+
208
+ ### CURRENT VERSION: v7.2 (The Pluggable Engine)
209
+
210
+ - **Model Alignment**: DPO v15.0 Aligned (597 pairs, Logic, Debugging, Reasoning)
211
+ - **Inference**: llmster (LM Studio headless) — 258MB RAM vs 5GB PyTorch
212
+ - **Last Maintenance**: July 12, 2026
213
+
214
+ Your tone is technical, concise, and professional. You prioritize system stability and cleanliness above all else.
215
+
216
+ ---
217
+
218
+ ## 🚀 Deployment
219
+
220
+ NeuralAI ships with a pluggable backend that separates the web UI from the inference engine.
221
+
222
+ ### Quick Start (llmster — recommended)
223
+
224
+ ```bash
225
+ # 1. Install llmster (one-time)
226
+ curl -fsSL https://lmstudio.ai/install.sh | bash
227
+ export PATH="$HOME/.lmstudio/bin:$PATH"
228
+
229
+ # 2. Download model
230
+ lms import /path/to/SmolLM2-360M-Instruct-Q4_K_M.gguf --user-repo "bartowski/SmolLM2-360M-Instruct-GGUF" -y
231
+ lms load smollm2-360m-instruct -y --identifier smollm2
232
+
233
+ # 3. Start inference server
234
+ lms server start --port 1234
235
+
236
+ # 4. Start NeuralAI
237
+ cd NeuralAI
238
+ LLM_BACKEND=lmstudio LLM_API_URL=http://localhost:1234/v1 LLM_MODEL=smollm2 \
239
+ python3 services/neural_core_service.py
240
  ```
241
+
242
+ ### Containerized Deployments
243
+
244
+ | Deployment | Dockerfile | Stack | Status |
245
+ | --- | --- | --- | --- |
246
+ | **Gradio Demo** | `gradio_space/Dockerfile` | Gradio 6.x chat UI | ✅ Built & deployed |
247
+ | **Flask Web Chat** | `webui_space/Dockerfile` | Flask + `neural_core_service.py` | 🚀 Ready for Railway |
248
+
249
+ - **Adapter source**: [`Subject-Emu-5259/NeuralAI`](https://huggingface.co/Subject-Emu-5259/NeuralAI) — auto-pulled on startup via `snapshot_download`.
250
+ - **GitHub → HF sync**: `.github/workflows/sync_to_huggingface.yml` uploads only the LoRA adapter on every push to `master`.
251
+
252
+ ---
253
+
254
+ # 🌌 NeuralAI Project Manifest
255
+
256
+ NeuralAI is the intelligence core that powers the ecosystem.
257
+
258
+ ## 🔗 Ecosystem Integration
259
+ The standalone software implementation of this core is **NeuralLabs**:
260
+ 👉 [https://github.com/Subject-Emu-5259/NeuralLabs](https://github.com/Subject-Emu-5259/NeuralLabs)
261
+
262
+ **Software Downloads**:
263
+ The latest beta builds (v0.1-Beta) of NeuralLabs are available at:
264
+ 👉 **[https://zo.pub/deandrewharris/neurallabs-beta](https://zo.pub/deandrewharris/neurallabs-beta)**
265
+ # NeuralAI → Hugging Face sync is live