{"slug": "compare-cloud-and-on-device-ai-costs-without-inventing-energy-numbers", "title": "Compare Cloud and On-Device AI Costs Without Inventing Energy Numbers", "summary": "A developer proposes a rigorous methodology for comparing cloud and on-device AI costs, emphasizing separate measurement of latency, network transfer, provider spend, and device energy rather than collapsing them into a single metric. The approach includes a detailed CSV template and test pipeline, with a synthetic sample dataset demonstrating the refusal to report energy without measured joules. The developer, a contributor to the MonkeyCode project, stresses that no actual device benchmark is claimed.", "body_md": "“On-device AI saves battery” and “cloud AI is more efficient” can both sound plausible. Neither is a measurement.\n\nThe placement decision crosses at least four different budgets:\n\n```\nuser wait + network transfer + provider spend + device energy\n```\n\nDo not collapse them into one vague “cost” number. Measure each with its own unit and evidence boundary.\n\nI reviewed [MonkeyCode](https://github.com/chaitin/MonkeyCode) mobile code at commit [ c58bcd4](https://github.com/chaitin/MonkeyCode/tree/c58bcd4dd4b7031f469a1271f276d22550b8f523). The\n\nThat reviewed path is not evidence of on-device model inference. So a fair current study would measure a mobile client using remote task and voice services. An on-device alternative would be a separate prototype with its model, runtime, and packaging declared.\n\nThe included CSV template begins with these fields:\n\n```\nsample_id,sample_kind,placement,device,os,framework,model,network,input_tokens,output_tokens,latency_ms,bytes_up,bytes_down,energy_joules,cost_usd\n```\n\nWhy so many?\n\n`device`\n\n, `os`\n\n, and `framework`\n\nmake thermal and runtime results interpretable;`model`\n\nand token counts keep workload size visible;`network`\n\nseparates offline, Wi-Fi, and cellular behavior;`sample_kind`\n\nprevents synthetic examples from masquerading as device measurements.Battery percentage is too coarse for short runs. It is affected by display, radio, background work, battery health, temperature, and OS estimation. If you cannot collect energy with an appropriate platform profiler or external power measurement, leave `energy_joules`\n\nempty.\n\nCompare the same tasks, not unrelated model demos:\n\n| Flow | Cloud case | On-device case |\n|---|---|---|\n| Short prompt | Same input and output cap | Same semantic task and cap |\n| Voice turn | Same audio fixture | Same audio fixture |\n| Offline | Expected failure or queued action | Local completion if supported |\n| Background/resume | Declared lifecycle | Declared lifecycle |\n| Thermal loop | Repeated fixed workload | Repeated fixed workload |\n\nWarm-up should be reported separately. Randomize case order, control display state and temperature, repeat enough times to show a distribution, and record failures rather than deleting them.\n\nThe companion `synthetic-samples.csv`\n\nis explicitly labeled synthetic. Its numbers exist only to test parsing and summary behavior.\n\nRun:\n\n```\nnode analyze-costs.mjs synthetic-samples.csv\nnode test-analysis.mjs\n```\n\nThe report includes:\n\n```\n{\n  \"dataset\": \"synthetic\",\n  \"samples\": 3,\n  \"mean_latency_ms\": 987,\n  \"total_network_bytes\": 66100,\n  \"total_cost_usd\": 0.0084,\n  \"energy_conclusion\": \"REFUSED: energy requires measured joules for every row\"\n}\n```\n\nThose latency, transfer, and cost values are **synthetic test output**, not a MonkeyCode benchmark, a phone benchmark, or evidence that one placement wins.\n\nThe test then supplies measured-labeled rows with joule values and confirms that an energy summary becomes possible. In a real pipeline, provenance should be stronger than a label: ingest profiler exports, preserve raw files, and attach the collection command and timestamp.\n\nA release decision can now be explicit:\n\nAn on-device model can remove provider calls while adding download size, RAM pressure, thermal load, and model-update work. A cloud model can reduce device compute while adding radio use, service dependency, and data transfer. Units keep those tradeoffs honest.\n\nDisclosure: I contribute to the MonkeyCode project. The product observations are source-based and limited to the linked paths at commit\n\n`c58bcd4`\n\n. All included sample data is synthetic; no device energy, latency, or cost benchmark is claimed.", "url": "https://wpnews.pro/news/compare-cloud-and-on-device-ai-costs-without-inventing-energy-numbers", "canonical_source": "https://dev.to/roronoa_/compare-cloud-and-on-device-ai-costs-without-inventing-energy-numbers-gdb", "published_at": "2026-07-14 06:18:41+00:00", "updated_at": "2026-07-14 06:31:32.372989+00:00", "lang": "en", "topics": ["artificial-intelligence", "developer-tools", "ai-infrastructure"], "entities": ["MonkeyCode"], "alternates": {"html": "https://wpnews.pro/news/compare-cloud-and-on-device-ai-costs-without-inventing-energy-numbers", "markdown": "https://wpnews.pro/news/compare-cloud-and-on-device-ai-costs-without-inventing-energy-numbers.md", "text": "https://wpnews.pro/news/compare-cloud-and-on-device-ai-costs-without-inventing-energy-numbers.txt", "jsonld": "https://wpnews.pro/news/compare-cloud-and-on-device-ai-costs-without-inventing-energy-numbers.jsonld"}}