Tariq HussainHere's what we're deploying to Site 12. Quad-core ARM Cortex-A53, 512MB RAM, 4GB eMMC storage, powered by a solar panel. It needs to run 24/7 on about 5 watts. Your model has to fit in this.
You test your web applications on low-end devices. You know the pain of a React app that runs beautifully on your M2 MacBook but crawls on a budget Android phone. Edge ML has the same problem, amplified.
// Low-end: 2GB RAM, slow CPU
// Must test on real constraints// Gateway: 512MB RAM, ARM Cortex-A53
// Must profile on real hardwareIn frontend development, you maintain a device testing matrix — the range of devices your application must support. Edge ML requires the same discipline. You need to know your target hardware intimately.
interface EdgeDevice {
name: string;
ramMB: number;
cpuCores: number;
cpuArch: 'arm64' | 'x86_64';
storageMB: number;
powerWatts: number;
}
const terraGateway: EdgeDevice = {
name: 'Terra Gateway v3',
ramMB: 512,
cpuCores: 4,
cpuArch: 'arm64',
storageMB: 4096,
powerWatts: 5
};
function canDeployModel(
device: EdgeDevice,
modelSizeMB: number,
modelRamMB: number
): { fits: boolean; reason?: string } {
if (modelRamMB > device.ramMB * 0.6) {
return { fits: false, reason: `Model needs ${modelRamMB}MB RAM, device budget is ${Math.floor(device.ramMB * 0.6)}MB (60% of ${device.ramMB}MB)` };
}
if (modelSizeMB > device.storageMB * 0.25) {
return { fits: false, reason: `Model is ${modelSizeMB}MB, storage budget is ${Math.floor(device.storageMB * 0.25)}MB` };
}
return { fits: true };
}
// Check: can a 200MB model using 400MB RAM deploy?
console.log(canDeployModel(terraGateway, 200, 400));
// { fits: false, reason: "Model needs 400MB RAM, device budget is 307MB..." }The 60% rule: never allocate more than 60% of device RAM to your model. The OS, sensor drivers, and communication stack need the rest. Sound familiar? It is the same principle as keeping your JavaScript bundle under your performance budget — leave headroom for the browser.
Determine whether given models fit within edge device constraints.
Write a function canDeploy(deviceRamMB, modelRamMB) that returns true if the model fits within 60% of the device RAM. The model must not exceed 60% of available RAM to leave room for the OS and drivers.
function canDeploy(deviceRamMB, modelRamMB) { // Model must fit within 60% of device RAM return null; // your code here }
You now understand exactly what hardware your models must run on.
Next: building your first edge model