TL;DR
On-device, edge server, or cloud — where should inference run? A placement decision by latency, privacy, model size, and cost per inference.
Every team that ships an AI feature eventually faces the same placement question: where does the model actually run? The demo ran in the cloud, because that is where the demo always runs. Production is a different question. A voice assistant that waits 400 milliseconds for a round trip feels broken. A health app that sends raw audio to a server raises a question no product manager wants to answer in a review. And a feature that costs a tenth of a cent per call in the cloud costs nothing at all on the user's phone — until the model outgrows the phone, and then the cloud bill arrives with interest.
The short version: put inference on the device when the data must not leave it or when the latency budget is measured in single-digit milliseconds; put it on a nearby edge server when the model is too big for the device but the round trip to a data centre is still too slow; put it in the cloud when the model is large, the traffic is spiky, or the team changes models faster than it can ship them. Most real systems end up using all three, with a router that picks a tier per request. The rest of this guide is how to make that choice deliberately — what each tier can actually do, what it costs, and where each one quietly fails.
The three tiers, and what actually differs
The tiers differ on four axes, and only one of them is latency. Latency gets the attention because it is the easiest to measure, but the decision usually turns on one of the other three.
Latency. On-device inference answers in single-digit milliseconds because there is no network at all. A nearby edge server — a box in the store, the factory, or the clinic — typically answers in tens of milliseconds. A cloud round trip is usually in the low hundreds of milliseconds on a good connection, and worse on a bad one. Those are typical ranges, not guarantees: a congested Wi-Fi network can make the edge server slower than a quiet 5G link to the cloud. Measure your own p99 on your own network; the tier decision is a latency-budget decision, and budgets are written in percentiles, not averages. Our companion guide on latency budgets for edge and regional inference works through how to set those budgets in the first place.
Privacy and data gravity. On-device inference is private by construction: the raw input never leaves the user's hardware. That matters for voice, health data, and anything covered by a regulation that treats the data's location as a compliance fact rather than an implementation detail. An edge server keeps the data inside a building the organisation controls, which is usually enough for retail and industrial settings. The cloud requires the data to travel, which means encryption in transit, a data-processing agreement, and a conversation with whoever owns the privacy review.
Model size. This is the hard physical constraint. A phone has a few gigabytes of memory shared with everything else on it, and a model that needs 8 GB of weights simply does not fit. A Jetson-class edge box has tens of gigabytes. A cloud instance can hold hundreds. Quantization moves the boundary — a 4-bit quantized 3B-parameter model is roughly 2 GB, which is why small language models suddenly run on phones — but it moves it by a factor of two or four, not by an order of magnitude. The model you want to run decides the tier more often than the architecture diagram does.
Cost shape. On-device inference has no per-request cost: you pay once, in the hardware you already shipped and the engineering to fit the model on it. An edge server is a capital cost plus maintenance — you buy the box, you patch it, you replace it when it dies. The cloud is purely variable: you pay per request, per token, or per hour of rented accelerator, which is cheap at low volume and the most expensive option at high, steady volume. The crossover point is a spreadsheet exercise, not a gut feeling, and it is covered in the cost section below.
Tier 1: On-device inference
On-device inference means the model runs on the hardware in the user's hand: a phone, a laptop, a headset, a car. The runtimes are mature. Apple's Core ML targets the Neural Engine, Google's LiteRT — TensorFlow Lite renamed in September 2024 — is the on-device runtime for Android and embedded Linux, and ONNX Runtime runs the same model across Windows, mobile, and embedded targets. LiteRT's newer CompiledModel API handles accelerator selection for you instead of making you wire GPU and NPU delegates by hand, and its sibling LiteRT-LM is the runtime for running language models on device rather than classical classifiers.
The silicon has caught up with the software. Apple's Neural Engine does 17 trillion operations per second on the A16 Bionic, 35 TOPS on the A17 Pro, and 38 TOPS on the M4 — Apple's own announcement puts the M4 figure at 38 trillion operations per second, 60x the first Neural Engine in the A11. Those numbers are peak throughput for int8-style workloads, not a promise about your model, but they explain why a phone can now run real models locally instead of just toy ones.
The model side changed at the same time. Meta's Llama 3.2, released in September 2024, shipped 1B and 3B text models explicitly designed to fit on edge and mobile devices, with a 128K-token context window, pruned and distilled from the 8B model. Meta's announcement describes them as state-of-the-art in their class for on-device summarisation, instruction following, and rewriting, distributed on-device through PyTorch ExecuTorch. A 1B model quantized to 4 bits is well under a gigabyte; it runs on a phone without drama. That is the class of model on-device inference is for: small, specialised, and close to the user.
Who it is for: features where the input is sensitive or the interaction is real-time — voice commands, on-device transcription, camera-based detection, personalised writing assistance, offline-first apps. If the feature must work in a basement, on a plane, or in a hospital with no guest Wi-Fi, there is no other tier.
The honest limits: the model catalogue is small. You are choosing from models that fit in a few gigabytes, which means you are choosing from small models, and small models are worse at reasoning, long context, and open-ended generation. Updating a model means shipping an app update or a model download, not a redeploy — version skew across a fleet is a real operational problem, and a model that behaves differently on a two-year-old phone than on a new one is a support ticket waiting to happen. And the device is not yours: the operating system can throttle you, the user can deny you the NPU, and the battery budget is a shared resource.
Tier 2: Edge server inference
An edge server is a computer you control, placed near the users: a Jetson box in a store, a GPU server in a factory, a small cluster in a branch office. It exists for the workloads that are too big for the device and too latency-sensitive for the cloud.
The hardware in this tier is genuinely capable now. NVIDIA's Jetson AGX Orin delivers up to 275 TOPS of sparse INT8 AI performance in a module that draws 15–60 W, and the smaller Orin Nano starts at 20 TOPS (34 in the Super mode JetPack 6.2 added) at 7–25 W, according to NVIDIA's technical brief. Those figures are sparse INT8 — dense throughput is roughly half — but the shape is what matters: a box the size of a paperback can run a vision pipeline, a speech model, and a small language model at the same time, on a power budget a wall socket can supply.
The serving stack is the same one the cloud uses, shrunk down. NVIDIA's Triton Inference Server and vLLM run on the edge box, serve multiple models concurrently, batch requests dynamically, and expose the same HTTP/gRPC endpoints your cloud services use. That sameness is the point: the model-serving code does not have to know which tier it is on, which is what makes a hybrid router feasible at all. Quantization is the lever that makes models fit here — our guide to model optimization and quantization covers the techniques that decide whether a model fits on a Jetson or needs the data centre.
Who it is for: multi-camera vision in retail and factories, robotics, in-store kiosks, clinics and branches that cannot send data out, and any workload where ten cameras or a hundred users share one site and one model. If the data is generated at a place and consumed at the same place, the inference belongs at that place.
The honest limits: you are now operating hardware in the field. Someone has to patch the box, replace a failed drive, and update the model on a device that sits behind a store's firewall. A fleet of fifty edge servers is fifty servers to operate, and the team that has never done fleet management will learn it the hard way — remotely, through a VPN, at 2 a.m. The other limit is the ceiling: a single edge box tops out at the models that fit in its memory, and the moment the product team wants the 70B model, the edge tier has nothing to offer.
Tier 3: Cloud inference
Cloud inference is the default, and it is the default for good reasons: every model fits, every framework works, and you can change the model with a redeploy instead of a hardware refresh. The accelerator menu is the widest here. Alongside data-centre GPUs, AWS's purpose-built chips have matured into a real option: Inferentia2 powers the Inf2 family, with 32 GB of high-bandwidth memory per chip and up to 12 chips — 384 GB — on the largest instance, and Trainium2 powers the Trn2 family for training and large-model inference, with 16 chips and 1.5 TB of accelerator memory per instance, per AWS's accelerated-computing pages. Both run through the Neuron SDK, which is the catch: your model has to compile for Neuron, not CUDA, before it serves a single request.
Who it is for: the largest models, spiky or unpredictable traffic, teams that iterate on models weekly, and anything where the request volume does not justify dedicated hardware. If you serve a thousand requests a day, the cloud is cheaper than a box you bought and mostly leave idle. If the model changes every sprint, the cloud is the only tier where changing it is a deploy, not a logistics project.
The honest limits: latency and cost at scale. Every request pays a network round trip, and the p99 is set by the worst network your users are on, not the best. Cost is linear in usage with no ceiling: a feature that goes viral in the cloud is a billing event, and a feature that is popular but low-value is a slow bleed. And the data leaves your control — for some workloads that is a non-starter regardless of price.
Head-to-head: the placement decision
| On-device | Edge server | Cloud | |
|---|---|---|---|
| Typical latency | Single-digit ms | Tens of ms | Low hundreds of ms |
| Data leaves the device | Never | Stays on site | Travels to a data centre |
| Model size | ~1–3B params, quantized | ~7–13B params, quantized | Any size |
| Cost shape | Fixed, in hardware shipped | Capital + maintenance | Variable, per request/hour |
| Model updates | App update / download | Fleet rollout | Redeploy |
| Works offline | Yes | Yes, on site | No |
| Best for | Voice, camera, personal, offline | Vision, robotics, branches | Large models, spiky traffic |
The table is a starting point, not a verdict. Two workloads that look identical on it can land on different tiers because of one constraint: a retail chain whose cameras may not send footage off-site is an edge-server decision no matter what the latency numbers say, and a consumer app whose model is a 70B reasoning model is a cloud decision no matter how much the team likes the idea of on-device.
Cost per inference: how to model it
The comparison that decides most placements is cost per inference at your actual volume, and it has three terms, not one.
On-device, the cost is the engineering to fit and ship the model, amortised over the fleet — plus the support cost of version skew. There is no per-request charge, which makes on-device the cheapest tier at high volume by a wide margin, and the most expensive tier to get wrong, because a bad model ships to every device at once.
On an edge server, the cost is the hardware plus power plus the operations time, divided by the inferences the box serves over its life. A $1,000 box that serves a million inferences a month for three years costs a fraction of a cent per inference — but only if it is actually busy. An edge box serving a hundred inferences a day is the most expensive tier in this table.
In the cloud, the cost is the instance-hour or per-token price times usage, and it scales linearly. At low volume it wins outright; at high steady volume it loses to both other tiers. The full accounting — including the GPU-attribution problem, where a shared accelerator's cost has to be split across the workloads that use it — is covered in our guide to FinOps for AI workloads and GPU cost attribution.
The practical rule: model the cost at 10x your current volume as well as at today's. A tier that is cheapest now and ruinous at 10x is a migration waiting to happen, and migrations between tiers are the expensive part — they touch the model, the serving code, and the data path at the same time. Pick the tier you will still want at 10x, not just the one that is cheapest this quarter.
The routing pattern: hybrid by default
Mature systems rarely pick one tier. They route: the small model answers on the device when it can, the edge server takes the cases the device cannot handle, and the cloud takes the cases neither can. The router is a small piece of code with an outsized effect on the bill and the latency distribution, because it is where the placement decision stops being a slide and starts being behaviour.
type Tier = 'device' | 'edge' | 'cloud';
interface InferenceRequest {
// Rough size class of the model this request needs: 'small' fits on
// device, 'medium' needs the edge box, 'large' needs the cloud.
modelClass: 'small' | 'medium' | 'large';
containsSensitiveData: boolean;
// p99 budget for this request, in milliseconds.
latencyBudgetMs: number;
}
function route(req: InferenceRequest): Tier {
// Privacy is checked first: it is a constraint, not a preference.
if (req.containsSensitiveData) return 'device';
if (req.modelClass === 'large') return 'cloud';
if (req.modelClass === 'medium') {
return req.latencyBudgetMs < 50 ? 'edge' : 'cloud';
}
// Small model, non-sensitive data: on-device is cheapest at volume,
// but fall back to the edge server when the device is busy or hot.
return deviceAvailable() ? 'device' : 'edge';
}Three details matter more than the code itself. First, the router needs a fallback for every tier: a device that is throttled, an edge server that is down, a cloud endpoint that is timing out. A router without fallbacks is a single point of failure wearing a clever name. Second, the router's decisions must be observable — log the tier, the latency, and the reason, or you will never know whether the edge tier is actually earning its keep. Third, the tier boundaries are configuration, not code: the day the 3B model gets good enough to replace the 7B one, you want to move a threshold, not ship a release.
Architecture Decision
Decision: Route inference across all three tiers — on-device first for small models and sensitive data, a nearby edge server for medium models with tight latency budgets, cloud for large models and spiky traffic — behind a single router with per-tier fallbacks, and revisit the placement every quarter against measured latency, cost per inference, and model-size changes.
Context: The product ships AI features to users on phones, in stores, and on the web. Some inputs are sensitive voice and health data; some features are real-time and latency-critical; some need the largest available models. No single tier satisfies all three, and the model catalogue changes faster than the hardware refresh cycle. The team operates one cloud account, a small fleet of edge boxes, and a mobile app with a monthly release train.
Options considered: (1) The hybrid router above. (2) Cloud-only — simplest to operate, one serving stack, one model registry; but every request pays a round trip, sensitive data leaves the device, and the bill scales linearly with success. (3) On-device only — the cheapest at volume and private by construction, but it caps the product at small models and turns every model update into an app release. (4) Edge-server only — keeps data on site and latency low, but it is a fleet to operate and it cannot run the largest models at all. (5) Cloud plus on-device with no edge tier — covers the extremes but leaves a gap for the medium models that are too big for a phone and too latency-sensitive for a round trip.
Why this one: The router turns a permanent architectural argument into a per-request decision, which is where the decision belongs — different requests genuinely have different answers. It keeps sensitive data on the device without giving up large models, and it keeps the cloud bill tied to the requests that actually need the cloud. The tier boundaries are configuration, so the system improves as small models improve, which is the direction the field is moving: the 1B and 3B models of 2024 do work that needed a server in 2023.
What it costs you: Three serving stacks to keep working instead of one, three model formats to build and sign, and a router that is now load-bearing infrastructure. The edge fleet needs patching, monitoring, and a replacement plan. Version skew across tiers is a real failure mode — the on-device model, the edge model, and the cloud model are three versions of "the same" feature, and they will drift unless someone owns the matrix. Telemetry has to be per-tier, or the router's decisions are unobservable.
When to reverse it: If the product consolidates onto one model class — everything becomes a small on-device model, or everything needs the largest cloud model — collapse to that tier and delete the router; a router serving one tier is pure overhead. Reverse toward cloud-only if the edge fleet's operating cost exceeds the latency and privacy value it provides, which is the honest outcome for many teams that installed edge boxes for one feature and never added a second. And reverse the on-device leg if the platform's model distribution story changes: if shipping models to devices becomes harder than serving them, the device tier stops earning its keep.
When not to run inference at the edge
Edge inference — on-device or on a nearby server — is the right answer often enough that teams over-apply it. Three cases where it is the wrong call.
First, when the model changes faster than the fleet can absorb it. A research team shipping a new checkpoint every week will spend more time on model distribution than on modelling if every update has to reach ten thousand phones or fifty stores. Until the distribution pipeline is boring, the cloud is the right home.
Second, when the workload is bursty and the edge hardware would sit idle. An edge box bought for a feature used twice a day is a capital expense earning nothing; the cloud's variable pricing exists for exactly this shape.
Third, when the team has no one to operate the fleet. Edge servers are servers. They need patching, monitoring, disk replacements, and someone on call when a store's box goes dark on a Saturday. A team without that capacity will get more reliability from a managed cloud endpoint than from hardware it cannot look after — and a dead edge box is worse than a slow cloud call, because it fails the feature entirely instead of degrading it.
The bottom line
Start from the constraint, not the tier. If the data cannot leave the device, the decision is made. If the model does not fit on the device, the decision is made. If the latency budget is under roughly 50 milliseconds at p99, the cloud is out and the choice is between the device and the nearest server. Everything else — cost, operations, model velocity — is a tiebreaker between the tiers the constraints leave open.
The durable shape is the hybrid: a small model on the device for the private and the instant, an edge server for the medium models that need to stay close, the cloud for the large models and the traffic spikes, and a router that makes the choice per request with a fallback for every tier. Build the router and the telemetry first, pick the tiers second, and let the model catalogue — which gets smaller and better every year — move the boundary toward the device over time.
Why This Matters
Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.
Trade-offs to Consider
Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.
When NOT to Use This
Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.
Decision Framework
Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.