Script for easily configuring, using, switching and comparing local offline coding models
1import { platform, arch, totalmem } from "node:os";
2import { log, warn, err } from "../log.js";
3
4export function checkPreflight(): void {
5 if (platform() !== "darwin") {
6 err("This script is for macOS only.");
7 }
8
9 if (arch() !== "arm64") {
10 warn("Not running on Apple Silicon — performance may vary.");
11 }
12
13 const memGB = Math.floor(totalmem() / 1073741824);
14 if (memGB < 32) {
15 warn(
16 `You have ${memGB}GB RAM. The 32B model needs ~20GB; you may experience swapping.`,
17 );
18 }
19}