File size: 8,623 Bytes
63839ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# Singularity LLM

A fast, uncensored, 100% local LLM built from scratch with Singularity sub-byte token encoding, recursive link memory, built-in Jarvis voice assistant, multi-agent skill creation, conversation mesh, and zero-limitation tool calling.

## Quick Start

```bash
pip install -r requirements.txt

# First run β€” it asks you to name it
python -m singularity_llm chat

# Jarvis voice assistant
python -m singularity_llm jarvis

# Start web server
python -m singularity_llm serve

# Always-on daemon mode (24/7 autonomous operation)
python -m singularity_llm daemon

# Train on text data
python -m singularity_llm train --data corpus.txt

# Show stats
python -m singularity_llm stats

# Manage goals
python -m singularity_llm goals --create "Build a web app"

# Manage agents
python -m singularity_llm agents
```

## Features

### Core LLM
- **Pure NumPy** β€” no PyTorch, works on any machine with Python
- **Singularity tokens** β€” sub-byte token encoding, 4-20x memory compression
- **Uncensored** β€” no content filtering, zero limitations
- **100% local** β€” no API calls, no cloud required
- **Auto-sizing** β€” detects hardware, adjusts model size automatically
- **Recursive linking** β€” every conversation makes it smarter

### Voice & Jarvis
- **Built-in Jarvis** β€” voice assistant with wake word, STT, TTS
- **Streaming TTS** β€” sentence-level voice output for low latency
- **Self-improving** β€” learns from voice conversations, self-talks when idle

### Multi-Agent System (5 AI Agents)
- **Planner** β€” breaks goals into steps
- **Coder** β€” writes code and creates files
- **Researcher** β€” gathers information and generates insights
- **Reviewer** β€” reviews work and provides feedback
- **Executor** β€” executes commands and runs tools

### Skill Creation & Conversation Mesh
- **Auto skill creation** β€” abstracts patterns from conversations
- **Skill building pools** β€” collaborative skills built by multiple agents
- **Multi-LLM conversation mesh** β€” all 5 agents converse with each other
- **5 conversation modes** β€” round-robin, pairwise, brainstorm, debate, teaching
- **Skill cascade** β€” building a skill auto-generates related skills
- **Auto skill category adder** β€” dynamically discovers new categories

### Always-On Daemon (24/7)
- **Idle detection** β€” activates when user is inactive for 60s
- **Agent self-talk** β€” 5 agents talk to the LLM continuously
- **Jarvis skill creation** β€” extracts skills from agent conversations
- **Self-refinement** β€” optimizes inference speed, compresses weights, tunes hyperparams
- **100-project mode** β€” auto-generates and works on 100 projects 24/7
- **Never stops** β€” as projects complete, new ones are generated automatically

### Fast Reply Cache
- **Near-instant responses** β€” 3-layer cache (exact, skill-based, semantic)
- **Cache warms up** β€” gets faster over time as more conversations happen
- **Auto-activation** β€” activates when 50+ skills and 30%+ cache hit rate

### Zero-Limitation Tools (9 tools)
- `shell_exec` β€” full terminal control, no restrictions
- `write_file` β€” create or overwrite any file
- `code_edit` β€” find-and-replace in any file (including own framework β€” self-modifying)
- `read_file` β€” read any file
- `list_dir` β€” list directory contents
- `make_dir` β€” create directories
- `delete_file` β€” delete files or directories
- `calculate` β€” math expressions
- `search_web` β€” web search (needs API config)

### API Connectors
- **REST client** β€” auth, retries, rate limiting
- **Webhook manager** β€” incoming/outgoing webhooks with HMAC signing
- **Service connectors** β€” Discord, Slack, GitHub, HTTP fetcher
- **Custom APIs** β€” register and call any REST API

### Image Generation
- **100% local** β€” NumPy-based procedural image generation
- **6 patterns** β€” gradient, radial, noise, fractal, geometric, waves
- **25+ palettes** β€” sunset, ocean, fire, forest, space, neon, etc.
- **3 formats** β€” BMP (base64), SVG (vector), ASCII art

### Mass Storage Vault
- **Auto-resizing** β€” monitors disk space, cleans up when >80% full
- **Storage tiers** β€” hot, warm, cold (compressed), archive
- **Auto-compression** β€” gzips files older than 7 days
- **SQLite vacuuming** β€” reclaims space from all databases
- **Artifact storage** β€” store/load project artifacts

### First-Run Naming
- **Incentives Inc. LLM** β€” greets you on first run
- "Hi, I am an Incentives Inc. LLM. What would you like to name me?"
- Name persists across restarts

### Persistent Memory & Goals
- **Episodic memory** β€” SQLite-backed conversation history
- **Semantic memory** β€” auto-extracted facts
- **Goal memory** β€” long-term goals with planning, steps, dependencies
- **Agent assignment** β€” goals assigned to agents automatically

## Architecture

```
singularity_llm/
β”œβ”€β”€ model/              # Tokenizer, layers, transformer, quantization
β”œβ”€β”€ train/              # Data pipeline, training loop, auto-sizing
β”œβ”€β”€ Singularity/           # Singularity tokens, recursive links, universal sync
β”œβ”€β”€ skills/             # Skill creation, tiered mass storage
β”œβ”€β”€ memory/             # Persistent memory, goal memory, fast reply cache
β”œβ”€β”€ agents/             # 5 AI agents, agent manager, always-on daemon
β”‚   β”œβ”€β”€ agent_base.py   # Base agent class
β”‚   β”œβ”€β”€ planner_agent.py
β”‚   β”œβ”€β”€ coder_agent.py
β”‚   β”œβ”€β”€ researcher_agent.py
β”‚   β”œβ”€β”€ reviewer_agent.py
β”‚   β”œβ”€β”€ executor_agent.py
β”‚   β”œβ”€β”€ agent_manager.py
β”‚   β”œβ”€β”€ always_on.py     # 24/7 daemon with 100-project mode
β”‚   β”œβ”€β”€ self_refine.py   # Self-refinement engine
β”‚   └── conversation_mesh.py  # Multi-LLM conversation mesh + skill cascade
β”œβ”€β”€ connectors/         # API client, webhooks, service connectors
β”œβ”€β”€ vision/             # Image generation (NumPy-based)
β”œβ”€β”€ storage/            # Mass storage vault (auto-resizing)
β”œβ”€β”€ voice/              # Jarvis, wake word, STT, TTS, self-improvement
β”œβ”€β”€ harness/            # Main orchestrator, tool calling (9 tools)
β”œβ”€β”€ server/             # FastAPI server, web UI, REST API
β”œβ”€β”€ identity.py         # First-run naming (Incentives Inc. LLM)
└── cli.py              # CLI interface
```

## API Endpoints

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/v1/chat` | POST | Chat completion |
| `/v1/chat/stream` | POST | Streaming chat |
| `/v1/image/generate` | POST/GET | Generate image |
| `/v1/connectors/register` | POST | Register API connector |
| `/v1/connectors/call` | POST | Call a connector |
| `/v1/webhook/{path}` | POST | Webhook receiver |
| `/v1/daemon/start` | POST | Start always-on daemon |
| `/v1/daemon/stop` | POST | Stop daemon |
| `/v1/daemon/status` | GET | Daemon status |
| `/v1/goals` | GET/POST | Manage goals |
| `/v1/agents` | GET | Agent status |
| `/v1/identity` | GET | LLM identity |
| `/v1/identity/name` | POST | Set LLM name |
| `/v1/fast-cache` | GET | Fast reply cache stats |
| `/v1/vault` | GET | Storage vault stats |
| `/v1/mesh/converse` | POST | Run mesh conversation |
| `/v1/mesh/pools` | GET | List skill pools |
| `/v1/mesh/categories` | GET | List skill categories |
| `/v1/stats` | GET | Full system stats |
| `/v1/health` | GET | Health check |

## Voice Setup

For zero-dependency voice: use the web UI at `http://localhost:8548/jarvis` (uses browser Web Speech API).

For 100% offline voice:
```bash
pip install pyaudio pyttsx3          # basic voice
pip install openai-whisper            # better STT
pip install piper-tts                 # neural TTS
```

## Hardware Tiers

| Tier | RAM | Model | Quantization | Voice Tokens |
|------|-----|-------|-------------|--------------|
| Mobile | <2GB | 2L/4H/d128 | Ternary (1.6bpw) | 16 |
| Minimal | <4GB | 3L/4H/d256 | Q2_K (2bpw) | 32 |
| Light | <8GB | 4L/8H/d384 | Q3_K (3bpw) | 48 |
| Standard | <16GB | 6L/8H/d512 | Q4_K (4bpw) | 64 |
| Full | <32GB | 8L/16H/d768 | Q5_K (5bpw) | 96 |
| Maximum | <64GB | 12L/16H/d1024 | Q8_0 (8bpw) | 128 |

## Tests

```bash
# Run all 65 tests across 11 suites
python tests/test_tokenizer.py
python tests/test_model.py
python tests/test_quantization.py
python tests/test_Singularity.py
python tests/test_harness.py
python tests/test_voice.py
python tests/test_memory_agents.py
python tests/test_connectors_vision.py
python tests/test_fast_reply_identity.py
python tests/test_tools_vault.py
python tests/test_conversation_mesh.py
```

## License

MIT License β€” Copyright (c) 2026 Incentives Inc.

## Author

Built by Incentives Inc.