Book a free call

Edge AI Best Practices: Run Models Where Data Lives

Edge AI runs models on the device instead of in the cloud, which cuts delay and keeps data local. These practices cover model choice, shrinking, testing and updates.

Hertiv engineering teamReviewed by a senior engineer
6 min read
Edge AI Best Practices: Run Models Where Data Lives
On this page

Short answer

Edge AI works best when you pick a small model for the job, shrink it to fit the device, test it on real hardware, and plan updates from the start. Keep sensitive data on the device, measure accuracy on a fixed test set, and watch for drift once the model is live. The goal is a model that answers fast without sending every input to the cloud.

What is edge AI?

Edge AI is AI that runs on the device that collects the data, such as a camera, a phone or a factory sensor, instead of sending the data to a cloud server for processing. The model lives where the input is created, so the answer comes back in milliseconds and the raw data never has to leave the device.

Teams pick edge AI for three reasons: speed, privacy and offline use. A camera that spots a defect on a production line cannot wait for a round trip to the cloud, a hospital device should not send patient data to a server, and a farm sensor has no reliable connection at all.

AspectOn the edgeIn the cloud
DelayMillisecondsDepends on the network
Raw dataStays on the deviceLeaves the site
Works offlineYesNo
Model sizeSmall, fitted to the deviceAs large as you like

Edge AI is not a replacement for cloud AI. The two work together: the device handles the fast, local decisions, and the cloud handles training, heavy analysis and anything that needs the full dataset. For the basics, see what edge AI is and how it works.

How do you pick a model for the edge?

Pick a model by starting from the decision the device must make, not from the model you already have. Write down what the model must detect, how fast it must answer, and how often it may be wrong. A model that is 98 percent accurate but needs two seconds is useless on a line that moves every second.

Small, task-specific models usually beat large general ones on the edge. A classifier trained on one kind of defect, or a detector trained on one product line, needs far less memory and runs far faster than a general model that covers everything.

Set a latency budget and an accuracy floor before you compare models. Measure both on the target device, not on a laptop, because the chip in the device is usually slower and has less memory. A model that passes on a laptop can fail on the device it is meant for.

How do you shrink a model without breaking it?

Shrink a model in small steps and measure accuracy after each one, so you know which step caused a drop. The three common methods are quantization, pruning and distillation, and they can be combined.

Quantization stores the model weights with fewer bits, which cuts size and speeds up the math. Pruning removes weights that contribute little to the result. Distillation trains a small student model to copy the answers of a larger teacher model.

Keep a fixed test set and a pass bar for every shrink step. If accuracy falls below the bar, stop and try a different method or a smaller change. A model that is small but wrong is worse than a model that is slightly larger and right.

How do you handle data on the device?

Handle data on the device by keeping the raw input local and sending only the result. A camera can send a count of defects instead of the video, and a sensor can send an alert instead of a full day of readings. Less data leaving the device means less to protect and less to pay for.

Encrypt anything the device stores, and give the device its own credentials so a stolen unit cannot reach the rest of the system. Old data should be deleted on a schedule, not kept because storage is cheap.

Decide in advance what leaves the device and why. Training data, error cases and usage counts each need their own rule, and the rule should be written down before the first device ships.

How do you test an edge model before shipping?

Test an edge model on the actual hardware it will run on, with the same lighting, noise and inputs it will meet in the field. A model tested only on clean lab data will fail on the first real input that looks different.

Build a fixed test set from real field data, including the hard cases: poor light, worn labels, background noise and half-covered objects. Measure accuracy, latency and power use together, because a model that is accurate but drains the battery in an hour is not shippable.

Test the failure modes, not just the happy path. Feed the model inputs it should reject, and check that it says it does not know instead of guessing. A confident wrong answer on the edge can stop a line or send a false alert.

How do you keep an edge model working after release?

Keep an edge model working by planning updates and monitoring from day one. Models drift as the world changes: new products, new lighting, new packaging. A model that was right in January can be wrong by June.

Ship updates over the air in small batches, and keep a rollback path so a bad update can be undone fast. Log a sample of decisions and review them weekly, so you spot drift before customers do.

Set a review cadence for the model itself. Every few months, compare the live model against a fresh test set and decide whether to retrain, adjust or leave it alone. For the build steps that come before this, see how to implement edge AI step by step.

Example (hypothetical): a warehouse scanner that reads labels

Example (hypothetical): a warehouse uses handheld scanners to read parcel labels. Today each scan goes to the cloud: the scanner sends a photo, waits for the answer, and the worker moves on. The round trip takes 2 seconds per parcel, and the warehouse handles 2,000 parcels a day.

That is 2,000 x 2 seconds = 4,000 seconds, or about 67 minutes a day spent waiting for answers. The team moves the reading model onto the scanner itself, where it answers in 0.2 seconds per parcel.

Now the wait is 2,000 x 0.2 seconds = 400 seconds, or about 7 minutes a day. The team saves about an hour a day, and scanning keeps working when the network drops. The cloud still trains the model and collects error cases, but the daily work no longer depends on it. Before budgeting the move, the team checks what edge AI costs.

What are the common mistakes?

The most common edge AI mistakes are picking the model before the job, testing on the wrong hardware, and shipping with no update plan.

  • Starting from the model. A large general model that needs a server will not fit a sensor, no matter how good it is.
  • Testing on a laptop. Latency and memory on a laptop say nothing about the chip in the device.
  • No update plan. A model with no update path is frozen at the day it shipped, and drift will follow.
  • Sending everything to the cloud. If the raw data leaves the device anyway, the edge model adds cost without adding value.
  • Ignoring power use. A model that drains the battery in an hour will not survive a shift.
  • No rollback. A bad update with no way back can take a whole fleet offline.

Write the job down first, test on the real device, and keep a way to update and undo. The rest follows from those three habits.

Key takeaways

  • Start from the decision the device must make, then pick a model that fits it
  • Shrink models in small steps and measure accuracy after each one
  • Keep raw data on the device and send only the result
  • Test on the real hardware with real field data, including the hard cases
  • Plan updates, monitoring and rollback before the first device ships

Frequently asked questions

What is edge AI?

Edge AI is AI that runs on the device that collects the data, such as a camera, phone or sensor, instead of sending the data to a cloud server. The model answers locally, which cuts delay, keeps raw data on the device and works without a connection.

When should you use edge AI instead of cloud AI?

Use edge AI when the answer must come back in milliseconds, when raw data should not leave the site, or when the device works offline. Use the cloud for training, heavy analysis and anything that needs the full dataset in one place.

How small does an edge AI model need to be?

It must fit the memory and compute of the target device with room to spare, and answer within the latency budget of the job. There is no single size: a sensor and a phone have very different limits, so measure on the real hardware.

Does edge AI work without an internet connection?

Yes, that is one of its main strengths. Once the model is on the device, it can answer without a connection. Updates, retraining and error collection still need a connection, but the daily work does not.

What is quantization in edge AI?

Quantization stores a model's weights with fewer bits, which makes the model smaller and faster to run. It is usually the first shrink step, and the accuracy change should be measured on a fixed test set before shipping.

How do you update an edge AI model?

Ship updates over the air in small batches, with a rollback path so a bad update can be undone fast. Log a sample of decisions and review them weekly, so drift is spotted before it affects customers.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building an edge AI product and need it to run on device? Talk to Hertiv.

A senior engineer replies within one business day. Or see our AI Security service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call