mageagent-local 2.0.1
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/LICENSE +21 -0
- package/QUICK_START.md +255 -0
- package/README.md +453 -0
- package/bin/install-launchagent.js +135 -0
- package/bin/mageagent.js +255 -0
- package/bin/postinstall.js +43 -0
- package/config/com.adverant.mageagent.plist +38 -0
- package/config/config.example.json +41 -0
- package/docs/AUTOSTART.md +300 -0
- package/docs/MENUBAR_APP.md +238 -0
- package/docs/PATTERNS.md +501 -0
- package/docs/TROUBLESHOOTING.md +364 -0
- package/docs/VSCODE_SETUP.md +230 -0
- package/docs/assets/mageagent-logo.png +0 -0
- package/docs/assets/mageagent-logo.svg +57 -0
- package/docs/assets/menubar-screenshot.png +0 -0
- package/docs/diagrams/architecture.md +229 -0
- package/mageagent/__init__.py +4 -0
- package/mageagent/server.py +951 -0
- package/mageagent/tool_executor.py +453 -0
- package/menubar-app/MageAgentMenuBar/AppDelegate.swift +1337 -0
- package/menubar-app/MageAgentMenuBar/Info.plist +38 -0
- package/menubar-app/MageAgentMenuBar/main.swift +16 -0
- package/menubar-app/Package.swift +18 -0
- package/menubar-app/build/MageAgentMenuBar.app/Contents/Info.plist +38 -0
- package/menubar-app/build/MageAgentMenuBar.app/Contents/MacOS/MageAgentMenuBar +0 -0
- package/menubar-app/build/MageAgentMenuBar.app/Contents/PkgInfo +1 -0
- package/menubar-app/build/MageAgentMenuBar.app/Contents/Resources/icon.png +0 -0
- package/menubar-app/build.sh +96 -0
- package/package.json +81 -0
- package/scripts/build-dmg.sh +196 -0
- package/scripts/install.sh +641 -0
- package/scripts/mageagent-server.sh +218 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
# Troubleshooting Guide
|
|
2
|
+
|
|
3
|
+
This guide covers common issues and their solutions when running MageAgent.
|
|
4
|
+
|
|
5
|
+
## Quick Diagnostics
|
|
6
|
+
|
|
7
|
+
Run these commands to diagnose issues:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Check if server is running
|
|
11
|
+
mageagent status
|
|
12
|
+
|
|
13
|
+
# View recent logs
|
|
14
|
+
tail -50 ~/.claude/debug/mageagent.log
|
|
15
|
+
|
|
16
|
+
# Check error log
|
|
17
|
+
tail -50 ~/.claude/debug/mageagent.error.log
|
|
18
|
+
|
|
19
|
+
# Check port usage
|
|
20
|
+
lsof -i :3457
|
|
21
|
+
|
|
22
|
+
# Check memory
|
|
23
|
+
top -l 1 -o mem | head -10
|
|
24
|
+
|
|
25
|
+
# Check models exist
|
|
26
|
+
ls -la ~/.cache/mlx-models/
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Common Issues
|
|
30
|
+
|
|
31
|
+
### 1. Server Won't Start
|
|
32
|
+
|
|
33
|
+
**Symptom**: `mageagent start` fails or exits immediately
|
|
34
|
+
|
|
35
|
+
**Possible Causes & Solutions**:
|
|
36
|
+
|
|
37
|
+
#### Port already in use
|
|
38
|
+
```bash
|
|
39
|
+
# Find what's using port 3457
|
|
40
|
+
lsof -i :3457
|
|
41
|
+
|
|
42
|
+
# Kill the process
|
|
43
|
+
kill -9 <PID>
|
|
44
|
+
|
|
45
|
+
# Or kill by port
|
|
46
|
+
kill -9 $(lsof -t -i:3457)
|
|
47
|
+
|
|
48
|
+
# Restart
|
|
49
|
+
mageagent start
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Python dependencies missing
|
|
53
|
+
```bash
|
|
54
|
+
# Reinstall dependencies
|
|
55
|
+
pip3 install --upgrade mlx mlx-lm fastapi uvicorn pydantic huggingface_hub
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### Server file not found
|
|
59
|
+
```bash
|
|
60
|
+
# Reinstall MageAgent
|
|
61
|
+
mageagent install
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Permission issues
|
|
65
|
+
```bash
|
|
66
|
+
# Fix permissions
|
|
67
|
+
chmod +x ~/.claude/scripts/mageagent-server.sh
|
|
68
|
+
chmod 644 ~/.claude/mageagent/server.py
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### 2. Model Not Found Errors
|
|
74
|
+
|
|
75
|
+
**Symptom**: `FileNotFoundError: Model not found at /path/to/model`
|
|
76
|
+
|
|
77
|
+
**Solution**:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Check what models exist
|
|
81
|
+
ls -la ~/.cache/mlx-models/
|
|
82
|
+
|
|
83
|
+
# Download missing models
|
|
84
|
+
mageagent models
|
|
85
|
+
|
|
86
|
+
# Or download individually
|
|
87
|
+
python3 -c "
|
|
88
|
+
from huggingface_hub import snapshot_download
|
|
89
|
+
snapshot_download('mlx-community/Hermes-3-Llama-3.1-8B-8bit',
|
|
90
|
+
local_dir='$HOME/.cache/mlx-models/Hermes-3-Llama-3.1-8B-8bit')
|
|
91
|
+
"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Required models:
|
|
95
|
+
- `Hermes-3-Llama-3.1-8B-8bit` (9GB) - Tool calling
|
|
96
|
+
- `Qwen2.5-Coder-7B-Instruct-4bit` (5GB) - Validation
|
|
97
|
+
- `Qwen2.5-Coder-32B-Instruct-4bit` (18GB) - Coding
|
|
98
|
+
- `Qwen2.5-72B-Instruct-8bit` (77GB) - Primary reasoning
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### 3. Out of Memory Errors
|
|
103
|
+
|
|
104
|
+
**Symptom**: Process killed, "Killed: 9", or memory allocation errors
|
|
105
|
+
|
|
106
|
+
**Solutions**:
|
|
107
|
+
|
|
108
|
+
1. **Close other applications**
|
|
109
|
+
```bash
|
|
110
|
+
# Check memory pressure
|
|
111
|
+
memory_pressure
|
|
112
|
+
|
|
113
|
+
# See top memory consumers
|
|
114
|
+
top -l 1 -o mem | head -20
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
2. **Use smaller patterns**
|
|
118
|
+
- `mageagent:tools` - Only 9GB (Hermes-3)
|
|
119
|
+
- `mageagent:validator` - Only 5GB (Qwen-7B)
|
|
120
|
+
- `mageagent:competitor` - Only 18GB (Qwen-32B)
|
|
121
|
+
- Avoid `mageagent:compete` which loads multiple large models
|
|
122
|
+
|
|
123
|
+
3. **Restart server to clear model cache**
|
|
124
|
+
```bash
|
|
125
|
+
mageagent restart
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
4. **Check your system memory**
|
|
129
|
+
- 64GB: Can run tools, validator, competitor
|
|
130
|
+
- 128GB: Can run all patterns including hybrid and compete
|
|
131
|
+
- 96GB: May struggle with compete pattern
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### 4. Slow Responses
|
|
136
|
+
|
|
137
|
+
**Symptom**: Responses take 60+ seconds
|
|
138
|
+
|
|
139
|
+
**Causes & Solutions**:
|
|
140
|
+
|
|
141
|
+
1. **First request loads models** (normal)
|
|
142
|
+
- 72B model takes 5-10 seconds to load
|
|
143
|
+
- Subsequent requests are faster
|
|
144
|
+
|
|
145
|
+
2. **Use faster patterns**
|
|
146
|
+
```bash
|
|
147
|
+
# Fast patterns
|
|
148
|
+
mageagent:tools # 3-5s
|
|
149
|
+
mageagent:validator # 2-3s
|
|
150
|
+
|
|
151
|
+
# Slower patterns (use for important tasks)
|
|
152
|
+
mageagent:hybrid # 30-60s
|
|
153
|
+
mageagent:validated # 40-80s
|
|
154
|
+
mageagent:compete # 60-120s
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
3. **Check system load**
|
|
158
|
+
```bash
|
|
159
|
+
# See if system is under load
|
|
160
|
+
top -l 1
|
|
161
|
+
|
|
162
|
+
# Check thermal throttling
|
|
163
|
+
pmset -g thermlog
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### 5. Tool Calls Not Extracted
|
|
169
|
+
|
|
170
|
+
**Symptom**: Response doesn't contain `<tool_calls>` section
|
|
171
|
+
|
|
172
|
+
**Solutions**:
|
|
173
|
+
|
|
174
|
+
1. **Verify Hermes-3 Q8 is downloaded**
|
|
175
|
+
```bash
|
|
176
|
+
ls -la ~/.cache/mlx-models/Hermes-3-Llama-3.1-8B-8bit/
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
2. **Use hybrid pattern** (always attempts extraction)
|
|
180
|
+
```bash
|
|
181
|
+
curl -X POST http://localhost:3457/v1/chat/completions \
|
|
182
|
+
-H "Content-Type: application/json" \
|
|
183
|
+
-d '{"model": "mageagent:hybrid", "messages": [{"role": "user", "content": "Read the file at /tmp/test.txt"}]}'
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
3. **Check prompt contains tool keywords**
|
|
187
|
+
- "read file", "write file", "execute", "run", "search", "find", "edit"
|
|
188
|
+
- "tool", "function call", "glob", "grep", "bash"
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### 6. API Connection Refused
|
|
193
|
+
|
|
194
|
+
**Symptom**: `curl: (7) Failed to connect to localhost port 3457`
|
|
195
|
+
|
|
196
|
+
**Solutions**:
|
|
197
|
+
|
|
198
|
+
1. **Check if server is running**
|
|
199
|
+
```bash
|
|
200
|
+
mageagent status
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
2. **Start the server**
|
|
204
|
+
```bash
|
|
205
|
+
mageagent start
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
3. **Check firewall** (rarely an issue for localhost)
|
|
209
|
+
```bash
|
|
210
|
+
# Temporarily disable firewall for testing
|
|
211
|
+
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
|
|
212
|
+
# Remember to re-enable!
|
|
213
|
+
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
### 7. JSON Parse Errors
|
|
219
|
+
|
|
220
|
+
**Symptom**: `json.decoder.JSONDecodeError` in logs
|
|
221
|
+
|
|
222
|
+
**Cause**: Model output not properly formatted
|
|
223
|
+
|
|
224
|
+
**Solutions**:
|
|
225
|
+
|
|
226
|
+
1. **Lower temperature**
|
|
227
|
+
```bash
|
|
228
|
+
curl -X POST http://localhost:3457/v1/chat/completions \
|
|
229
|
+
-H "Content-Type: application/json" \
|
|
230
|
+
-d '{
|
|
231
|
+
"model": "mageagent:tools",
|
|
232
|
+
"messages": [...],
|
|
233
|
+
"temperature": 0.3
|
|
234
|
+
}'
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
2. **Restart server** (may have corrupted state)
|
|
238
|
+
```bash
|
|
239
|
+
mageagent restart
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
### 8. Import Errors
|
|
245
|
+
|
|
246
|
+
**Symptom**: `ModuleNotFoundError: No module named 'mlx'`
|
|
247
|
+
|
|
248
|
+
**Solution**:
|
|
249
|
+
```bash
|
|
250
|
+
# Make sure you're using the right Python
|
|
251
|
+
which python3
|
|
252
|
+
# Should be: /usr/bin/python3 or /opt/homebrew/bin/python3
|
|
253
|
+
|
|
254
|
+
# Reinstall packages
|
|
255
|
+
pip3 install --upgrade mlx mlx-lm fastapi uvicorn pydantic
|
|
256
|
+
|
|
257
|
+
# If using pyenv or conda, make sure the right env is active
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
### 9. LaunchAgent Issues
|
|
263
|
+
|
|
264
|
+
**Symptom**: Server doesn't auto-start on boot
|
|
265
|
+
|
|
266
|
+
**Solutions**:
|
|
267
|
+
|
|
268
|
+
1. **Check plist syntax**
|
|
269
|
+
```bash
|
|
270
|
+
plutil -lint ~/Library/LaunchAgents/com.adverant.mageagent.plist
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
2. **Reload LaunchAgent**
|
|
274
|
+
```bash
|
|
275
|
+
launchctl unload ~/Library/LaunchAgents/com.adverant.mageagent.plist
|
|
276
|
+
launchctl load ~/Library/LaunchAgents/com.adverant.mageagent.plist
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
3. **Check system logs**
|
|
280
|
+
```bash
|
|
281
|
+
log show --predicate 'subsystem == "com.apple.launchd"' --last 5m | grep mageagent
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
### 10. Claude Code Router Issues
|
|
287
|
+
|
|
288
|
+
**Symptom**: `/model mageagent,mageagent:hybrid` doesn't work
|
|
289
|
+
|
|
290
|
+
**Solutions**:
|
|
291
|
+
|
|
292
|
+
1. **Check router config**
|
|
293
|
+
```bash
|
|
294
|
+
cat ~/.claude-code-router/config.json
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Should include:
|
|
298
|
+
```json
|
|
299
|
+
{
|
|
300
|
+
"providers": [
|
|
301
|
+
{
|
|
302
|
+
"name": "mageagent",
|
|
303
|
+
"api_base_url": "http://localhost:3457/v1/chat/completions",
|
|
304
|
+
"api_key": "local",
|
|
305
|
+
"models": ["mageagent:hybrid", ...]
|
|
306
|
+
}
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
2. **Restart Claude Code Router**
|
|
312
|
+
```bash
|
|
313
|
+
ccr restart
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
3. **Verify MageAgent is responding**
|
|
317
|
+
```bash
|
|
318
|
+
curl http://localhost:3457/health
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## Getting More Help
|
|
324
|
+
|
|
325
|
+
### Collect Debug Information
|
|
326
|
+
|
|
327
|
+
Before reporting an issue, collect this info:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
# System info
|
|
331
|
+
uname -a
|
|
332
|
+
sysctl -n machdep.cpu.brand_string
|
|
333
|
+
sysctl -n hw.memsize | awk '{print $0/1024/1024/1024 " GB"}'
|
|
334
|
+
|
|
335
|
+
# MageAgent version
|
|
336
|
+
cat ~/.claude/mageagent/server.py | grep "version"
|
|
337
|
+
|
|
338
|
+
# Python version
|
|
339
|
+
python3 --version
|
|
340
|
+
|
|
341
|
+
# Installed packages
|
|
342
|
+
pip3 list | grep -E "(mlx|fastapi|uvicorn|pydantic)"
|
|
343
|
+
|
|
344
|
+
# Server status
|
|
345
|
+
mageagent status
|
|
346
|
+
|
|
347
|
+
# Recent logs
|
|
348
|
+
tail -100 ~/.claude/debug/mageagent.log
|
|
349
|
+
tail -100 ~/.claude/debug/mageagent.error.log
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Report Issues
|
|
353
|
+
|
|
354
|
+
Open an issue at: https://github.com/adverant/nexus-local-mageagent/issues
|
|
355
|
+
|
|
356
|
+
Include:
|
|
357
|
+
1. System information (from above)
|
|
358
|
+
2. Steps to reproduce
|
|
359
|
+
3. Expected vs actual behavior
|
|
360
|
+
4. Relevant log output
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
*Made with care by [Adverant](https://github.com/adverant)*
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# VSCode Extension Setup Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how to configure the Claude Code VSCode extension to work with MageAgent for multi-model orchestration.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
MageAgent runs as a local server on port 3457, providing an OpenAI-compatible API. The Claude Code VSCode extension can be configured to use MageAgent through the Claude Code Router.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
1. MageAgent server running (`~/.claude/scripts/mageagent-server.sh start`)
|
|
12
|
+
2. Claude Code Router installed (`npm install -g @musistudio/claude-code-router`)
|
|
13
|
+
3. Claude Code VSCode extension installed
|
|
14
|
+
|
|
15
|
+
## Configuration Steps
|
|
16
|
+
|
|
17
|
+
### Step 1: Configure Router for MageAgent
|
|
18
|
+
|
|
19
|
+
Create or update `~/.claude-code-router/config.json`:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"providers": [
|
|
24
|
+
{
|
|
25
|
+
"name": "mageagent",
|
|
26
|
+
"api_base_url": "http://localhost:3457/v1/chat/completions",
|
|
27
|
+
"api_key": "local",
|
|
28
|
+
"models": [
|
|
29
|
+
"mageagent:auto",
|
|
30
|
+
"mageagent:hybrid",
|
|
31
|
+
"mageagent:validated",
|
|
32
|
+
"mageagent:compete",
|
|
33
|
+
"mageagent:tools",
|
|
34
|
+
"mageagent:primary",
|
|
35
|
+
"mageagent:validator",
|
|
36
|
+
"mageagent:competitor"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "anthropic",
|
|
41
|
+
"api_base_url": "https://api.anthropic.com",
|
|
42
|
+
"api_key": "${ANTHROPIC_API_KEY}",
|
|
43
|
+
"models": [
|
|
44
|
+
"claude-opus-4-5-20251101",
|
|
45
|
+
"claude-sonnet-4-5-20250929"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"Router": {
|
|
50
|
+
"default": "mageagent,mageagent:hybrid"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Step 2: Configure Claude Settings
|
|
56
|
+
|
|
57
|
+
Add to `~/.claude/settings.json`:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"env": {
|
|
62
|
+
"ANTHROPIC_BASE_URL": "http://127.0.0.1:3456"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
This tells Claude Code to route all API calls through your local router.
|
|
68
|
+
|
|
69
|
+
### Step 3: Set System Environment Variable
|
|
70
|
+
|
|
71
|
+
Add to your `~/.zshrc`:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
export ANTHROPIC_BASE_URL=http://127.0.0.1:3456
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Then reload:
|
|
78
|
+
```bash
|
|
79
|
+
source ~/.zshrc
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Step 4: Restart VSCode Completely
|
|
83
|
+
|
|
84
|
+
**Important**: You must completely quit and restart VSCode (not just reload window) for environment variables to take effect.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Quit VSCode completely, then relaunch
|
|
88
|
+
code .
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Step 5: Verify Services Running
|
|
92
|
+
|
|
93
|
+
Before using VSCode, ensure both services are running:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Check MageAgent server
|
|
97
|
+
curl http://localhost:3457/health
|
|
98
|
+
|
|
99
|
+
# Check Claude Code Router
|
|
100
|
+
ccr status
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Using MageAgent in VSCode
|
|
104
|
+
|
|
105
|
+
### Switching Models
|
|
106
|
+
|
|
107
|
+
Use the `/model` command in any Claude Code session:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Use MageAgent hybrid (recommended)
|
|
111
|
+
/model mageagent,mageagent:hybrid
|
|
112
|
+
|
|
113
|
+
# Use MageAgent validated for code quality
|
|
114
|
+
/model mageagent,mageagent:validated
|
|
115
|
+
|
|
116
|
+
# Use MageAgent compete for critical code
|
|
117
|
+
/model mageagent,mageagent:compete
|
|
118
|
+
|
|
119
|
+
# Switch back to Claude Opus
|
|
120
|
+
/model anthropic,claude-opus-4-5-20251101
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Natural Language Switching
|
|
124
|
+
|
|
125
|
+
Just say:
|
|
126
|
+
- "use mageagent" → Switches to hybrid pattern
|
|
127
|
+
- "mage validated" → Switches to validated pattern
|
|
128
|
+
- "use claude" → Switches back to Claude
|
|
129
|
+
|
|
130
|
+
### Pattern Selection Tips
|
|
131
|
+
|
|
132
|
+
| Pattern | When to Use |
|
|
133
|
+
|---------|-------------|
|
|
134
|
+
| `hybrid` | Default for most tasks |
|
|
135
|
+
| `validated` | Production code, need error checking |
|
|
136
|
+
| `compete` | Critical features, want best quality |
|
|
137
|
+
| `tools` | Quick file operations |
|
|
138
|
+
| `auto` | Let MageAgent decide |
|
|
139
|
+
|
|
140
|
+
## Troubleshooting
|
|
141
|
+
|
|
142
|
+
### Extension Not Using Router
|
|
143
|
+
|
|
144
|
+
1. **Check router is running**:
|
|
145
|
+
```bash
|
|
146
|
+
ccr status
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
2. **Verify environment variable**:
|
|
150
|
+
```bash
|
|
151
|
+
echo $ANTHROPIC_BASE_URL
|
|
152
|
+
# Should output: http://127.0.0.1:3456
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
3. **Restart VSCode completely** - not just reload window
|
|
156
|
+
|
|
157
|
+
### MageAgent Server Not Responding
|
|
158
|
+
|
|
159
|
+
1. **Check server status**:
|
|
160
|
+
```bash
|
|
161
|
+
~/.claude/scripts/mageagent-server.sh status
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
2. **View logs**:
|
|
165
|
+
```bash
|
|
166
|
+
tail -f ~/.claude/debug/mageagent.log
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
3. **Restart server**:
|
|
170
|
+
```bash
|
|
171
|
+
~/.claude/scripts/mageagent-server.sh stop
|
|
172
|
+
~/.claude/scripts/mageagent-server.sh start
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Model Loading Slow
|
|
176
|
+
|
|
177
|
+
Large models (72B) take 5-10 seconds to load initially. Subsequent requests are faster as models are cached in memory.
|
|
178
|
+
|
|
179
|
+
Monitor memory usage:
|
|
180
|
+
```bash
|
|
181
|
+
top -l 1 -o mem | head -10
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Out of Memory
|
|
185
|
+
|
|
186
|
+
If you see memory errors:
|
|
187
|
+
1. Close other applications
|
|
188
|
+
2. Use smaller patterns (`tools`, `validator`)
|
|
189
|
+
3. Restart MageAgent to clear cached models
|
|
190
|
+
|
|
191
|
+
## Performance Expectations
|
|
192
|
+
|
|
193
|
+
| Pattern | First Request | Subsequent |
|
|
194
|
+
|---------|---------------|------------|
|
|
195
|
+
| tools | 5-10s | 3-5s |
|
|
196
|
+
| hybrid | 30-45s | 25-35s |
|
|
197
|
+
| validated | 45-60s | 35-50s |
|
|
198
|
+
| compete | 60-90s | 50-70s |
|
|
199
|
+
|
|
200
|
+
## Direct API Access
|
|
201
|
+
|
|
202
|
+
You can also use MageAgent directly without the router:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
curl -X POST http://localhost:3457/v1/chat/completions \
|
|
206
|
+
-H "Content-Type: application/json" \
|
|
207
|
+
-d '{
|
|
208
|
+
"model": "mageagent:hybrid",
|
|
209
|
+
"messages": [{"role": "user", "content": "Hello!"}]
|
|
210
|
+
}'
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Memory Requirements
|
|
214
|
+
|
|
215
|
+
For full MageAgent capability, you need:
|
|
216
|
+
|
|
217
|
+
| Pattern | Peak Memory |
|
|
218
|
+
|---------|-------------|
|
|
219
|
+
| tools only | ~9 GB |
|
|
220
|
+
| validator only | ~5 GB |
|
|
221
|
+
| primary only | ~77 GB |
|
|
222
|
+
| hybrid | ~86 GB |
|
|
223
|
+
| validated | ~86 GB |
|
|
224
|
+
| compete | ~100 GB |
|
|
225
|
+
|
|
226
|
+
Recommended: 128GB unified memory for best experience.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
*Made with care by [Adverant](https://github.com/adverant)*
|
|
Binary file
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
4
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
5
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
6
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
viewBox="84.67 462.67 1164 141.2"
|
|
9
|
+
height="141.2"
|
|
10
|
+
width="1164"
|
|
11
|
+
xml:space="preserve"
|
|
12
|
+
id="svg2"
|
|
13
|
+
version="1.1"><metadata
|
|
14
|
+
id="metadata8"><rdf:RDF><cc:Work
|
|
15
|
+
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
|
16
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
|
17
|
+
id="defs6" /><g
|
|
18
|
+
transform="matrix(1.3333333,0,0,-1.3333333,0,1066.6667)"
|
|
19
|
+
id="g10"><g
|
|
20
|
+
transform="scale(0.1)"
|
|
21
|
+
id="g12"><path
|
|
22
|
+
id="path16"
|
|
23
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
24
|
+
d="M 1185.5,4439.73 715.215,3563.72 h 221.086 l 345.529,669.45 345.53,-669.45 h 222.51 l -472.94,876.01 H 1185.5" /><path
|
|
25
|
+
id="path18"
|
|
26
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
27
|
+
d="m 2747.08,4150.21 c 0,38.92 -6.2,64.75 -18.6,77.49 -12.4,12.73 -35.09,19.1 -68.06,19.1 h -534.64 v -491.38 h 534.64 c 33.95,0 56.88,6.12 68.79,18.38 11.92,12.26 17.87,37.9 17.87,76.94 z m -816.7,-586.49 v 876.01 h 730.04 c 52.77,0 97.33,-4.82 133.7,-14.46 36.35,-9.64 65.47,-26.3 87.35,-49.98 21.87,-23.67 37.31,-53.69 46.29,-90.07 8.99,-36.37 13.49,-80.95 13.49,-133.75 v -299.46 c 0,-52.89 -4.5,-97.78 -13.49,-134.63 -8.98,-36.87 -24.43,-66.91 -46.33,-90.13 -21.9,-23.23 -50.91,-39.62 -87.01,-49.19 -36.1,-9.57 -80.77,-14.34 -134,-14.34 h -730.04" /><path
|
|
28
|
+
id="path20"
|
|
29
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
30
|
+
d="m 3456.12,3563.72 -470.29,876.01 h 221.09 l 345.53,-669.45 345.53,669.45 h 222.51 l -472.94,-876.01 h -191.43" /><path
|
|
31
|
+
id="path22"
|
|
32
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
33
|
+
d="m 4205.08,3563.72 v 876.01 h 845.05 V 4246.8 h -650.89 v -163.46 h 632.32 v -162 h -632.32 v -165.92 h 650.89 v -191.7 h -845.05" /><path
|
|
34
|
+
id="path24"
|
|
35
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
36
|
+
d="m 5948.49,4135.38 c 0,39.43 -4,67.66 -11.99,84.67 -7.98,17.02 -27.12,25.52 -57.39,25.52 h -508.64 v -238.95 h 508.64 c 25.35,0 43.24,6.06 53.7,18.19 10.45,12.14 15.68,35.38 15.68,69.74 z m -34.4,-571.66 -294.5,278.43 h -249.12 v -278.43 h -195.39 v 876.01 h 708.96 c 46.69,0 86.5,-5.05 119.43,-15.15 32.93,-10.11 59.64,-26.28 80.11,-48.52 20.48,-22.23 35.24,-51.01 44.28,-86.31 9.03,-35.31 13.56,-77.28 13.56,-125.91 v -52 c 0,-53.23 -5.41,-97.15 -16.22,-131.75 -10.82,-34.6 -28.74,-62.17 -53.77,-82.71 -25.03,-20.54 -56.49,-34.47 -94.35,-41.79 -37.86,-7.31 -79.19,-10.98 -124,-10.98 l 315.56,-280.89 h -254.55" /><path
|
|
37
|
+
id="path26"
|
|
38
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
39
|
+
d="M 6675.48,4439.73 6205.2,3563.72 h 221.08 l 345.54,669.45 345.52,-669.45 h 222.51 l -472.94,876.01 h -191.43" /><path
|
|
40
|
+
id="path28"
|
|
41
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
42
|
+
d="m 8780.03,3563.72 v 683.08 h -310.61 v 192.93 h 815.37 V 4246.8 h -310.6 v -683.08 h -194.16" /><path
|
|
43
|
+
id="path30"
|
|
44
|
+
style="fill:#4faeca;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
45
|
+
d="m 8153.9,4448.96 h 179.58 c 46.81,0 84.5,-37.69 84.5,-84.51 v -179.57 c 0,-46.82 -37.69,-84.51 -84.5,-84.51 H 8153.9 c -46.82,0 -84.51,37.69 -84.51,84.51 v 179.57 c 0,46.81 37.69,84.51 84.51,84.51" /><path
|
|
46
|
+
id="path32"
|
|
47
|
+
style="fill:#4faeca;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
48
|
+
d="m 7497.38,3899.62 h 179.58 c 46.82,0 84.5,-37.68 84.5,-84.5 v -179.58 c 0,-46.81 -37.68,-84.5 -84.5,-84.5 h -179.58 c -46.81,0 -84.5,37.69 -84.5,84.5 v 179.58 c 0,46.82 37.69,84.5 84.5,84.5" /><path
|
|
49
|
+
id="path34"
|
|
50
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
51
|
+
d="m 7497.38,4448.96 h 179.58 c 46.82,0 84.5,-37.69 84.5,-84.51 v -179.57 c 0,-46.81 -37.68,-84.51 -84.5,-84.51 h -179.58 c -46.81,0 -84.5,37.7 -84.5,84.51 v 179.57 c 0,46.82 37.69,84.51 84.5,84.51 v 0" /><path
|
|
52
|
+
id="path36"
|
|
53
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
54
|
+
d="m 8153.9,3899.62 h 179.58 c 46.81,0 84.5,-37.68 84.5,-84.5 v -179.58 c 0,-46.81 -37.69,-84.5 -84.5,-84.5 H 8153.9 c -46.82,0 -84.51,37.69 -84.51,84.5 v 179.58 c 0,46.82 37.69,84.5 84.51,84.5" /><path
|
|
55
|
+
id="path38"
|
|
56
|
+
style="fill:#5e6061;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
57
|
+
d="m 7761.46,4364.45 c 52.96,-323.25 265.94,-450.93 572.02,-464.83 l -264.09,-264.08 c -104.49,236.06 -231.81,450.63 -572.01,464.83 l 264.08,264.08" /></g></g></svg>
|
|
Binary file
|