preppergpt 0.1.3 → 0.1.4
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 +12 -6
- package/installer/cli.mjs +12 -3
- package/installer/lib/detect.mjs +39 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,11 +18,17 @@ target scenario is no assistant at all.
|
|
|
18
18
|
|
|
19
19
|
## Install
|
|
20
20
|
|
|
21
|
-
Install from npm:
|
|
21
|
+
Install and start from npm in one command:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npx preppergpt install --profile balanced
|
|
25
|
-
|
|
24
|
+
npx --yes preppergpt install --profile balanced --start
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or use two commands:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx --yes preppergpt install --profile balanced
|
|
31
|
+
npx --yes preppergpt start
|
|
26
32
|
```
|
|
27
33
|
|
|
28
34
|
Or install globally:
|
|
@@ -48,8 +54,8 @@ integration, and run the npm or GitHub install commands inside the WSL2 shell.
|
|
|
48
54
|
Other profiles:
|
|
49
55
|
|
|
50
56
|
```bash
|
|
51
|
-
preppergpt install --profile intelligence
|
|
52
|
-
preppergpt install --profile speed
|
|
57
|
+
npx --yes preppergpt install --profile intelligence
|
|
58
|
+
npx --yes preppergpt install --profile speed
|
|
53
59
|
```
|
|
54
60
|
|
|
55
61
|
Open the app at:
|
|
@@ -66,7 +72,7 @@ Change them before exposing the machine to any network.
|
|
|
66
72
|
```bash
|
|
67
73
|
preppergpt detect
|
|
68
74
|
preppergpt plan --profile balanced
|
|
69
|
-
preppergpt install --profile balanced
|
|
75
|
+
preppergpt install --profile balanced --start
|
|
70
76
|
preppergpt start
|
|
71
77
|
preppergpt stop
|
|
72
78
|
preppergpt status
|
package/installer/cli.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { packageRoot, runtimePaths } from "./lib/paths.mjs";
|
|
|
7
7
|
import { renderInstall } from "./lib/render.mjs";
|
|
8
8
|
import { commandResult, parseArgs, readJson, shellQuote } from "./lib/util.mjs";
|
|
9
9
|
|
|
10
|
-
const VERSION = "0.1.
|
|
10
|
+
const VERSION = "0.1.4";
|
|
11
11
|
|
|
12
12
|
function usage() {
|
|
13
13
|
return `PrepperGPT ${VERSION}
|
|
@@ -15,7 +15,7 @@ function usage() {
|
|
|
15
15
|
Usage:
|
|
16
16
|
preppergpt detect [--json]
|
|
17
17
|
preppergpt plan --profile balanced|intelligence|speed [--json]
|
|
18
|
-
preppergpt install --profile balanced|intelligence|speed [--dry-run] [--skip-bundles] [--home PATH]
|
|
18
|
+
preppergpt install --profile balanced|intelligence|speed [--start] [--dry-run] [--skip-bundles] [--home PATH]
|
|
19
19
|
preppergpt start [--home PATH]
|
|
20
20
|
preppergpt stop [--home PATH]
|
|
21
21
|
preppergpt status [--home PATH] [--json]
|
|
@@ -138,6 +138,9 @@ async function commandInstall(flags) {
|
|
|
138
138
|
const plan = buildPlan(detection, profileFrom(flags));
|
|
139
139
|
if (flags.dry_run) {
|
|
140
140
|
printPlan(plan);
|
|
141
|
+
if (flags.start) {
|
|
142
|
+
console.log("\nWould start PrepperGPT after install.");
|
|
143
|
+
}
|
|
141
144
|
console.log("\nDry run only. No files written.");
|
|
142
145
|
return;
|
|
143
146
|
}
|
|
@@ -150,8 +153,14 @@ async function commandInstall(flags) {
|
|
|
150
153
|
console.log(`Wrote ${paths.envFile}`);
|
|
151
154
|
console.log(`Wrote ${paths.generatedCompose}`);
|
|
152
155
|
console.log(`Wrote ${paths.modelPlan}`);
|
|
156
|
+
if (flags.start) {
|
|
157
|
+
runCompose(paths, ["up", "-d"]);
|
|
158
|
+
console.log("\nPrepperGPT start requested.");
|
|
159
|
+
console.log("Open http://127.0.0.1:8080");
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
153
162
|
console.log("\nNext:");
|
|
154
|
-
console.log(` preppergpt start --home ${shellQuote(paths.root)}`);
|
|
163
|
+
console.log(` npx --yes preppergpt start --home ${shellQuote(paths.root)}`);
|
|
155
164
|
console.log(" Open http://127.0.0.1:8080");
|
|
156
165
|
}
|
|
157
166
|
|
package/installer/lib/detect.mjs
CHANGED
|
@@ -263,6 +263,43 @@ function detectAmdRocinfoGpus() {
|
|
|
263
263
|
}));
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
export function parseLspciMachineLine(line) {
|
|
267
|
+
const fields = [];
|
|
268
|
+
const pattern = /"([^"]*)"|(\S+)/g;
|
|
269
|
+
let match = pattern.exec(line);
|
|
270
|
+
while (match) {
|
|
271
|
+
fields.push(match[1] ?? match[2]);
|
|
272
|
+
match = pattern.exec(line);
|
|
273
|
+
}
|
|
274
|
+
return fields;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function isDisplayController(value) {
|
|
278
|
+
return /^(VGA compatible controller|3D controller|Display controller)$/i.test(value || "");
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function isAmdVendor(value) {
|
|
282
|
+
return /\b(Advanced Micro Devices|AMD|AMD\/ATI|ATI Technologies)\b/i.test(value || "");
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export function amdPciGpuFromLspciLine(line, index = 0) {
|
|
286
|
+
const fields = parseLspciMachineLine(line);
|
|
287
|
+
const [, className, vendor, device] = fields;
|
|
288
|
+
if (!isDisplayController(className) || !isAmdVendor(vendor)) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
index,
|
|
293
|
+
vendor: "amd",
|
|
294
|
+
runtime: "none",
|
|
295
|
+
name: [vendor, device].filter(Boolean).join(" ").trim() || "AMD GPU",
|
|
296
|
+
totalVramGb: null,
|
|
297
|
+
freeVramGb: null,
|
|
298
|
+
usableVramGb: null,
|
|
299
|
+
driver: ""
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
266
303
|
function detectAmdPciGpus() {
|
|
267
304
|
if (!commandExists("lspci")) {
|
|
268
305
|
return [];
|
|
@@ -273,17 +310,8 @@ function detectAmdPciGpus() {
|
|
|
273
310
|
}
|
|
274
311
|
return result.stdout
|
|
275
312
|
.split(/\n/)
|
|
276
|
-
.
|
|
277
|
-
.
|
|
278
|
-
index,
|
|
279
|
-
vendor: "amd",
|
|
280
|
-
runtime: "none",
|
|
281
|
-
name: line.replace(/^\S+\s+/, "").replaceAll('"', "").trim() || "AMD GPU",
|
|
282
|
-
totalVramGb: null,
|
|
283
|
-
freeVramGb: null,
|
|
284
|
-
usableVramGb: null,
|
|
285
|
-
driver: ""
|
|
286
|
-
}));
|
|
313
|
+
.map((line, index) => amdPciGpuFromLspciLine(line, index))
|
|
314
|
+
.filter(Boolean);
|
|
287
315
|
}
|
|
288
316
|
|
|
289
317
|
function dedupeGpus(gpus) {
|