On Device Ai

On-Device AI: The Operating Layer Most Teams Skip

On-device AI runs machine-learning models on phones, browsers, laptops, and edge hardware instead of in the cloud. Here's what it changes — privacy, cost, latency, offline access — and what it takes to actually ship it.

On-device AI runs machine-learning models — including large language models — directly on the user’s phone, browser, laptop, or edge hardware, instead of in the cloud. It cuts inference latency to milliseconds, eliminates per-request API spend, keeps user data on the device, and works offline. What makes it hard isn’t the model — it’s the operating layer underneath: packaging, runtime selection, staged rollout, fallback, and monitoring across thousands of devices at once.

This post is the long form of that paragraph. It covers what on-device AI actually means in 2026, where it’s a fit and where it isn’t, and what changes about the way you build and deploy a product when inference moves to the edge.


What does on-device AI mean, exactly?

The shortest definition: the model runs where the user is, on the user’s hardware, without a round-trip to a cloud inference API.

In practice that covers a wider set of architectures than most discussions acknowledge:

  • On the phone. iOS via CoreML or LiteRT, Android via TFLite, Mediapipe, or LiteRT. Common targets: 1B–8B parameter LLMs, vision models, speech-to-text.
  • In the browser. WebAssembly + WebGPU runtimes like onnxruntime-web or transformers.js. Common targets: small classifiers, embedding models, 1B–3B parameter LLMs (slowly).
  • On the laptop. llama.cpp, MLX on Apple Silicon, ONNX Runtime on Windows / Linux, ExecuTorch. Common targets: 3B–70B parameter LLMs depending on RAM.
  • On the edge. NVIDIA Jetson, Coral, Hailo, Qualcomm AI Engines. Common targets: vision pipelines, robotics, real-time inference on physically deployed hardware.

What unites these targets is the operating model: the model file lives on the device, the inference engine runs in the same process as the application, and prompts never leave the local machine (unless the app explicitly opts into a cloud fallback).


Why on-device AI matters in 2026

Search interest for “on-device ai” is up 84% year-over-year — and “edge ai deployment” is up 400% on a small base. Four forces converge:

  • Model efficiency improvements. Llama 3.2 1B, Phi-4-mini, Gemma 2 2B, and the latest quantized variants of larger families now produce useful output on hardware that fits in a phone. The 2024–2025 wave of small-but-capable models was the unlock.
  • Cloud inference costs at production scale. API spend at $10–$30 per 1M output tokens compounds fast when an app starts seeing real traction. Teams that shipped chat features on cloud APIs in 2023 are running the math again in 2026.
  • Privacy and regulatory pressure. California AB 3030 (effective January 2025) requires healthcare facilities to disclose generative AI use that handles patient data. The EU AI Act, HIPAA’s Privacy Rule, and product-level commitments to data minimization push teams to keep raw user content off centralized servers when they can.
  • The “platform tax” of always-online AI. Cloud-only inference means every feature degrades on a flaky train, an airplane, a remote site, or a bandwidth-capped region. Local inference is the only way to make AI feel like a built-in capability rather than a network-dependent service.

The growth isn’t a hype curve. It’s a re-architecture wave.


What on-device AI changes about your product

Moving inference to the device flips several defaults at once:

  • Latency drops by an order of magnitude. A 4ms p99 on-device inference replaces a 200–800ms cloud round-trip. Voice interfaces, autocomplete, predictive UI, and real-time editors stop feeling like they’re “talking to a server.”
  • Per-request cost goes to zero. You amortize one model download against an unlimited number of inferences. Cloud APIs at $10/M output tokens disappear from the cost stack for the workloads that fit on-device.
  • Privacy posture inverts. Prompts, documents, voice clips, photos — none of it leaves the user’s device. Your security review goes from “we encrypt in transit and at rest” to “we don’t transmit the content at all.”
  • Offline becomes a feature instead of a failure mode. The app keeps working on planes, in subways, in regulated environments where outbound network traffic is blocked, and during cloud-provider outages.
  • Some things get harder. Model updates, A/B tests, feature flags, regression detection, and capability gating all need to work across a fleet of devices instead of one cloud cluster. The infrastructure that handled that for cloud inference doesn’t apply.

The first four bullets are the upside. The fifth is the work — and it’s the part most teams underestimate.


Where on-device AI is a fit, and where it isn’t

A useful sorting heuristic:

DecisionLean on-deviceLean cloud
Latency target< 100ms required1–5s acceptable
Model size needed< 8B params (Q4)30B+ params
Data sensitivityPHI, PII, IP, voicePublic content
Network reliabilityOften offlineAlways online
Workload economicsHigh request volume per userBursty, low-volume
PersonalizationPer-user fine-tune usefulSingle global model
Frequency of model updatesMonthly+Daily+

The honest answer for most production apps in 2026 is hybrid: routine, latency-sensitive, privacy-bound traffic stays on-device, and the long tail of complex queries falls back to a cloud model when the on-device model can’t handle them. That’s the architecture we built Octomil’s routing layer around — it’s the hard part to get right.


What it actually takes to ship on-device AI

The model is the easy half. The hard half is everything around it. A production on-device deployment needs all of:

  • Model conversion and quantization. PyTorch checkpoints don’t run on phones. Conversion to CoreML, LiteRT, ONNX, or platform-native formats, plus quantization (Q4_K_M, Q5, INT8) that balances size and quality, is per-model and per-platform work.
  • Runtime selection. llama.cpp on x86 and CUDA, MLX on Apple Silicon, CoreML on iOS, LiteRT on Android, MediaPipe for some vision workloads, ExecuTorch for newer mobile setups. The right runtime depends on hardware, model, and the latency target.
  • Packaging and distribution. A 2 GB model file can’t ship inside the app bundle in the App Store. You need over-the-air model delivery, integrity verification, and graceful handling of partial downloads.
  • Staged rollout. When you ship a new model version, you don’t ship it to everyone at once. Canary on 1–10%, watch the quality and crash metrics, expand to 25%, 50%, 100%. The same shape of rollout infrastructure that exists for code, but for model weights.
  • Cloud fallback policy. When a request hits the on-device path and the model can’t handle it (too large a context, an unsupported feature, a hardware constraint), you fall back to a cloud API. That fallback needs a policy — when does it fire, who pays for it, how does it surface to users.
  • Fleet observability. Inference latency, crash rates, memory pressure, battery impact, and quality regressions — measured across thousands or millions of devices, aggregated without exfiltrating raw prompts.
  • Audit and review posture. When a deployment is HIPAA-sensitive, EU-AI-Act-regulated, or under enterprise security review, you need the audit trail to show what model ran where, when, with what configuration, against what cohort.

This is the operating layer most teams skip. It’s also why most on-device AI projects either stall at “we got a model running on one phone” or grow into ad-hoc infrastructure that becomes its own product to maintain. The work is real — but it doesn’t have to be greenfield every time. Octomil is the control plane for exactly this work.


On-device AI on each platform

A condensed snapshot of what’s possible per platform as of mid-2026:

  • iOS / iPadOS / macOS. CoreML is the highest-performance path on Apple Silicon (M-series and A17+). Up to 70B parameter LLMs with enough RAM. Apple Intelligence frameworks integrate cleanly. MLX is the open-source alternative for research-style workflows. See our CoreML deployment guide.
  • Android. LiteRT (formerly TFLite) is the canonical path. MediaPipe wraps it for common vision and audio workloads. Qualcomm AI Engine and ML acceleration on newer SoCs make 1–3B parameter LLMs realistic on flagship phones. NPU dispatch is uneven across OEMs.
  • Browser. onnxruntime-web, transformers.js, and WebLLM cover 1–3B parameter models, with WebGPU acceleration on Chrome and Edge. The biggest constraint is the 4 GB JavaScript heap and the cost of downloading model weights every visit.
  • Windows / Linux / desktop. llama.cpp with Vulkan or CUDA is the workhorse. ONNX Runtime is the alternative for production environments. ExecuTorch is gaining ground for newer model families.
  • Edge / embedded. Hailo, Coral, NVIDIA Jetson, Qualcomm RB5. Workload-specific — vision pipelines and small specialized models, not general-purpose LLMs.

The point isn’t that one platform “wins.” It’s that a production deployment usually has to ship to several of them at once, and the operating layer has to handle that consistently.


When the cloud is still the right choice

On-device AI is not a panacea. Cloud inference is the right call when:

  • The model is genuinely too large to run on any device class your users own (Llama 3.3 70B+, frontier API models).
  • The use case is bursty and low-volume per user — paying $0.0005 per occasional request beats provisioning every user’s device with a model.
  • You need cross-user reasoning — the model needs to see signals from multiple users, which on-device inference can’t provide.
  • You’re early-stage and the on-device operating-layer cost is bigger than the cloud bill — a serious consideration we calculate explicitly.

The honest production architecture in 2026 is hybrid. Routine inference on-device, cloud fallback for the long tail, and clean policy controls for which path each request takes.


Getting started

If you want to feel the difference yourself: install Octomil and run a model on your laptop in under a minute.

curl -fsSL https://get.octomil.com | sh
octomil serve llama-3.2-3b

That gives you an OpenAI-compatible inference server on http://localhost:8080/v1. Existing code that calls api.openai.com works against it with a one-line base_url change. Walkthrough in How to Run LLMs Locally with an OpenAI-Compatible Server.

When the project grows beyond one machine, the Octomil control plane handles packaging, routing, rollouts, fallback, and fleet monitoring across the platforms above.


FAQ

Is on-device AI just edge AI?

The terms overlap. “Edge AI” historically meant industrial deployments — robots, cameras, factory equipment running models on physically deployed hardware. “On-device AI” usually refers to consumer-end devices — phones, laptops, browsers. Today the categories are converging: both are about inference running where the data lives, without a cloud round-trip.

Does on-device AI need a GPU?

Not always. Modern CPUs and integrated NPUs (Apple Neural Engine, Qualcomm Hexagon, Intel AI Boost) handle 1B–3B parameter LLMs at usable speeds. GPUs help for larger models or higher throughput. Mobile NPU performance is improving fast — most flagship phones shipped after 2024 are viable targets.

How big a model can I run on a phone?

As of mid-2026: 1B–3B parameter LLMs are routine on flagship phones with 8 GB+ RAM. 7–8B parameter models run but are tight on memory and battery. The frontier moves about one generation per year — what was hard last year is the default this year.

What about model updates? Do users have to re-download the app?

No. Mature on-device AI deployments ship model weights separately from the app binary. Octomil handles over-the-air model delivery, integrity verification, and staged rollouts so model updates don’t require an App Store submission.

Does this work with the OpenAI SDK?

Yes — when you run octomil serve, you get an OpenAI-compatible API at http://localhost:8080/v1. Existing OpenAI SDK code works with a base_url change. Other on-device deployment paths use platform-native APIs (CoreML, LiteRT) where appropriate.

Is on-device AI suitable for HIPAA-regulated workloads?

It can be a strong fit because raw patient data never leaves the device. The details depend on what telemetry the control plane stores and how the audit trail works. See our HIPAA-compliant AI guide for the specifics.