offgrid-ai 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.mjs +20 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "offgrid-ai",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
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",
package/src/cli.mjs CHANGED
@@ -589,23 +589,23 @@ async function onboardFlow() {
589
589
  console.log(pc.dim("You need at least one model backend to use offgrid-ai.\n"));
590
590
 
591
591
  const backendChoice = await prompt.choice("Install a model backend?", [
592
- { value: "ollama", label: "Ollama", hint: "Easiest way — models download on demand" },
593
- { value: "lmstudio", label: "LM Studio", hint: "Visual model browser (opens download page)" },
594
- { value: "omlx", label: "oMLX", hint: "Apple Silicon optimized" },
592
+ { value: "ollama", label: "Ollama", hint: "brew install ollama — models download on demand" },
593
+ { value: "lmstudio", label: "LM Studio", hint: "brew install --cask lm-studio visual model browser" },
594
+ { value: "omlx", label: "oMLX", hint: "brew tap jundot/omlx && brew install omlx — Apple Silicon optimized" },
595
595
  { value: "skip", label: "Skip for now", hint: "I'll set up models myself" },
596
596
  ], "ollama");
597
597
 
598
+ const { execFile } = await import("node:child_process");
599
+ const { promisify } = await import("node:util");
600
+
598
601
  if (backendChoice === "ollama") {
599
602
  console.log(pc.cyan("Installing Ollama via Homebrew..."));
600
- const { execFile } = await import("node:child_process");
601
- const { promisify } = await import("node:util");
602
603
  try {
603
604
  await promisify(execFile)("brew", ["install", "ollama"], { stdio: "inherit" });
604
605
  console.log(pc.green("✓ Ollama installed"));
605
606
  console.log(pc.cyan("\nStarting Ollama..."));
606
607
  try {
607
608
  await promisify(execFile)("ollama", ["serve"], { stdio: "ignore", detached: true });
608
- // Give it a moment to start
609
609
  await new Promise((resolve) => setTimeout(resolve, 2000));
610
610
  } catch { /* may already be running */ }
611
611
  console.log(pc.green("Ollama is running."));
@@ -617,22 +617,27 @@ async function onboardFlow() {
617
617
  console.log(pc.dim("Install it manually from https://ollama.com"));
618
618
  }
619
619
  } else if (backendChoice === "lmstudio") {
620
- console.log(pc.cyan("LM Studio needs to be installed manually."));
621
- console.log(pc.bold("\n Download LM Studio: https://lmstudio.ai"));
622
- console.log(pc.dim("Then browse and download models inside LM Studio, and run offgrid-ai again."));
620
+ console.log(pc.cyan("Installing LM Studio via Homebrew..."));
621
+ try {
622
+ await promisify(execFile)("brew", ["install", "--cask", "lm-studio"], { stdio: "inherit" });
623
+ console.log(pc.green("✓ LM Studio installed"));
624
+ console.log(pc.yellow("\nOpen LM Studio to browse and download models, then run offgrid-ai again."));
625
+ } catch (err) {
626
+ console.log(pc.red(`Failed to install LM Studio: ${err.message}`));
627
+ console.log(pc.dim("Download it manually from https://lmstudio.ai"));
628
+ }
623
629
  } else if (backendChoice === "omlx") {
624
- console.log(pc.cyan("Installing oMLX via pip..."));
625
- const { execFile } = await import("node:child_process");
626
- const { promisify } = await import("node:util");
630
+ console.log(pc.cyan("Installing oMLX via Homebrew..."));
627
631
  try {
628
- await promisify(execFile)("pip3", ["install", "omlx"], { stdio: "inherit" });
632
+ await promisify(execFile)("brew", ["tap", "jundot/omlx", "https://github.com/jundot/omlx"], { stdio: "inherit" });
633
+ await promisify(execFile)("brew", ["install", "omlx"], { stdio: "inherit" });
629
634
  console.log(pc.green("✓ oMLX installed"));
630
635
  console.log(pc.yellow("\nStart oMLX server:"));
631
- console.log(pc.bold(" omlx serve"));
636
+ console.log(pc.bold(" omlx start"));
632
637
  console.log(pc.dim("Then run offgrid-ai again to pick and run a model."));
633
638
  } catch (err) {
634
639
  console.log(pc.red(`Failed to install oMLX: ${err.message}`));
635
- console.log(pc.dim("Install it manually: pip3 install omlx"));
640
+ console.log(pc.dim("Install it manually: brew tap jundot/omlx && brew install omlx"));
636
641
  }
637
642
  } else {
638
643
  console.log(pc.dim("Run offgrid-ai again when you've set up a model backend."));