offgrid-ai 0.6.5 → 0.6.7
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 +1 -1
- package/install.sh +1 -1
- package/package.json +4 -2
- package/src/autodetect.mjs +7 -8
- package/src/backend-installers.mjs +57 -0
- package/src/backends.mjs +20 -10
- package/src/cli.mjs +12 -1238
- package/src/commands/benchmark.mjs +4 -0
- package/src/commands/main.mjs +89 -0
- package/src/commands/models.mjs +170 -0
- package/src/commands/onboard.mjs +177 -0
- package/src/commands/run.mjs +146 -0
- package/src/commands/status.mjs +38 -0
- package/src/commands/stop.mjs +64 -0
- package/src/commands/uninstall.mjs +96 -0
- package/src/exec.mjs +31 -0
- package/src/managed.mjs +31 -0
- package/src/model-catalog.mjs +58 -0
- package/src/model-presenters.mjs +190 -0
- package/src/model-summary.mjs +61 -0
- package/src/profile-setup.mjs +20 -13
- package/src/profiles.mjs +6 -13
- package/src/recommendations.mjs +17 -0
- package/src/scan.mjs +2 -21
package/README.md
CHANGED
package/install.sh
CHANGED
|
@@ -107,7 +107,7 @@ fi
|
|
|
107
107
|
|
|
108
108
|
echo ""
|
|
109
109
|
printf "${BOLD}Installing offgrid-ai...${RESET}\n"
|
|
110
|
-
dry npm install -g offgrid-ai
|
|
110
|
+
dry npm install -g offgrid-ai@latest --prefer-online
|
|
111
111
|
|
|
112
112
|
# ── Dry-run early exit ──────────────────────────────────────────────────────
|
|
113
113
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "offgrid-ai",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "Privacy-first CLI for running local LLMs — discover, configure, run, benchmark",
|
|
5
5
|
"author": "Eeshan Srivastava (https://eeshans.com)",
|
|
6
6
|
"type": "module",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"bin/*.mjs",
|
|
12
12
|
"src/*.mjs",
|
|
13
|
+
"src/commands/*.mjs",
|
|
13
14
|
"install.sh"
|
|
14
15
|
],
|
|
15
16
|
"publishConfig": {
|
|
@@ -29,7 +30,8 @@
|
|
|
29
30
|
"scripts": {
|
|
30
31
|
"start": "node bin/offgrid-ai.mjs",
|
|
31
32
|
"test": "node --test test/*.mjs",
|
|
32
|
-
"
|
|
33
|
+
"test:integration": "OFFGRID_INTEGRATION=1 node --test test/integration/*.mjs",
|
|
34
|
+
"lint": "eslint src/*.mjs src/commands/*.mjs bin/*.mjs",
|
|
33
35
|
"check:privacy": "node scripts/privacy-gate.mjs",
|
|
34
36
|
"release:check": "bash scripts/release-check.sh",
|
|
35
37
|
"release:check:fast": "bash scripts/release-check.sh --skip-install --skip-manual",
|
package/src/autodetect.mjs
CHANGED
|
@@ -73,14 +73,13 @@ export function computeFlags(capabilities, modelPath, mmprojPath, draftModelPath
|
|
|
73
73
|
flags.chatTemplateKwargs = { enable_thinking: true };
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
// Build argv
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
if (draftModelPath && !hfRef) argv.push("--spec-draft-model", draftModelPath);
|
|
76
|
+
// Build argv
|
|
77
|
+
const argv = [
|
|
78
|
+
"--model", modelPath,
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
if (mmprojPath) argv.push("--mmproj", mmprojPath);
|
|
82
|
+
if (draftModelPath) argv.push("--spec-draft-model", draftModelPath);
|
|
84
83
|
|
|
85
84
|
argv.push(
|
|
86
85
|
"--host", String(flags.host),
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { pc } from "./ui.mjs";
|
|
2
|
+
|
|
3
|
+
export const BACKEND_INSTALLERS = {
|
|
4
|
+
lmstudio: {
|
|
5
|
+
label: "LM Studio",
|
|
6
|
+
choiceLabel: "LM Studio (recommended)",
|
|
7
|
+
hint: "brew install --cask lm-studio — visual model browser + CLI",
|
|
8
|
+
commands: [["brew", ["install", "--cask", "lm-studio"], "LM Studio"]],
|
|
9
|
+
success(model) {
|
|
10
|
+
console.log(pc.green("✓ LM Studio installed"));
|
|
11
|
+
console.log(pc.yellow("\nOpen LM Studio and download a model to get started."));
|
|
12
|
+
console.log(pc.dim(`Recommended for your machine: ${model.label}`));
|
|
13
|
+
console.log(pc.dim("Then run offgrid-ai again to pick and run a model."));
|
|
14
|
+
},
|
|
15
|
+
failure: "Download it manually from https://lmstudio.ai",
|
|
16
|
+
allFailure: "✗ LM Studio installation failed. Download from https://lmstudio.ai",
|
|
17
|
+
},
|
|
18
|
+
ollama: {
|
|
19
|
+
label: "Ollama",
|
|
20
|
+
choiceLabel: "Ollama",
|
|
21
|
+
hint: "brew install ollama — models download on demand",
|
|
22
|
+
commands: [["brew", ["install", "ollama"], "Ollama"]],
|
|
23
|
+
success(model) {
|
|
24
|
+
console.log(pc.green("✓ Ollama installed"));
|
|
25
|
+
console.log(pc.yellow("\nStart Ollama and pull a model:"));
|
|
26
|
+
console.log(pc.bold(` ollama serve & ollama pull ${model.ollama}`));
|
|
27
|
+
console.log(pc.dim(`Recommended for your machine: ${model.label}`));
|
|
28
|
+
console.log(pc.dim("Then run offgrid-ai again to pick and run a model."));
|
|
29
|
+
},
|
|
30
|
+
failure: "Install it manually from https://ollama.com",
|
|
31
|
+
allFailure: "✗ Ollama installation failed. Install manually from https://ollama.com",
|
|
32
|
+
},
|
|
33
|
+
omlx: {
|
|
34
|
+
label: "oMLX",
|
|
35
|
+
choiceLabel: "oMLX",
|
|
36
|
+
hint: "brew tap jundot/omlx && brew install omlx — Apple Silicon optimized",
|
|
37
|
+
commands: [
|
|
38
|
+
["brew", ["tap", "jundot/omlx", "https://github.com/jundot/omlx"], "oMLX tap"],
|
|
39
|
+
["brew", ["install", "omlx"], "oMLX"],
|
|
40
|
+
],
|
|
41
|
+
success(model) {
|
|
42
|
+
console.log(pc.green("✓ oMLX installed"));
|
|
43
|
+
console.log(pc.yellow("\nStart oMLX and download a model:"));
|
|
44
|
+
console.log(pc.bold(" omlx start"));
|
|
45
|
+
console.log(pc.dim(`Recommended for your machine: ${model.label}`));
|
|
46
|
+
console.log(pc.dim("Then run offgrid-ai again to pick and run a model."));
|
|
47
|
+
},
|
|
48
|
+
failure: "Install manually: brew tap jundot/omlx && brew install omlx",
|
|
49
|
+
allFailure: "✗ oMLX installation failed. Install manually: brew tap jundot/omlx && brew install omlx",
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const BACKEND_INSTALL_CHOICES = [
|
|
54
|
+
...Object.entries(BACKEND_INSTALLERS).map(([value, installer]) => ({ value, label: installer.choiceLabel, hint: installer.hint })),
|
|
55
|
+
{ value: "all", label: "Install all three", hint: "LM Studio + Ollama + oMLX" },
|
|
56
|
+
{ value: "skip", label: "Skip for now", hint: "I'll set up models myself" },
|
|
57
|
+
];
|
package/src/backends.mjs
CHANGED
|
@@ -117,16 +117,18 @@ async function scanOmlxModels() {
|
|
|
117
117
|
if (!response.ok) return [];
|
|
118
118
|
const body = await response.json();
|
|
119
119
|
if (!Array.isArray(body?.data)) return [];
|
|
120
|
-
return body.data
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
120
|
+
return body.data
|
|
121
|
+
.filter((model) => isChatOmlxModel(model))
|
|
122
|
+
.map((model) => ({
|
|
123
|
+
id: model.id,
|
|
124
|
+
label: omlxLabel(model.id),
|
|
125
|
+
aliasSuggestion: model.id,
|
|
126
|
+
sizeBytes: 0,
|
|
127
|
+
quant: null,
|
|
128
|
+
family: null,
|
|
129
|
+
backend: "omlx",
|
|
130
|
+
source: "omlx",
|
|
131
|
+
})).sort((a, b) => a.label.localeCompare(b.label));
|
|
130
132
|
} catch {
|
|
131
133
|
return [];
|
|
132
134
|
}
|
|
@@ -141,6 +143,14 @@ function isLocalOllamaModel(model) {
|
|
|
141
143
|
return true;
|
|
142
144
|
}
|
|
143
145
|
|
|
146
|
+
function isChatOmlxModel(model) {
|
|
147
|
+
if (typeof model?.id !== "string" || !model.id.trim()) return false;
|
|
148
|
+
const type = String(model.type ?? model.model_type ?? "").toLowerCase();
|
|
149
|
+
if (["embedding", "embeddings", "reranker", "tool", "converter"].includes(type)) return false;
|
|
150
|
+
if (Object.hasOwn(model, "max_model_len") && model.max_model_len === null) return false;
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
|
|
144
154
|
function ollamaLabel(name) {
|
|
145
155
|
return name.replace(/[-_]/g, " ").replace(/^gemma\b/i, "Gemma").replace(/^qwen/i, "Qwen");
|
|
146
156
|
}
|