ltcai 0.1.20 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +210 -260
- package/bin/ltcai.js +27 -0
- package/docs/CHANGELOG.md +133 -0
- package/docs/images/logo.svg +33 -0
- package/docs/images/screenshot-admin.png +0 -0
- package/docs/images/screenshot-chat.png +0 -0
- package/docs/images/screenshot-graph.png +0 -0
- package/ltcai_cli.py +30 -1
- package/package.json +1 -1
- package/server.py +360 -33
- package/static/account.html +0 -4
- package/static/admin.html +1 -7
- package/static/chat.html +59 -58
- package/static/graph.html +1 -6
- package/tests/unit/test_security.py +68 -0
- package/tests/unit/test_setup_wizard.py +35 -0
- package/tests/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tests/integration/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tests/integration/__pycache__/test_api.cpython-314-pytest-9.0.3.pyc +0 -0
- package/tests/unit/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tests/unit/__pycache__/test_security.cpython-314-pytest-9.0.3.pyc +0 -0
- package/tests/unit/__pycache__/test_tools.cpython-314-pytest-9.0.3.pyc +0 -0
package/README.md
CHANGED
|
@@ -1,338 +1,243 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[](https://pypi.org/project/ltcai/)
|
|
8
|
+
[](https://pypi.org/project/ltcai/)
|
|
8
9
|
[](https://www.npmjs.com/package/ltcai)
|
|
9
|
-
[](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai)
|
|
10
11
|
[](https://open-vsx.org/extension/parktaesoo/ltcai)
|
|
11
|
-
[](./LICENSE)
|
|
13
|
+
[](https://www.python.org/)
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
</div>
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## What is Lattice AI?
|
|
16
20
|
|
|
17
|
-
- `
|
|
18
|
-
- `npm`: `ltcai@0.1.18`
|
|
19
|
-
- `VS Code Marketplace`: `parktaesoo.ltcai@0.1.18`
|
|
20
|
-
- `Open VSX`: `parktaesoo.ltcai@0.1.18`
|
|
21
|
+
**Lattice AI** is a self-hosted AI server that unifies local and cloud LLMs into one workspace — web chat, VS Code extension, Telegram bot, and MCP tools, all from a single `pip install`.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
- 🖥️ **Web UI** — chat, file upload, admin dashboard, data graph
|
|
24
|
+
- 🧩 **VS Code / Cursor extension** — edit, explain, generate commands inline
|
|
25
|
+
- 📱 **Telegram bot** — access your AI from anywhere
|
|
26
|
+
- 🔌 **MCP server** — use Lattice tools inside Claude Desktop / Cursor
|
|
27
|
+
- 🔒 **Zero telemetry** — all data stays in `~/.ltcai/` on your machine
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
- **로컬 우선 + 클라우드 선택**: Apple Silicon MLX 로컬 모델과 OpenAI 호환 클라우드 모델을 같은 UX로 다룹니다.
|
|
26
|
-
- **실전형 에이전트 워크플로**: 파일 편집, grep, todo, 터미널 도구를 묶어 멀티스텝 작업을 수행합니다.
|
|
29
|
+
---
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
## 📸 Screenshots
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
<table>
|
|
34
|
+
<tr>
|
|
35
|
+
<td width="33%"><b>Chat UI</b><br/><img src="docs/images/screenshot-chat.png" alt="Lattice AI Chat" width="100%"/></td>
|
|
36
|
+
<td width="33%"><b>Admin Dashboard</b><br/><img src="docs/images/screenshot-admin.png" alt="Admin Dashboard" width="100%"/></td>
|
|
37
|
+
<td width="33%"><b>Data Graph (Graph RAG)</b><br/><img src="docs/images/screenshot-graph.png" alt="Knowledge Graph" width="100%"/></td>
|
|
38
|
+
</tr>
|
|
39
|
+
</table>
|
|
35
40
|
|
|
36
41
|
---
|
|
37
42
|
|
|
38
|
-
##
|
|
43
|
+
## ⚡ Quick Start (30 seconds)
|
|
39
44
|
|
|
40
45
|
```bash
|
|
41
|
-
#
|
|
46
|
+
# Install (cloud models)
|
|
42
47
|
pip install ltcai
|
|
43
48
|
|
|
44
|
-
#
|
|
49
|
+
# Install (+ Apple Silicon local models)
|
|
45
50
|
pip install "ltcai[local]"
|
|
46
51
|
|
|
47
|
-
#
|
|
48
|
-
npm install -g ltcai
|
|
49
|
-
|
|
50
|
-
# 서버 실행 (로컬)
|
|
52
|
+
# Start server
|
|
51
53
|
LTCAI
|
|
52
54
|
# → http://localhost:4825
|
|
53
55
|
|
|
54
|
-
#
|
|
56
|
+
# Start with public HTTPS tunnel (Cloudflare, no account needed)
|
|
55
57
|
LTCAI --tunnel
|
|
56
|
-
# →
|
|
57
|
-
# → https://xxxx.trycloudflare.com ← 어디서든 접속 가능한 공개 URL
|
|
58
|
+
# → https://xxxx.trycloudflare.com
|
|
58
59
|
```
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
- cloudflared가 없으면 자동 다운로드 (계정 불필요)
|
|
62
|
-
- 서버를 `0.0.0.0`에 바인딩하고 Cloudflare 무료 터널로 HTTPS 공개 URL 발급
|
|
63
|
-
- `LATTICEAI_TELEGRAM_BOT_TOKEN` + `LATTICEAI_TELEGRAM_CHAT_ID` 환경변수가 있으면 시작 시 Telegram으로 URL 자동 전송
|
|
64
|
-
- 서버 종료 시 터널도 함께 종료
|
|
65
|
-
|
|
66
|
-
**설치 확인:**
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
$ LTCAI doctor
|
|
70
|
-
[OK] Python 3.11+: 3.11.9
|
|
71
|
-
[OK] FastAPI: required server dependency
|
|
72
|
-
[OK] Uvicorn: required server dependency
|
|
73
|
-
[OK] OpenAI SDK: required for cloud providers
|
|
74
|
-
[OK] MLX: required for Apple Silicon local models
|
|
75
|
-
[OK] MLX-LM: required for local text models
|
|
76
|
-
[OK] MLX-VLM: required for Gemma/VLM models
|
|
77
|
-
[OPTIONAL] Ollama binary: optional local-server engine
|
|
78
|
-
[OK] Data dir: /Users/you/.ltcai
|
|
79
|
-
[OK] Static UI: /path/to/static
|
|
80
|
-
[INFO] Cloud keys configured: OPENAI_API_KEY
|
|
81
|
-
```
|
|
61
|
+
**First run:** open `http://localhost:4825` → sign up → first account auto-becomes admin → pick a model → start chatting.
|
|
82
62
|
|
|
83
63
|
---
|
|
84
64
|
|
|
85
|
-
##
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
### 2단계: VS Code 연결
|
|
100
|
-
|
|
101
|
-
1. VS Code → Extensions → `ltcai` 검색 → Install
|
|
102
|
-
2. `Cmd+Shift+A` → Lattice AI 채팅 패널 열기
|
|
103
|
-
3. 기본적으로 `http://localhost:4825` 에 자동 연결됩니다
|
|
65
|
+
## 🆚 Why Lattice AI?
|
|
66
|
+
|
|
67
|
+
| | Lattice AI | Open WebUI | Continue.dev | GitHub Copilot |
|
|
68
|
+
|---|:---:|:---:|:---:|:---:|
|
|
69
|
+
| Local model (offline, Apple Silicon) | ✅ | ✅ | ✅ | ❌ |
|
|
70
|
+
| Cloud models (OpenAI, Groq…) | ✅ | ✅ | ✅ | ✅ |
|
|
71
|
+
| VS Code extension | ✅ | ❌ | ✅ | ✅ |
|
|
72
|
+
| Telegram bot | ✅ | ❌ | ❌ | ❌ |
|
|
73
|
+
| Graph RAG (auto knowledge graph) | ✅ | ❌ | ❌ | ❌ |
|
|
74
|
+
| MCP registry & install | ✅ | ❌ | ✅ | ❌ |
|
|
75
|
+
| Admin dashboard + audit log | ✅ | ✅ | ❌ | ❌ |
|
|
76
|
+
| Self-hosted, zero telemetry | ✅ | ✅ | ✅ | ❌ |
|
|
77
|
+
| One-command public tunnel | ✅ | ❌ | ❌ | ❌ |
|
|
78
|
+
| Free | ✅ | ✅ | ✅ | ❌ |
|
|
104
79
|
|
|
105
|
-
|
|
106
|
-
|--------|------|
|
|
107
|
-
| `Cmd+Shift+A` | 채팅 패널 열기 |
|
|
108
|
-
| `Cmd+Shift+E` | 선택 코드 편집 |
|
|
109
|
-
| `Cmd+Shift+M` | 모델 로드 / 전환 |
|
|
110
|
-
| 우클릭 메뉴 | Explain / Edit / Knowledge Garden 저장 |
|
|
80
|
+
---
|
|
111
81
|
|
|
112
|
-
|
|
82
|
+
## 🧠 Supported Models
|
|
113
83
|
|
|
114
|
-
|
|
84
|
+
**Local — Apple Silicon only (MLX):**
|
|
115
85
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
86
|
+
| Model | Best for | Size |
|
|
87
|
+
|-------|----------|------|
|
|
88
|
+
| `mlx-community/gemma-4-26b-a4b-it-4bit` | General / coding | ~14 GB |
|
|
89
|
+
| `mlx-community/Qwen2.5-Coder-32B-Instruct-4bit` | Coding | ~18 GB |
|
|
90
|
+
| `mlx-community/DeepSeek-R1-0528-4bit` | Reasoning | ~38 GB |
|
|
91
|
+
| `mlx-community/Phi-4-4bit` | Coding (fast) | ~8 GB |
|
|
119
92
|
|
|
120
|
-
|
|
93
|
+
**Cloud (any platform):**
|
|
94
|
+
OpenAI · Groq · Together · OpenRouter · any OpenAI-compatible endpoint
|
|
121
95
|
|
|
122
96
|
---
|
|
123
97
|
|
|
124
|
-
##
|
|
125
|
-
|
|
126
|
-
|
|
|
127
|
-
|
|
128
|
-
|
|
|
129
|
-
| **
|
|
130
|
-
| **
|
|
131
|
-
| **
|
|
132
|
-
| **MCP
|
|
133
|
-
| **
|
|
134
|
-
|
|
|
135
|
-
| **
|
|
136
|
-
|
|
|
137
|
-
| **
|
|
138
|
-
|
|
|
139
|
-
| **
|
|
98
|
+
## ✨ Features
|
|
99
|
+
|
|
100
|
+
| Feature | Description |
|
|
101
|
+
|---------|-------------|
|
|
102
|
+
| **Web UI** | Responsive chat + admin panel + graph visualisation |
|
|
103
|
+
| **Auto Setup Wizard** | Detects → downloads → installs → verifies → repairs dependencies |
|
|
104
|
+
| **VS Code / Cursor** | Chat panel, Edit Selection, Explain, Generate command |
|
|
105
|
+
| **Telegram bot** | Local AI mirror + cloud Codex bot |
|
|
106
|
+
| **MCP server** | Use Lattice tools in Claude Desktop / Cursor |
|
|
107
|
+
| **MCP registry** | One-click install from registry.modelcontextprotocol.io |
|
|
108
|
+
| **Skills marketplace** | 77 official skills (Anthropic + Adobe · Airtable · Auth0 · Pydantic) |
|
|
109
|
+
| **Plugin directory** | Browse 149 open-source plugins |
|
|
110
|
+
| **Graph RAG** | Chat & docs auto-indexed as SQLite knowledge graph |
|
|
111
|
+
| **Multi-step agent** | File edit/create, grep, todo, terminal (25 steps) |
|
|
112
|
+
| **Multi-LLM pipeline** | Plan → Execute → Review with different models |
|
|
113
|
+
| **Human-in-the-loop** | Approve agent plan before execution |
|
|
114
|
+
| **Audit dashboard** | Per-user AI usage, sensitive data detection, event log |
|
|
115
|
+
| **PWA** | Install on iPad / Android home screen |
|
|
140
116
|
| **SSO** | Entra ID / Okta OIDC |
|
|
141
117
|
|
|
142
118
|
---
|
|
143
119
|
|
|
144
|
-
##
|
|
120
|
+
## 🖥️ Platform Support
|
|
145
121
|
|
|
146
|
-
|
|
|
147
|
-
|
|
148
|
-
|
|
|
149
|
-
| VS Code / Cursor
|
|
150
|
-
| Telegram
|
|
151
|
-
| MLX
|
|
152
|
-
| Ollama /
|
|
122
|
+
| Feature | macOS Apple Silicon | macOS Intel / Windows / Linux |
|
|
123
|
+
|---------|:---:|:---:|
|
|
124
|
+
| Web UI + cloud models | ✅ | ✅ |
|
|
125
|
+
| VS Code / Cursor extension | ✅ | ✅ |
|
|
126
|
+
| Telegram bot | ✅ | ✅ |
|
|
127
|
+
| MLX local models | ✅ | ❌ |
|
|
128
|
+
| Ollama / LM Studio / vLLM | ✅ | ✅ |
|
|
153
129
|
|
|
154
130
|
---
|
|
155
131
|
|
|
156
|
-
##
|
|
132
|
+
## 🛠️ Setup & Usage
|
|
133
|
+
|
|
134
|
+
### Install & run
|
|
157
135
|
|
|
158
136
|
```bash
|
|
137
|
+
# Verify everything is ready
|
|
138
|
+
LTCAI doctor
|
|
139
|
+
|
|
140
|
+
# Run with cloud API key
|
|
141
|
+
OPENAI_API_KEY=sk-... LTCAI
|
|
142
|
+
|
|
143
|
+
# Run with local MLX model (Apple Silicon)
|
|
159
144
|
LATTICEAI_MODE=local \
|
|
160
145
|
LATTICEAI_LOCAL_MODEL=mlx-community/gemma-4-26b-a4b-it-4bit \
|
|
161
146
|
LTCAI
|
|
162
147
|
```
|
|
163
148
|
|
|
164
|
-
###
|
|
149
|
+
### VS Code extension
|
|
165
150
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
| `mlx-community/gemma-4-26b-a4b-it-4bit` | 범용/코딩 | ~14GB | ⭐⭐⭐⭐⭐ |
|
|
169
|
-
| `mlx-community/Qwen2.5-Coder-32B-Instruct-4bit` | 코딩 | ~18GB | ⭐⭐⭐⭐⭐ |
|
|
170
|
-
| `mlx-community/Qwen2.5-Coder-14B-Instruct-4bit` | 코딩 | ~8GB | ⭐⭐⭐⭐ |
|
|
171
|
-
| `mlx-community/DeepSeek-R1-0528-4bit` | 추론 | ~38GB | ⭐⭐⭐⭐ |
|
|
172
|
-
| `mlx-community/Phi-4-4bit` | 코딩 | ~8GB | ⭐⭐⭐⭐ |
|
|
151
|
+
1. VS Code → Extensions → search `ltcai` → Install
|
|
152
|
+
2. `Cmd+Shift+A` — open chat panel (auto-connects to `localhost:4825`)
|
|
173
153
|
|
|
174
|
-
|
|
154
|
+
| Shortcut | Action |
|
|
155
|
+
|----------|--------|
|
|
156
|
+
| `Cmd+Shift+A` | Open chat |
|
|
157
|
+
| `Cmd+Shift+E` | Edit selected code |
|
|
158
|
+
| `Cmd+Shift+M` | Load / switch model |
|
|
159
|
+
| Right-click | Explain / Save to Knowledge Garden |
|
|
175
160
|
|
|
176
|
-
###
|
|
161
|
+
### Telegram bot
|
|
177
162
|
|
|
178
163
|
```bash
|
|
179
|
-
|
|
180
|
-
-H "Content-Type: application/json" \
|
|
181
|
-
-d '{"model_id": "mlx-community/Qwen2.5-Coder-14B-Instruct-4bit"}'
|
|
164
|
+
LATTICEAI_TELEGRAM_BOT_TOKEN=your-token LTCAI
|
|
182
165
|
```
|
|
183
166
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
## 퍼블릭 모드 (클라우드 서버)
|
|
187
|
-
|
|
188
|
-
Render, Fly.io, Railway, VPS 등에서 운영할 때:
|
|
167
|
+
### Public server (Render / Fly.io / Docker)
|
|
189
168
|
|
|
190
169
|
```bash
|
|
191
170
|
LATTICEAI_MODE=public \
|
|
192
|
-
LATTICEAI_ALLOW_LOCAL_MODELS=false \
|
|
193
171
|
LATTICEAI_PUBLIC_MODEL=openai:gpt-4o-mini \
|
|
194
172
|
OPENAI_API_KEY=sk-... \
|
|
195
|
-
LATTICEAI_INVITE_CODE=my-secret
|
|
173
|
+
LATTICEAI_INVITE_CODE=my-secret \
|
|
196
174
|
LTCAI
|
|
197
175
|
```
|
|
198
176
|
|
|
199
|
-
자세한 내용은 [docs/public-deploy.md](docs/public-deploy.md)를 참고하세요.
|
|
200
|
-
|
|
201
|
-
### Docker
|
|
202
|
-
|
|
203
177
|
```bash
|
|
178
|
+
# Docker
|
|
204
179
|
docker build -t lattice-ai .
|
|
205
180
|
docker run --rm -p 4825:4825 \
|
|
206
181
|
-e OPENAI_API_KEY="$OPENAI_API_KEY" \
|
|
207
|
-
-e LATTICEAI_INVITE_CODE="my-secret
|
|
182
|
+
-e LATTICEAI_INVITE_CODE="my-secret" \
|
|
208
183
|
-v "$PWD/.data:/data" \
|
|
209
184
|
lattice-ai
|
|
210
185
|
```
|
|
211
186
|
|
|
212
187
|
---
|
|
213
188
|
|
|
214
|
-
##
|
|
189
|
+
## 🔒 Security
|
|
215
190
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
191
|
+
| Property | Detail |
|
|
192
|
+
|----------|--------|
|
|
193
|
+
| Binding | Default `127.0.0.1:4825` — local only |
|
|
194
|
+
| Auth | Session required when network-exposed or public mode |
|
|
195
|
+
| Cookies | `HttpOnly + SameSite=Lax` — no localStorage token |
|
|
196
|
+
| Local file access | Approval-token gated (path + user + action scope) |
|
|
197
|
+
| CORS | Localhost only by default; add origins via `LATTICEAI_CORS_ALLOWED_ORIGINS` |
|
|
198
|
+
| File upload | Magic-number signature check (blocks extension spoofing) |
|
|
199
|
+
| Rate limits | `/chat` 30/min · `/agent` 6/min · `/upload` 12/min per user |
|
|
200
|
+
| Telemetry | None — all data in `~/.ltcai/` |
|
|
225
201
|
|
|
226
|
-
|
|
202
|
+
Report vulnerabilities: [SECURITY.md](SECURITY.md)
|
|
227
203
|
|
|
228
204
|
---
|
|
229
205
|
|
|
230
|
-
##
|
|
231
|
-
|
|
232
|
-
|
|
|
233
|
-
|
|
234
|
-
|
|
|
235
|
-
|
|
|
236
|
-
|
|
|
237
|
-
|
|
|
238
|
-
|
|
|
239
|
-
|
|
|
240
|
-
|
|
|
241
|
-
|
|
|
206
|
+
## 🗂️ API Reference
|
|
207
|
+
|
|
208
|
+
| Method | Path | Description |
|
|
209
|
+
|--------|------|-------------|
|
|
210
|
+
| GET | `/health` | Server status & current model |
|
|
211
|
+
| GET | `/models` | Model list + load state |
|
|
212
|
+
| POST | `/models/load` | Load a model |
|
|
213
|
+
| POST | `/chat` | Chat (`stream=true/false`) |
|
|
214
|
+
| POST | `/agent` | Multi-step file agent |
|
|
215
|
+
| GET | `/mcp/installed` | Installed MCP servers |
|
|
216
|
+
| POST | `/mcp/install` | Install MCP server |
|
|
217
|
+
| GET | `/skills/marketplace` | Skills marketplace |
|
|
218
|
+
| POST | `/skills/install` | Install a skill |
|
|
219
|
+
| GET | `/plugins/directory` | Plugin directory |
|
|
220
|
+
| GET | `/permissions/pending` | Pending file-access approvals (admin) |
|
|
221
|
+
| POST | `/permissions/approve/{token}` | Approve file access (admin) |
|
|
222
|
+
|
|
223
|
+
Full reference: [docs/mcp-tools.md](docs/mcp-tools.md)
|
|
242
224
|
|
|
243
225
|
---
|
|
244
226
|
|
|
245
|
-
##
|
|
227
|
+
## 🔧 Troubleshooting
|
|
246
228
|
|
|
247
|
-
|
|
|
248
|
-
|
|
249
|
-
|
|
|
250
|
-
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
- `npm`
|
|
257
|
-
- `PyPI`
|
|
258
|
-
- `VS Code Marketplace`
|
|
259
|
-
- `Open VSX`
|
|
260
|
-
|
|
261
|
-
### 수동 설치 (VSIX)
|
|
262
|
-
|
|
263
|
-
```bash
|
|
264
|
-
cd vscode-extension
|
|
265
|
-
npm install && npm run build && npm run package:vsix
|
|
266
|
-
# Extensions → "..." → "Install from VSIX"
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
---
|
|
270
|
-
|
|
271
|
-
## 어드민 패널
|
|
272
|
-
|
|
273
|
-
`http://localhost:4825/admin` — 관리자 계정으로 로그인 후 접근
|
|
274
|
-
|
|
275
|
-
- 사용자 목록 및 역할 관리 (admin / user)
|
|
276
|
-
- 대시보드 (메모리, 모델, 시스템 상태, 활동 차트)
|
|
277
|
-
- 초대 링크 생성 및 복사
|
|
278
|
-
|
|
279
|
-
> 첫 번째로 가입한 계정이 자동으로 admin입니다.
|
|
280
|
-
> 환경변수로 고정: `LATTICEAI_ADMIN_EMAILS=you@example.com`
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## P-Reinforce 지식 정원
|
|
285
|
-
|
|
286
|
-
코드/텍스트를 `~/.ltcai-brain/`에 자동 분류 저장합니다.
|
|
287
|
-
|
|
288
|
-
```
|
|
289
|
-
~/.ltcai-brain/
|
|
290
|
-
├── 00_Raw/ # 원시 데이터, 아이디어
|
|
291
|
-
├── 10_Wiki/ # 검증된 개념, 레퍼런스
|
|
292
|
-
├── 20_Skills/ # 코드 스니펫, 프롬프트
|
|
293
|
-
├── 30_Projects/ # 프로젝트 컨텍스트
|
|
294
|
-
└── 40_Log/ # 날짜별 작업 로그
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
에디터에서 텍스트 선택 → 우클릭 → **"Save to Knowledge Garden"**
|
|
298
|
-
|
|
299
|
-
---
|
|
300
|
-
|
|
301
|
-
## Data Graph / Graph RAG
|
|
302
|
-
|
|
303
|
-
채팅·AI 답변·업로드 문서(PDF/DOCX/XLSX/PPTX/TXT/CSV)를 `~/.ltcai/knowledge_graph.sqlite`에 자동 저장합니다.
|
|
304
|
-
|
|
305
|
-
- 시각화: `http://localhost:4825/graph`
|
|
306
|
-
- 검색 및 RAG 컨텍스트 자동 주입
|
|
229
|
+
| Symptom | Cause | Fix |
|
|
230
|
+
|---------|-------|-----|
|
|
231
|
+
| Port 4825 in use | Previous process | `lsof -i :4825` → `kill <PID>` or `--port 4826` |
|
|
232
|
+
| `ModuleNotFoundError: mlx` | MLX not installed | `pip install "ltcai[local]"` (Apple Silicon only) |
|
|
233
|
+
| Python < 3.11 | Version mismatch | Upgrade: `python3 --version` |
|
|
234
|
+
| `LTCAI doctor` OPTIONAL | Optional dep missing | Safe to ignore if feature not needed |
|
|
235
|
+
| No API key warning | Cloud model not set | `OPENAI_API_KEY=sk-... LTCAI` or set in admin panel |
|
|
236
|
+
| Can't reach from iPad | Default bind 127.0.0.1 | `LATTICEAI_HOST=0.0.0.0 LTCAI` or use `--tunnel` |
|
|
307
237
|
|
|
308
238
|
---
|
|
309
239
|
|
|
310
|
-
##
|
|
311
|
-
|
|
312
|
-
| Method | Path | 설명 |
|
|
313
|
-
|--------|------|------|
|
|
314
|
-
| GET | `/health` | 서버 상태, 현재 모델 |
|
|
315
|
-
| GET | `/models` | 추천 모델 목록 + 로드 상태 |
|
|
316
|
-
| POST | `/models/load` | 모델 로드 |
|
|
317
|
-
| POST | `/models/switch/{id}` | 활성 모델 전환 |
|
|
318
|
-
| DELETE | `/models/unload/{id}` | 모델 언로드 |
|
|
319
|
-
| POST | `/chat` | 채팅 생성 (`stream=true/false`) |
|
|
320
|
-
| POST | `/agent` | 파일 생성/수정 에이전트 |
|
|
321
|
-
| GET | `/tools/list_dir` | 디렉토리 목록 |
|
|
322
|
-
| POST | `/tools/run_command` | 터미널 명령 실행 |
|
|
323
|
-
| GET | `/mcp/installed` | 설치된 MCP 목록 (로컬 + 원격 레지스트리) |
|
|
324
|
-
| POST | `/mcp/install` | MCP 설치 (bundled / pip / npm / pypi) |
|
|
325
|
-
| POST | `/mcp/registry/refresh` | 원격 MCP 레지스트리 캐시 갱신 |
|
|
326
|
-
| GET | `/skills/marketplace` | Skills 마켓플레이스 (Anthropic + 서드파티, `?category=` `?author=`) |
|
|
327
|
-
| POST | `/skills/install` | Skill 설치 (`{ "plugin": "...", "skill": "..." }`) |
|
|
328
|
-
| GET | `/skills/list` | 로컬 설치 skills 목록 |
|
|
329
|
-
| GET | `/plugins/directory` | 오픈소스 플러그인 디렉터리 149개 (`?q=` `?category=` `?license=`) |
|
|
330
|
-
|
|
331
|
-
자세한 MCP 도구 목록: [docs/mcp-tools.md](docs/mcp-tools.md)
|
|
332
|
-
|
|
333
|
-
---
|
|
334
|
-
|
|
335
|
-
## 자동 시작 (Mac)
|
|
240
|
+
## 🚀 Auto-start (Mac)
|
|
336
241
|
|
|
337
242
|
```bash
|
|
338
243
|
cat > ~/Library/LaunchAgents/com.ltcai.plist << 'EOF'
|
|
@@ -341,9 +246,7 @@ cat > ~/Library/LaunchAgents/com.ltcai.plist << 'EOF'
|
|
|
341
246
|
<plist version="1.0">
|
|
342
247
|
<dict>
|
|
343
248
|
<key>Label</key><string>com.ltcai</string>
|
|
344
|
-
<key>ProgramArguments</key><array>
|
|
345
|
-
<string>/usr/local/bin/LTCAI</string>
|
|
346
|
-
</array>
|
|
249
|
+
<key>ProgramArguments</key><array><string>/usr/local/bin/LTCAI</string></array>
|
|
347
250
|
<key>RunAtLoad</key><true/>
|
|
348
251
|
<key>KeepAlive</key><true/>
|
|
349
252
|
<key>StandardOutPath</key><string>/tmp/ltcai.log</string>
|
|
@@ -354,22 +257,69 @@ EOF
|
|
|
354
257
|
launchctl load ~/Library/LaunchAgents/com.ltcai.plist
|
|
355
258
|
```
|
|
356
259
|
|
|
357
|
-
|
|
260
|
+
Or: `./start_ai.sh` (auto-restart + caffeinate)
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 📦 Distribution
|
|
265
|
+
|
|
266
|
+
| Channel | Link |
|
|
267
|
+
|---------|------|
|
|
268
|
+
| PyPI | [pypi.org/project/ltcai](https://pypi.org/project/ltcai/) |
|
|
269
|
+
| npm | [npmjs.com/package/ltcai](https://www.npmjs.com/package/ltcai) |
|
|
270
|
+
| VS Code Marketplace | [marketplace.visualstudio.com](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai) |
|
|
271
|
+
| Open VSX | [open-vsx.org](https://open-vsx.org/extension/parktaesoo/ltcai) |
|
|
272
|
+
|
|
273
|
+
Current version: **0.1.23** — [Changelog](docs/CHANGELOG.md)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 🤝 Contributing
|
|
278
|
+
|
|
279
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). All PRs welcome.
|
|
280
|
+
|
|
281
|
+
## 📄 License
|
|
282
|
+
|
|
283
|
+
MIT — [TaeSoo Park](https://github.com/TaeSooPark-PTS)
|
|
358
284
|
|
|
359
285
|
---
|
|
360
286
|
|
|
361
|
-
|
|
287
|
+
<details>
|
|
288
|
+
<summary>한국어 안내 (Korean)</summary>
|
|
289
|
+
|
|
290
|
+
## 한국어 안내
|
|
362
291
|
|
|
363
|
-
|
|
292
|
+
**Lattice AI**는 로컬/클라우드 LLM을 웹 UI · VS Code 확장 · Telegram 봇 · MCP 도구로 하나의 서버에서 운영하는 개인 AI 워크스페이스입니다.
|
|
364
293
|
|
|
365
|
-
|
|
294
|
+
### 설치
|
|
366
295
|
|
|
367
|
-
|
|
296
|
+
```bash
|
|
297
|
+
pip install ltcai # 클라우드 모델
|
|
298
|
+
pip install "ltcai[local]" # + Apple Silicon MLX 로컬 모델
|
|
299
|
+
LTCAI # 서버 실행 → http://localhost:4825
|
|
300
|
+
LTCAI --tunnel # + Cloudflare 공개 URL 자동 발급
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### 주요 기능
|
|
368
304
|
|
|
369
|
-
|
|
305
|
+
- 웹 UI 채팅 + 어드민 대시보드 + Data Graph 시각화
|
|
306
|
+
- VS Code / Cursor 확장 (`Cmd+Shift+A`)
|
|
307
|
+
- Telegram 봇 연동
|
|
308
|
+
- MCP 레지스트리 & Skills 마켓플레이스
|
|
309
|
+
- Graph RAG — 채팅·문서를 SQLite 지식 그래프로 자동 구조화
|
|
310
|
+
- 멀티 LLM 파이프라인 (Plan → Execute → Review)
|
|
311
|
+
- Human-in-the-loop 에이전트 승인
|
|
312
|
+
- 감사 로그 & 데이터 거버넌스 대시보드
|
|
313
|
+
- 텔레메트리 없음 — 모든 데이터 로컬 저장
|
|
370
314
|
|
|
371
|
-
|
|
315
|
+
### 추천 로컬 모델 (M-series Mac)
|
|
316
|
+
|
|
317
|
+
| 모델 | 용도 | 크기 |
|
|
318
|
+
|------|------|------|
|
|
319
|
+
| `mlx-community/gemma-4-26b-a4b-it-4bit` | 범용 | ~14GB |
|
|
320
|
+
| `mlx-community/Qwen2.5-Coder-32B-Instruct-4bit` | 코딩 | ~18GB |
|
|
321
|
+
| `mlx-community/DeepSeek-R1-0528-4bit` | 추론 | ~38GB |
|
|
372
322
|
|
|
373
|
-
|
|
323
|
+
자세한 내용: [docs/CHANGELOG.md](docs/CHANGELOG.md) · [보안](SECURITY.md) · [기여](CONTRIBUTING.md)
|
|
374
324
|
|
|
375
|
-
|
|
325
|
+
</details>
|
package/bin/ltcai.js
CHANGED
|
@@ -12,6 +12,33 @@ const managedPython = process.platform === "win32"
|
|
|
12
12
|
? path.join(managedVenv, "Scripts", "python.exe")
|
|
13
13
|
: path.join(managedVenv, "bin", "python");
|
|
14
14
|
|
|
15
|
+
function loadDotEnv(file) {
|
|
16
|
+
if (!fs.existsSync(file)) return;
|
|
17
|
+
for (const rawLine of fs.readFileSync(file, "utf8").split(/\r?\n/)) {
|
|
18
|
+
const line = rawLine.trim();
|
|
19
|
+
if (!line || line.startsWith("#") || !line.includes("=")) continue;
|
|
20
|
+
const index = line.indexOf("=");
|
|
21
|
+
const key = line.slice(0, index).trim();
|
|
22
|
+
const value = line.slice(index + 1).trim().replace(/^["']|["']$/g, "");
|
|
23
|
+
if (key && process.env[key] === undefined) process.env[key] = value;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function applyExtraPath() {
|
|
28
|
+
const extra = process.env.LATTICEAI_EXTRA_PATH;
|
|
29
|
+
if (!extra) return;
|
|
30
|
+
const sep = path.delimiter;
|
|
31
|
+
const current = (process.env.PATH || "").split(sep).filter(Boolean);
|
|
32
|
+
for (const item of extra.split(sep).filter(Boolean).reverse()) {
|
|
33
|
+
const expanded = item.replace(/^~(?=$|\/|\\)/, os.homedir());
|
|
34
|
+
if (fs.existsSync(expanded) && !current.includes(expanded)) current.unshift(expanded);
|
|
35
|
+
}
|
|
36
|
+
process.env.PATH = current.join(sep);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
loadDotEnv(path.join(root, ".env"));
|
|
40
|
+
applyExtraPath();
|
|
41
|
+
|
|
15
42
|
function runSync(cmd, args, options = {}) {
|
|
16
43
|
const result = spawnSync(cmd, args, { stdio: "inherit", ...options });
|
|
17
44
|
return result.status === 0;
|