You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/local-ai-use/SKILL.md
+69-98Lines changed: 69 additions & 98 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,18 +21,28 @@ needs image generation, text-to-speech, or speech-to-text uses the local
21
21
agent's own LLM keeps handling text; only the expensive multimodal calls move
22
22
on-device.
23
23
24
-
The skill does two things:
25
-
26
-
1.**Verifies that local Lemonade is reachable and has the right models.**
27
-
2.**Drops a `Local AI Use` block into the workspace `AGENTS.md`** so the agent
24
+
The skill does three things:
25
+
26
+
1.**Makes sure local Lemonade is installed and running.** If the `lemonade`
27
+
CLI is missing, the setup script installs the **full version** of Lemonade
28
+
(server + desktop app) on the user's behalf; if the server is installed but
29
+
not running, it launches it.
30
+
2.**Verifies that local Lemonade is reachable.**
31
+
3.**Drops a `Local AI Use` block into the workspace `AGENTS.md`** so the agent
28
32
reads the routing rule on every later turn, in Cursor, Claude Code, Codex,
29
33
Gemini CLI, and any other agent that respects `AGENTS.md`.
30
34
35
+
Models are **not** downloaded during setup. Each default model is pulled
36
+
lazily, on first use, by the routing rule (e.g. the first image request pulls
37
+
the image model). This keeps setup fast and avoids gigabytes of downloads the
38
+
user may never need.
39
+
31
40
## When to use this skill
32
41
33
42
Use this skill when **all** of the following are true:
34
43
35
-
- The user has, or is willing to install, the system-wide Lemonade Server.
44
+
- The user wants local Lemonade. If it is not yet installed, the setup script
45
+
installs the **full version** (server + desktop app) for them automatically.
36
46
- The user accepts the default Lemonade endpoint `http://localhost:13305`.
37
47
- The user wants the change to be **persistent** across future turns and
38
48
agent restarts (the rule is written to disk).
@@ -44,102 +54,104 @@ instead.
44
54
## Prerequisites
45
55
46
56
-**OS:** Windows 11 x64, Ubuntu/Debian x64, or macOS (beta).
47
-
-**Lemonade Server CLI on `PATH`:** verify with `lemonade --version`. If
48
-
missing, install from <https://lemonade-server.ai/install_options.html>
49
-
before continuing. Do not silently install on the user's machine; that is a
50
-
system-wide change and must be the user's call.
57
+
-**Lemonade Server:** the setup script installs it if missing. It downloads
58
+
and silently installs the **full version** (Windows `lemonade.msi`, the
59
+
Ubuntu/Debian `ppa:lemonade-team/stable` PPA plus `lemonade-desktop`, or the
60
+
macOS `.pkg`), then launches the server. On Linux/macOS this needs `sudo`.
61
+
Pass `--no-install` if the user wants to install it themselves instead.
51
62
-**Disk:**~8 GB free for the three default models (SD-Turbo + Whisper-Tiny
52
-
+ kokoro-v1).
53
-
-**Network:** required for the first `lemonade pull` of each model. After
54
-
that, every modality runs offline.
63
+
+ kokoro-v1), plus ~0.1 GB for the installer itself.
64
+
-**Network:** required for the install download and the first `lemonade pull`
65
+
of each model. After that, every modality runs offline.
55
66
56
67
## The opinionated path
57
68
58
69
Run this checklist top to bottom. Track progress against it; do not move on
59
70
until each step verifies.
60
71
61
72
```
62
-
[ ] 1. Confirm Lemonade Server is installed and reachable
63
-
[ ] 2. Pull the three default modality models
64
-
[ ] 3. Install the routing rule into the workspace AGENTS.md
65
-
[ ] 4. Smoke-test image, TTS, and STT against the local endpoint
73
+
[ ] 1. Ensure Lemonade Server is installed and running (auto-install if missing)
74
+
[ ] 2. Install the routing rule into the workspace AGENTS.md
66
75
```
67
76
68
-
The single command that does steps 1, 2, and 3 in one shot is:
77
+
The single command that does both steps in one shot is:
69
78
70
79
```bash
71
80
python scripts/setup_local_ai.py
72
81
```
73
82
74
-
The script is idempotent: re-running it on a
75
-
fully configured workspace is a no-op apart from a healthcheck. Read the
76
-
sections below for what to do when each step fails.
83
+
It auto-installs the full version of Lemonade if the `lemonade` CLI is
84
+
missing, launches the server if it is not running, then writes the rule. The
85
+
script is idempotent: re-running it on a fully configured workspace is a no-op
86
+
apart from a healthcheck. Read the sections below for what to do when each
87
+
step fails.
77
88
78
89
---
79
90
80
-
## Step 1: confirm Lemonade Server is reachable
91
+
## Step 1: ensure Lemonade Server is installed and running
81
92
82
-
Run:
93
+
`scripts/setup_local_ai.py` handles this end to end, but here is what it does
94
+
so you can do it by hand or debug it:
83
95
84
-
```bash
85
-
lemonade status --json
86
-
```
96
+
**1a. Is the CLI installed?** Check whether `lemonade` is on `PATH`
97
+
(`lemonade --version`). If it is not, install the **full version** on the
98
+
user's behalf:
87
99
88
-
Two acceptable outcomes:
100
+
| OS | Install the full version |
101
+
|---|---|
102
+
| Windows | Download `lemonade.msi` from the [latest release](https://github.com/lemonade-sdk/lemonade/releases/latest/download/lemonade.msi) and run `msiexec /i lemonade.msi /qn` (silent, per-user, no elevation). |
| macOS (beta) | Download the `Lemonade-<ver>-Darwin.pkg` from the latest release and run `sudo installer -pkg Lemonade-<ver>-Darwin.pkg -target /`. |
105
+
106
+
The full installer bundles the server **and** the desktop app; the
107
+
server-only minimal MSI and the legacy `lemonade-server` CLI are deprecated
108
+
upstream. After a Windows install the CLI lands in
109
+
`%LOCALAPPDATA%\lemonade_server` and is added to the *user* PATH (new shells
110
+
only); the setup script probes that directory so it works in the same run.
111
+
112
+
**1b. Is the server running?** Check `lemonade status --json`.
89
113
90
114
|`lemonade status` says | Action |
91
115
|---|---|
92
116
|`Server is running on port 13305`| Continue to Step 2. |
93
-
|`Server is not running`|Start it. On Windows, launch the **Lemonade** Start Menu shortcut. On Linux, run `sudo systemctl start lemonade-server`. Re-check `lemonade status`. |
117
+
|`Server is not running`|Launch it with `lemonade serve` (the script does this in the background and polls `/api/v1/health` until it answers). |
94
118
95
-
If `lemonade` is not on `PATH` at all, the server is not installed. Stop and
96
-
point the user at<https://lemonade-server.ai/install_options.html>. Do not
97
-
attempt a silent install.
119
+
Only if the automatic install genuinely fails (no `apt-get`, no `sudo`,
120
+
download blocked) should you stop and point the user at
curl -sX POST http://localhost:13305/api/v1/audio/speech \
193
-
-H "Content-Type: application/json" \
194
-
-d '{"model":"kokoro-v1","input":"Local AI is now active.","response_format":"mp3"}' \
195
-
-o out.mp3
196
-
```
197
-
198
-
**Speech-to-text** (round-trips `out.mp3` → text via a wav re-encode):
199
-
200
-
```bash
201
-
ffmpeg -y -i out.mp3 -ar 16000 -ac 1 out.wav
202
-
curl -sX POST http://localhost:13305/api/v1/audio/transcriptions \
203
-
-F "file=@out.wav" -F "model=Whisper-Tiny"
204
-
```
205
-
206
-
If any of the three returns a non-2xx status, fix it now. The rule we just
207
-
installed sends future requests to these same endpoints, so a broken endpoint
208
-
becomes a broken user experience.
209
-
210
184
---
211
185
212
186
## What changes after this skill runs
@@ -236,8 +210,8 @@ machine.
236
210
237
211
| Symptom | Cause | Recovery |
238
212
|---|---|---|
239
-
|`lemonade: command not found`|Server CLI not installed |Install from <https://lemonade-server.ai/install_options.html>; restart shell. |
240
-
|`Server is not running`| Service stopped after install |Windows: launch the **Lemonade** Start Menu shortcut. Linux: `sudo systemctl start lemonade-server`. |
213
+
|`lemonade: command not found`| CLI not installed |Re-run `python scripts/setup_local_ai.py` (auto-installs the full version). If it just installed on Windows, open a new shell so the user PATH refreshes, or the script will find it under `%LOCALAPPDATA%\lemonade_server`. |
214
+
|`Server is not running`| Service stopped after install |Run `lemonade serve` (the setup script launches it for you). |
241
215
|`POST /v1/images/generations` returns 404 model not found | Image model not downloaded |`lemonade pull SD-Turbo` and retry. |
242
216
| Image generation is slow on CPU (~4–5 min) | sd-cpp on CPU backend | Install the GPU backend on supported AMD hardware: `lemonade backends install sd-cpp:rocm`. |
243
217
|`POST /v1/audio/transcriptions` returns 400 unsupported format | Input is not 16 kHz mono WAV | Re-encode with `ffmpeg -i in.* -ar 16000 -ac 1 out.wav`. |
@@ -249,14 +223,11 @@ machine.
249
223
Mark this skill complete only when **all** of the following are true:
250
224
251
225
-[ ]`lemonade status --json` reports the server running on port 13305.
252
-
-[ ]`lemonade list --downloaded` shows `SD-Turbo`, `kokoro-v1`, and
253
-
`Whisper-Tiny`.
254
226
-[ ] The workspace `AGENTS.md` contains the
255
227
`amd-skills:local-ai-use` block.
256
-
-[ ] All three smoke tests in Step 4 succeed.
257
228
-[ ] On a follow-up turn, asking the agent to "generate an image of X"
258
229
causes it to POST to `http://localhost:13305/api/v1/images/generations`
259
-
rather than calling a cloud tool.
230
+
(pulling the model on first use) rather than calling a cloud tool.
260
231
261
232
If any box is unchecked, the user is still paying cloud cost for at least
0 commit comments