Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

AI System Design

Design an Edge Inference Fleet

Step 1 / 9

Learn AI system design by building the platform that deploys and manages ML model inference across a large fleet of edge devices — phones, IoT sensors, retail kiosks, cars — not centralized…

The numbers to beatserver rollbacknear-instant, continuous connectivityedge rollbackeventually consistent, per-device reconnectfleet statecan be inconsistent during the window

The whole design, in writing

Every step of the build above, written out: the problem each piece solves, the option that was taken and the ones that were not, the numbers, and how it fails in production.

The big idea

Millions of devices you don't fully control

Datacenter inference serving assumes reliable connectivity, homogeneous hardware, and servers you can SSH into. None of that holds for an edge fleet: devices are tiny, intermittently connected, wildly heterogeneous, and you can't just log in and check what's wrong.

Edge Devicephone, kiosk, sensor
New in this step: Edge Device.

We'll build for that reality: model compression to fit real constraints, offline-capable inference, staged rollout that accounts for devices you can't instantly reach, bandwidth-conscious updates, and devices that verify their own state rather than trusting a push arrived.

What the new pieces do

Edge Deviceclient
Tiny memory and compute compared to a datacenter GPU, intermittently connected, and one of potentially millions running the same model.

Step 1 · The baseline

Every request goes to the cloud

Simplest version: every edge device sends every inference request to a central cloud server and waits for a response. What breaks at real fleet scale?

Edge Devicephone, kiosk, sensorFleet Control Planemanages the fleet
New in this step: Fleet Control Plane.

Every inference request from every device goes to a central cloud server. What breaks at fleet scale?

  1. Server scaling doesn't solve the deeper issues here: real-time use cases need latency a round trip to the cloud can't guarantee, bandwidth/cost scale directly with fleet size and request volume, and the device becomes totally unusable the instant it loses connectivity — none of which more server capacity fixes.

  2. Round-tripping every inference to the cloud stacks network latency onto every request (bad for anything real-time), costs scale linearly with a potentially enormous fleet's total request volume, and — critically — the device simply can't function at all the moment its connection drops, which for genuinely mobile or remote edge devices is a common, not rare, occurrence.

  3. Even devices with generally good connectivity experience real, if infrequent, connectivity gaps — and the latency and bandwidth cost problems exist regardless of connectivity quality, affecting every device in the fleet, not just poorly-connected ones.

Cloud-only inference stacks network latency onto every request, scales cost directly with fleet size, and makes every device totally dependent on connectivity that edge devices often don't reliably have. Real-time, cost-efficient, resilient operation requires the device to do at least some inference itself.

Why this piece earns its place

The cloud path is worth keeping on the diagram even after inference moves on-device, and deleting it is the version of this answer that loses the argument. Some work still belongs in the datacenter — a model too large to compress usefully, a request the device's hardware genuinely cannot serve — so the real decision is not cloud or edge but which slice crosses the network, and that should be a runtime choice rather than one frozen at build time. The second-order consequence is the one that bites. Putting inference on hardware you do not own turns a deploy into a release: you can no longer fix a bad model by restarting a process, you inherit whatever update channel the platform gives you, and your inference code is now pinned against OS versions and platform runtimes you do not control, which change underneath you without asking. Everything after this step is the price of that. Skip it while the fleet is small and the requests are occasional: the round trip is cheaper than the release machinery, and shipping the boring version stays the right call until either the device count or a latency requirement makes it the wrong one.

What the new pieces do

Fleet Control Planegateway
The central point that produces, versions, and rolls out models to the fleet — but never assumes it has a live connection to every device.

Step 2 · Compress the model to fit

A datacenter model doesn't fit on a phone

Move inference onto the device itself. A model sized for a datacenter GPU is often far too large for an edge device's memory, compute, and battery budget. What has to happen first?

Compression Pipelinequantize, distill, pruneCompressed Model Versionsedge-ready artifacts
New in this step: Compression Pipeline, Compressed Model Versions.

A model built for datacenter serving is far too large for edge hardware. What needs to happen before it can run on-device?

  1. Even capable modern edge devices have memory, compute, and battery budgets orders of magnitude smaller than a datacenter GPU — most full-size models simply won't fit or run acceptably without real compression.

  2. Model compression techniques shrink a model's footprint substantially, at some accuracy cost, in exchange for something that can genuinely run within an edge device's real, severe resource constraints — an explicit, deliberate trade rather than assuming the full model just fits.

  3. Restricting to only the most powerful edge devices would exclude the vast majority of a realistic fleet — the whole point is making inference work across genuinely resource-constrained, typical edge hardware.

Run models through a Compression Pipeline — quantization, distillation, pruning — before they're deployable to edge hardware, producing a genuinely smaller, edge-appropriate model that trades some accuracy for actually fitting within real device resource budgets.

Why this piece earns its place

Compression does not produce a model, it produces one artifact per model-and-target pair, and that multiplication is what really sets the cost of this box. A quantized graph leans on kernels the silicon actually implements: the integer operation one accelerator runs natively may be missing on another, so the same weights get built, packed and shipped several times over. What follows from that is a versioning problem rather than a size one. The recipe — bit widths, which layers stay in float, the calibration sample used to pick the ranges — is an input to the artifact, and so is the converter that applied it. Pin both. A recipe on its own will not rebuild an old release once the toolchain has moved a version or two, and the first time you need that rebuild is the worst possible moment: a device is misbehaving on a build you shipped and can no longer reproduce, so you cannot even tell whether the fault is in the weights or in the packing. Skip the pipeline entirely when there is exactly one target: hand-tuning a single build beats automating it. The moment a second class of hardware appears, that stops scaling — and building the matrix before you have shipped into it is far cheaper than reconstructing it afterwards.

What the new pieces do

Compression Pipelineservice
Shrinks a model to fit severe on-device memory, compute, and battery budgets — trading some accuracy for the ability to run at all on the target hardware.
Compressed Model Versionsdata
Versioned, compressed model artifacts specifically built for edge deployment — distinct from full-size server-serving models.

Step 3 · Run inference locally, offline-capable

The device shouldn't need a live connection to function

With a compressed model deployed, should the device still call the cloud for every inference, or run entirely on its own?

Edge DeviceFleet Control PlaneCompressed Model Versions
New in this step: Edge Device → Compressed Model Versions. · swipe to pan the diagram

The device runs inference locally, entirely offline-capable once it has the compressed model — no live connection needed for normal operation. This directly solves Step 1's core problems: no per-request network latency, no per-request bandwidth cost, and full functionality even when connectivity genuinely drops.

Why this piece earns its place

Two things move onto the device with the model and only one of them is the weights. The other is everything around them — the tokenizer, the image resize, the normalization constants, the thresholds applied to the output. Reimplemented in the app's language against the platform's own text and imaging libraries, those drift from what the training pipeline did, and the result is the nastiest failure on this page: inference completes, latency looks normal, nothing is logged, and the answers are quietly a little wrong. Ship the preprocessing as part of the artifact, not as app code that happens to travel alongside it. The other thing worth saying out loud is that the per-request cost did not vanish, it moved onto the user's battery and thermal headroom. A model that benchmarks well on a cold device throttles some minutes into sustained use, so the number that matters is the one measured hot. Step 2's per-target builds also have a consequence that lands here: two devices can return different answers for the same input without either of them being broken, so a complaint cannot be reproduced by replaying it centrally. The only reproduction worth anything is on the same hardware, which is an argument for keeping a physical unit of every target you build for rather than an emulator and a hope.

Step 4 · Staged rollout — harder than a server rollback

You can't instantly reach every device

A new model version needs to roll out to potentially millions of devices. If it turns out to be bad, how quickly can you actually undo that, compared to rolling back a server-side model?

Edge DeviceFleet Control PlaneCompressed Model VersionsStaged Rollout Manager
New in this step: Staged Rollout Manager. · swipe to pan the diagram

A bad model version needs to be rolled back across a fleet of edge devices. How does this compare to server-side rollback?

  1. A server rollback works because every server instance is continuously connected and can be reached immediately. Edge devices are frequently offline, so a "rollback" is really just an updated instruction waiting for each device to next check in — which could be minutes or days later depending on that specific device's connectivity pattern.

  2. Because devices aren't continuously connected the way servers are, "roll back" doesn't mean "instantly fixed everywhere" — it means "the corrected version is now available for any device that checks in," which can take an unpredictable amount of time per device, and the fleet is genuinely inconsistent in the meantime.

  3. The blast radius being per-device doesn't make the ROLLBACK MECHANISM easier — reaching every device to actually deliver the correction is exactly the hard part, regardless of each device's individual blast radius.

Use a Staged Rollout Manager that gradually expands a new version's availability, monitoring for problems before wider release — but design explicitly for the reality that a rollback isn't instantaneous across the fleet: offline devices remain on whatever version they last received until they reconnect, so the fleet can be inconsistent for an unpredictable window.

Why this piece earns its place

Two things make staging different here, and neither of them is the percentages. First, cohort membership is computed on the device rather than handed out. A server could perfectly well assign one when a device checks in — but then it owns a row per device, has to keep those rows correct across reinstalls and hardware swaps, and still cannot tell you weeks later which stage a given device was actually in when you go back to analyse one. A stable hash of the device identifier gives you the same buckets with no central state, unchanged across reconnects and reconstructable from the identifier alone. Second, and worse, the population is biased in exactly the direction that hides the problem: the devices that take a new version first are the ones online, on WiFi and charging — the healthiest, best-connected slice of the fleet — so an early stage reading clean is not evidence of anything. A stage has to stay open long enough for the slow-checking-in devices to be represented, and that, not the clock, is what sets its length. Since the correction itself travels slowly, the lever you actually want is a kill switch the device evaluates locally: a flag that says fall back to the previous version is bytes against a model's megabytes, so it propagates on a different timescale. Build that channel separately, before you need it.

  • server rollbacknear-instant, continuous connectivity
  • edge rollbackeventually consistent, per-device reconnect
  • fleet statecan be inconsistent during the window

What the new pieces do

Staged Rollout Managerservice
Rolls a new version out to the fleet gradually — but "rollback" here can't instantly reach a device that isn't currently online.

Step 5 · Bandwidth-conscious delivery

Don't push the full model every time

Delivering a model update to millions of devices over real-world connections (often cellular, often metered or slow). Should every update ship the full model?

Edge DeviceFleet Control PlaneCompressed Model VersionsStaged Rollout ManagerDelta Updater
New in this step: Delta Updater. · swipe to pan the diagram

Shipping a model update to millions of devices, often over cellular. Ship the full model every time?

  1. Shipping the full model on every update, at fleet scale, means enormous aggregate bandwidth cost and a slow, expensive download for every device — especially painful over cellular connections many edge devices rely on.

  2. Delta updates dramatically reduce the data transferred when only part of a model actually changed, and opportunistic timing (waiting for WiFi/charging rather than forcing an immediate cellular download) respects the device's real resource constraints — both meaningfully reduce cost and user impact at fleet scale.

  3. Requiring a wired connection would exclude the vast majority of genuinely mobile edge devices from ever receiving updates — this doesn't match how most real edge devices actually connect.

Use a Delta Updater: ship only the changed portions of the model where possible, and prefer opportunistic delivery — WiFi, charging — over immediately forcing a large download over a device's metered cellular connection and battery.

Why this piece earns its place

What makes a delta small is settled before the diff runs, and in two places rather than one. Training is the obvious one: fine-tune from the previous checkpoint and the weights barely move; retrain from scratch with a new seed and the delta is a whole model wearing a smaller name. The other is the layer Step 2 added. Everything shipped here is quantized, so a weight that moved barely at all can still cross a bucket boundary — a light fine-tune can change a large share of the packed values while the model itself hardly moved, and container compression then scatters those changed bytes through the file. So diff the unpacked artifact, keeping tensor layout stable between builds, rather than the container you ship. Then there is the base-version problem: a patch is written against one specific predecessor, so a device several versions behind either applies a chain in order or falls back to a full download, and how many predecessors you keep patches for is a storage-against-bandwidth call you make once and live with for years. Finally, apply patches atomically and verify the reconstructed artifact against a hash before switching to it — a half-applied patch does not fail, it produces a file that loads and infers nonsense. Which means the device holds both models at once, and that doubled footprint belongs in the budget from Step 2, where nobody ever counts it.

What the new pieces do

Delta Updaterservice
Ships only the changed weights, not the full model, and prefers WiFi/charging windows over expensive, battery-draining cellular pushes.

Step 6 · Telemetry without full device control

You can't SSH into a customer's phone

You need to know how the fleet is actually performing — error rates, latency, resource usage — but can't directly access or continuously monitor devices you don't fully control.

Edge DeviceFleet Control PlaneCompressed Model VersionsStaged Rollout ManagerDelta UpdaterTelemetry Aggregator
New in this step: Telemetry Aggregator. · swipe to pan the diagram

Collect lightweight, aggregate, privacy-conscious telemetry reported opportunistically when connectivity allows — performance and error signals, not real-time streaming or invasive device access. This respects both the device's constrained resources (telemetry shouldn't itself be a meaningful battery/bandwidth cost) and user privacy, while still giving the fleet operator real visibility into how deployed models are actually performing.

Why this piece earns its place

The dangerous property of opportunistic telemetry is that it only arrives from devices healthy enough to send it. A device the last update pushed into a crash loop, or one whose model no longer loads, reports nothing at all — so the fleet's worst outcomes are precisely the ones missing from the data, and the dashboard gets quieter as things get worse. The defence is to alert on absence rather than on error rate, which means holding a denominator the devices do not supply: expected check-ins, activations, the known size of each rollout cohort. Without one, a rate computed over whoever reported is a rate over survivors. The second property is that every event is buffered and uploaded late, stamped with a clock you do not control. Events arrive out of order, from the future, and occasionally from 1970, and a given day's numbers keep revising for as long as the slowest devices take to check in. And the schema is itself a release. A field nobody thought to collect cannot be backfilled, and adding one means waiting out the same rollout a model waits out — so the question you urgently need answered during an incident is answerable only if you were already collecting it. Emit a small, stable set of coarse counters from day one, stamped with the build that emitted them, rather than a rich schema you expect to keep iterating on.

What the new pieces do

Telemetry Aggregatordata
Lightweight, privacy-conscious performance and error signals reported when connectivity allows — not real-time streaming from devices you don't control.

Step 7 · Graceful degradation for weaker devices

Not every device can run the latest model

The fleet includes a wide range of device capability — some can run the newest, best model version; older or weaker devices genuinely can't.

Edge DeviceFleet Control PlaneCompression PipelineCompressed Model VersionsStaged Rollout ManagerDelta UpdaterTelemetry Aggregator
The system as it stands at this step. · swipe to pan the diagram

Maintain a fallback path for resource-constrained or older devices: a smaller, older, or simpler model variant (or heuristic) for devices that can't run the latest version, rather than either forcing an incompatible deployment or leaving weaker devices with no working inference at all.

Why this piece earns its place

The hard part of a tiered fleet is not maintaining the variants, it is deciding which tier a device belongs to — and you have to do that for hardware that did not exist when you shipped. An allowlist of device names means every new phone launch becomes a release you are forced to make, and anything you have not heard of gets nothing at all. So tier by measured capability instead: available memory, whether an accelerator is present, a short benchmark run once at install, with a conservative default for anything that fails to classify. Two consequences. Fleet-wide quality numbers stop meaning much, because they become a weighted average over models that behave differently, and a real regression in the smallest tier hides comfortably inside an improving total — so every metric here needs a tier dimension from the start rather than bolted on during an incident. And each tier is a standing obligation: a training lane, a compression target, a slot in every rollout, for as long as those devices exist. Add one when the population justifies it, not because the spectrum looks incomplete.

Step 8 · The sharp edges

Devices that verify, and versions that eventually sunset

Two real long-term risks: a device that stays on a bad version far longer than expected because it happened to be offline through the whole rollback window, and version fragmentation as the fleet accumulates many old model versions over years.

Edge DeviceFleet Control PlaneCompressed Model VersionsStaged Rollout ManagerTelemetry AggregatorVersion Manifest
New in this step: Version Manifest. · swipe to pan the diagram

Rather than relying purely on a server push reaching every device, have each device self-check its current version against the Version Manifest — the known-good current version — whenever it reconnects, actively pulling a correction if it's out of date rather than assuming a push already arrived while it was offline. For version fragmentation, track how many devices remain on each old version over time and deliberately sunset very old versions on a defined timeline, rather than supporting an ever-growing number of historical versions indefinitely.

Why this piece earns its place

Making the manifest authoritative makes it the most load-bearing thing you serve, so design it that way. It is tiny and read by everything, which means a CDN in front of it and jitter on each device before it checks — when a region's connectivity comes back, every device there reconnects inside the same few minutes and asks the same question at once. Sign it, and verify the signature on the device before acting on it. The manifest names a version rather than carrying one, so forging it does not by itself run an attacker's code — it pins the fleet to an old or known-bad build, a fleet-wide outage delivered down your own healing path. It becomes code execution only if artifact fetch is unauthenticated too, so sign the artifacts as well as the file naming them. The sharper trap is inside self-healing itself: a device that heals toward a version it cannot load will heal, crash and heal again indefinitely, and it is offline-shaped enough that you may never see it happen. So the device keeps the last version that actually ran, counts consecutive load failures against a candidate, and pins itself back rather than obeying the manifest a third time. Sunsetting has a matching floor — keep one full artifact per tier alive, not just the tail of a patch chain, or a device dark for two years has nothing legal to start from.

What the new pieces do

Version Manifestdata
The known-good current version — devices check against this themselves on reconnect, rather than trusting that a push reached them.

You did it

You just designed an edge inference fleet.

Edge DeviceFleet Control PlaneCompression PipelineCompressed Model VersionsStaged Rollout ManagerDelta UpdaterTelemetry AggregatorVersion Manifest
The finished design, end to end. · swipe to pan the diagram

Everything you assembled, in order

  • Cloud-only inference fails at fleet scale — latency, cost, and total dependency on connectivity edge devices often don't reliably have.
  • Model compression (quantization, distillation, pruning) is a deployment requirement for fitting severe on-device resource budgets, not an optional optimization.
  • On-device, offline-capable inference removes per-request latency and bandwidth cost, and keeps devices functional without a live connection.
  • Fleet-wide rollback is eventually consistent, bounded by each device's own reconnect timing — fundamentally different from near-instant server rollback.
  • Delta updates and opportunistic delivery timing respect real bandwidth and battery constraints at fleet scale.
  • Telemetry is lightweight, aggregate, and opportunistic, respecting both device constraints and privacy, within the limits of what you actually control.
  • Graceful degradation via fallback model variants serves fleet hardware heterogeneity rather than assuming one uniform target.
  • Devices actively self-check their version against a known-good manifest on reconnect, rather than passively trusting a push arrived while offline.

Where an interviewer pokes next

Getting the boxes right is the easy half. These are the questions that separate a candidate who drew the diagram from one who has run the thing. Answer each one out loud before you open it.

  1. How is this different from the Model Registry (MLOps) design?

    Model Registry governs promoting and rolling back models in a DATACENTER serving context, where every instance is continuously connected and reachable — rollback there is close to instantaneous once you repoint a version reference. This design takes on the SAME underlying versioning and staged-rollout principles but applies them where the core assumption (continuous connectivity) doesn't hold — devices go offline unpredictably, so rollback becomes an eventually-consistent process, and the system needs entirely new mechanisms (delta updates, opportunistic sync, device-side self-verification) that a purely server-side registry never needs to consider.

  2. Why have the DEVICE self-check its version rather than having the server just track which devices got which update and retry delivery to stragglers?

    Server-side tracking of "which devices are behind" and retrying delivery works, but it requires the server to maintain and continuously reconcile potentially millions of individual device states, and still depends on correctly identifying and reaching each straggler — itself a hard, ongoing coordination problem. Device-side self-checking flips this: each device is independently responsible for verifying its OWN state whenever it happens to reconnect, which scales naturally (no central coordination needed) and is robust to the server's own tracking being imperfect or a specific retry attempt failing — the device doesn't depend on the server successfully finding and re-targeting it; it actively checks for itself.

  3. Could compression (Step 2) introduce accuracy regressions that behave differently across different device hardware or input distributions?

    Yes — this is a real, subtle risk: a compressed model's accuracy loss isn't always uniform across all inputs, and could disproportionately affect certain categories of input in ways that weren't obvious from aggregate accuracy metrics alone (the same kind of blind-spot risk raised for active learning and lead scoring elsewhere). This is exactly why the SAME eval-gate discipline from Model Registry design should apply to compressed edge models too — validating a compressed candidate against a held-out set, and ideally against a rollout with real fleet telemetry (Step 6) monitoring for unexpected degradation across the actual device population and input distribution, not just an offline benchmark.

  4. How would you decide the boundary for what counts as "opportunistic" delivery timing — how long should the system wait for WiFi/charging before forcing a cellular update anyway?

    This is a genuine tunable trade-off between update timeliness (getting a security fix or important model improvement out fast) and respecting device resource constraints (not draining battery or burning cellular data). A reasonable design sets a bounded maximum wait — opportunistic delivery preferred for a defined window, but if a device hasn't connected to WiFi or started charging within that window, deliver over cellular anyway rather than waiting indefinitely, especially for updates addressing a genuinely urgent issue (a security fix or the kind of bad-model rollback from Step 4) versus a routine, non-urgent improvement that can afford to wait longer for ideal delivery conditions.

  5. What's the relationship between graceful degradation (Step 7) and the fair-share/quota patterns seen in other designs in this series?

    They're solving different problems that happen to share a "not everyone gets identical treatment" shape. Fair-share/quota patterns (GPU scheduling, multi-tenant SaaS) allocate a SHARED, contended resource fairly across competing consumers who could all, in principle, use the same resource equally. Graceful degradation here isn't about fairness or contention — it's about genuine HARDWARE CAPABILITY differences meaning some devices literally cannot run the same model as others, regardless of any allocation policy. The fallback model variant isn't a smaller "fair share" of the same thing — it's a categorically different, deliberately-designed simpler model built specifically for what constrained hardware can actually execute.

Check yourself — the answers, and why

Nine steps in, these are the calls you should be able to make cold. Pick one, then read why.

  1. Sending every inference request to a central cloud server fails at fleet scale because…

    Real-time responsiveness, cost, and offline resilience all require moving at least some inference onto the device itself.

  2. Model compression (quantization, distillation, pruning) for edge deployment is best understood as…

    Edge devices' resource budgets are typically far too small for a datacenter-sized model without compression.

  3. Fleet-wide model rollback is harder than server-side rollback because…

    Server rollback assumes near-continuous connectivity; edge rollback is fundamentally eventually consistent.

  4. Delta updates and opportunistic delivery timing exist to…

    Shipping only changed weights, timed for WiFi/charging, respects the real resource limits of edge devices.

  5. A device checking its own version against a known-good manifest on reconnect is important because…

    Active self-verification is more robust than passively trusting that a push arrived while the device was offline.

How you’d open this design in an interview

Before any boxes: agree what it must do, pin the qualities that shape everything, then build — naming each trade-off as you make it. The walkthrough above is that exact order.

What it must do

Agree on these before drawing a single box.

  • Run inference on-device: once a device has a compressed model, it runs inference locally and offline-capable — no live connection needed for normal operation.
  • Fit the hardware: compress each model (quantization, distillation, pruning) to run within an edge device’s real memory, compute, and battery budget.
  • Roll out and roll back: stage a new model version across potentially millions of devices, and pull a bad one back — accepting that offline devices lag until they reconnect.
  • Deliver updates cheaply: ship only the changed weights and prefer WiFi/charging windows over forcing a full download over metered cellular.
  • Observe the fleet: collect lightweight, aggregate telemetry — error rates, latency, resource usage — from devices you don’t fully control.

The qualities that shape everything

Each one names the mechanism that buys it.

Work without a live connection
Once the compressed model is on the device, inference runs entirely locally — no per-request network latency, no per-request bandwidth cost, full function even when connectivity drops.
Fit severe on-device budgets
A Compression Pipeline (quantization, distillation, pruning) shrinks a datacenter-sized model to actually run within real memory, compute, and battery limits — trading some accuracy for the ability to run at all.
Roll back across a fleet you can’t instantly reach
A Staged Rollout Manager expands a version gradually and is designed for eventually-consistent rollback: offline devices stay on their last version until they reconnect, so the fleet can be inconsistent for an unpredictable window.
Cheap delivery at fleet scale
A Delta Updater ships only the changed weights and delivers opportunistically over WiFi/charging rather than forcing a large download over metered cellular.
Visibility into devices you don’t control
Lightweight, aggregate, privacy-conscious telemetry reported opportunistically when connectivity allows — real signal on model performance without real-time streaming or invasive access.
Self-heal a stranded device
Each device checks its own version against the Version Manifest — the known-good current version — on reconnect and pulls a correction itself, rather than trusting that a server push reached it.

The trade-offs you say out loud

Senior signal isn’t the boxes — it’s naming what you gave up and why it was the right price.

Inference on the device over a cloud round-trip per request

Cloud-only inference stacks network latency onto every request, scales cost directly with fleet size, and dies the instant a device loses connectivity. Running the model locally is what removes all three — the device only needs a connection to receive an occasional update.

Compress for edge (quantize, distill, prune) over shipping the full datacenter model as-is

Even capable edge hardware has memory, compute, and battery budgets orders of magnitude below a datacenter GPU, so a full-size model won’t fit or run acceptably. Compression trades some accuracy for the ability to run at all — a deployment requirement, not an optimization.

Staged, eventually-consistent rollout over assuming instant fleet-wide rollback like a server

A server rollback works because every instance stays continuously connected; edge devices go offline, so “roll back” really means “the corrected version is waiting for each device to next check in.” Designing for the inconsistent window beats pretending reach is instant.

Delta updates + opportunistic delivery over pushing the full model on every update

Shipping the whole model to millions of devices means enormous aggregate bandwidth and slow, battery-draining cellular downloads. Sending only changed weights, timed for WiFi/charging, cuts cost and user impact while still converging the fleet.

Device-side self-verification over server-side straggler tracking and retry

Tracking “which devices are behind” forces the server to reconcile millions of device states and still reach each straggler. A device checking its own version on reconnect scales with no central coordination and stays robust even if the server’s tracking or a retry is imperfect.

The answer, out loud

What a strong answer to “Design an Edge Inference Fleet” sounds like, first question to last trade-off. It is about 7 minutes of talking; the whiteboard and the interviewer fill the rest of the 45. Read it aloud once, then close the page and give it yourself.

  1. 0–3 min

    Name what makes this not a datacenter

    Before I draw anything I want to name what makes this different from serving a model in a datacenter. The devices are tiny next to a GPU, they're intermittently connected, they span years of hardware generations, and I can't log into any of them. So three assumptions I'd normally lean on are gone: that I can reach every instance, that they all look alike, and that I can go and look when something is wrong. Almost everything I design after this is a consequence of those three, so I'd rather say them out loud now than discover them during a rollback.

  2. 3–7 min

    Why the cloud round trip fails here

    I'd start from the simplest thing that works — every device sending every inference to a central server — and say why I'm leaving it. It stacks a network round trip onto every request, so anything real-time is already out. The cost scales directly with fleet size and total request volume rather than with how many models I run. And the device stops working entirely the moment its connection drops, which for a car in a tunnel or a rural sensor isn't an exception, it's normal. More server capacity fixes none of those three, so at least some of the inference has to happen on the device itself.

    Built in step 1: Every request goes to the cloud
  3. 7–13 min

    Make it fit the hardware

    That means the model has to fit, and one sized for a datacenter GPU generally doesn't. So the first thing in the control plane is a compression pipeline — quantization, distillation, pruning — producing a separate, edge-ready artifact, versioned apart from the full-size serving model. I'd frame that as a deployment requirement rather than an optimization, because it is the difference between running on the target hardware at all and not running. And I'd state the trade plainly: I'm giving up some accuracy to get something that executes inside a real memory, compute and battery budget.

    Built in step 2: A datacenter model doesn't fit on a phone
  4. 13–18 min

    Run it locally, offline-capable

    Once the compressed model is on the device, the device runs inference locally and stays useful offline. That's what actually answers the objections to the cloud version — no per-request latency, no per-request bandwidth, and it keeps working when the network doesn't. The dependency hasn't disappeared, it's moved: the device still needs a connection to receive an update, but that's infrequent and tolerant of delay, which is a completely different requirement from needing a live network on every single request.

    Built in step 3: The device shouldn't need a live connection to function
  5. 18–25 min

    Rollback is the interesting half

    This is where I'd spend the most time, because it's where edge stops resembling anything server-side. Rolling a version out is a staged rollout manager expanding availability gradually while I watch for problems. Rolling one back is not the same operation it is on a server. On a server every instance is connected, so repointing a version reference is close to instant. Here, a device that's offline through the whole rollback window simply doesn't receive it, so "rolled back" really means "the correction is now waiting for you to check in." The fleet is genuinely inconsistent for an unpredictable stretch — some devices corrected, some still on the bad version — and I'd design for that window rather than pretend it away.

    Built in step 4: You can't instantly reach every device
  6. 25–31 min

    Deliver it cheaply

    Delivery is its own problem once you multiply it by the fleet. I wouldn't push the whole model every time — a delta updater ships only the changed weights, and I'd deliver opportunistically, preferring WiFi and charging over forcing a large download onto someone's metered cellular connection and their battery. The point I'd make is that bandwidth-consciousness applies to the update mechanism, not just to the size of what I deployed. A well-compressed model shipped badly still costs real money and real battery at fleet scale.

    Built in step 5: Don't push the full model every time
  7. 31–36 min

    See a fleet you do not control

    For visibility I'd collect lightweight, aggregate, privacy-conscious telemetry — error rates, latency, resource usage — reported opportunistically when connectivity allows, rather than streamed. Partly that's because I don't have deep access and shouldn't want it, and partly because telemetry that is itself a meaningful battery and bandwidth cost is a bug rather than a feature. It's a deliberately weaker signal than datacenter monitoring and I'd say so, but it's enough to tell me whether a deployed version is behaving out there.

    Built in step 6: You can't SSH into a customer's phone
  8. 36–41 min

    The two sharp edges

    Two things I'd raise before being asked. Fleet heterogeneity: some devices genuinely can't run the newest version, so I'd keep a fallback path — a smaller, older or simpler variant — rather than force an incompatible deployment or leave weaker devices with no working inference at all. And the stranded device: on reconnect, every device checks its own version against a version manifest holding the known-good current version, and pulls the correction itself instead of trusting that a push reached it while it was dark. I'd also sunset very old versions on a defined timeline rather than carrying every historical version forever.

    Built in step 8: Devices that verify, and versions that eventually sunset
  9. 41–45 min

    Close on the trade

    So the trade running through all of it: I'm buying real-time latency, offline function and cost that stops scaling with request volume, and paying for it with accuracy lost to compression, a rollback that's eventually consistent instead of instant, and much weaker observability than I'd have in a datacenter. With more time I'd go at two things I've left open. First, who owns the update channel — if the model ships inside the app release rather than on its own path, every model fix inherits that channel's review and install lag, and the control plane I've drawn stops deciding when a fix lands. Second, retirement: at some point the weakest hardware costs more to keep building for than it returns, and I'd want a stated rule for when we stop, and an answer for what those devices do on the day we do — "no more new versions" has to mean something better than an app that quietly goes wrong.

What this teaches

Learn AI system design by building the platform that deploys and manages ML model inference across a large fleet of edge devices — phones, IoT sensors, retail kiosks, cars — not centralized datacenter serving. An interactive guide covering why every request going to the cloud fails at fleet scale, model compression to fit severe on-device resource budgets, offline-capable on-device inference, staged fleet-wide rollout that's harder than server rollback because devices go offline, bandwidth-conscious delta updates, telemetry from devices you don't fully control, graceful degradation for weaker devices, and devices that self-heal their model version on reconnect rather than trusting a push to have reached them.

Key takeaways

  • Cloud-only inference fails at fleet scale — latency, cost, and total dependency on connectivity edge devices often don't reliably have.
  • Model compression (quantization, distillation, pruning) is a deployment requirement for fitting severe on-device resource budgets, not an optional optimization.
  • On-device, offline-capable inference removes per-request latency and bandwidth cost, and keeps devices functional without a live connection.
  • Fleet-wide rollback is eventually consistent, bounded by each device's own reconnect timing — fundamentally different from near-instant server rollback.
  • Delta updates and opportunistic delivery timing respect real bandwidth and battery constraints at fleet scale.
  • Telemetry is lightweight, aggregate, and opportunistic, respecting both device constraints and privacy, within the limits of what you actually control.
  • Graceful degradation via fallback model variants serves fleet hardware heterogeneity rather than assuming one uniform target.
  • Devices actively self-check their version against a known-good manifest on reconnect, rather than passively trusting a push arrived while offline.

Concepts covered

  • Millions of devices you don't fully control
  • Every request goes to the cloud
  • A datacenter model doesn't fit on a phone
  • The device shouldn't need a live connection to function
  • You can't instantly reach every device
  • Don't push the full model every time
  • You can't SSH into a customer's phone
  • Not every device can run the latest model
  • Devices that verify, and versions that eventually sunset
RUN IT YOURSELF

The health gate that reaches quorum before a broken device can speak

A 600-device fleet takes a model version that will not run on a quarter of its hardware — pushed to everything, and staged behind a health gate that refuses to promote until enough devices have reported and few enough of them failed. It runs each policy over 9 independently hashed fleets and prints the median, the range and how often the gate held the first stage, because on a single fleet this number is a coin flip. Change STAGE_HOURS, hit Run, and watch the range collapse as the window crosses the fleet's check-in round trip.

HOW TO READ THE CODE — 5 IDEAS
  1. A device's stage bucket is a hash of its own id, so it survives reinstalls and costs the control plane no row per device (step 4).
  2. The gate is not naive and it promotes anyway: the 2% cohort holds 15 devices, and by h12 the gate had heard from 10 of them with zero failures — the same cohort shows 3 failures by h240. The cohort was never healthy; the sample was (steps 4 and 6).
  3. So a 12h window breaks a median of 130 devices over a range of 5–143, holding the version at 2% on only 2 draws of 9 — a lottery, not a control. The window is the whole mechanism and its size is computed, not chosen: a device adopts on one check-in and reports on the next, so ROUND_TRIP = 2 × the slowest period = 240h, where it is 4 broken, range 2–7, held at 2% on 9 of 9.
  4. Raising MIN_REPORTS is not the fix. 16 looks safe at 600 devices only because a 2% cohort of 15 can never supply 16 reports — the gate jams open. At 2400 devices every value in the sweep breaks 549 (step 7).
  5. Rollback is not an event: 3 versions run at once for 203 of 720 hours, and the last device is corrected 114h after the server called it rolled back, because that is how often it checks in (steps 4 and 8).
CPython · WebAssembly
built so a device offline for a bad rollback window heals itself the moment it reconnects — make the calls, strand a device, run the gauntlet.
Finished this one? 0 / 65 AI System Designs done
NextDesign ChatGPT Closest AI system design to this one

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More AI System Designs