import { ensureOllama, pullModel, recommendModel } from "@agentium/edge";
import * as os from "node:os";
// Ensure Ollama is running (starts it if needed)
const status = await ensureOllama();
console.log(status);
// { running: true, version: "0.1.0", models: ["tinyllama:1.1b"] }
// Get the best model for available RAM
const ramMb = os.totalmem() / 1024 / 1024;
const rec = recommendModel(ramMb);
console.log(rec);
// { model: "phi3:mini", label: "capable", parameterSize: "3.8B", ramRequired: 4000 }
// Pull the model if not cached
await pullModel(rec.model);