Skip to main content
AI Engineering

What is on-device AI?

By Yohan Choi ·

Short answer

On-device AI means the model runs on the user's own hardware, such as a laptop, a phone or the browser itself, instead of on a provider's server. Prompts and data never leave the device, it can work offline and there is no per-request API cost, in exchange for smaller models and a one-time download.

How can a model run in a browser or on a laptop?

Small open-weight models, compressed with quantization, now fit in a few gigabytes. On a computer, a runtime like Ollama loads them and serves them locally. In the browser, WebLLM uses WebGPU to run the model on the visitor's graphics hardware, with no server involved.

This site's assistant, Ask the lab, works this way. It runs Gemma 2 2B in the browser through WebLLM and answers from the site's own pages, so questions are never sent anywhere.

What do you gain?

  • Privacy: prompts, documents and answers stay on the device, which is easy to explain to users and compliance teams.
  • Cost: there is no bill per request, so usage can grow without the cost growing with it.
  • Availability: it works offline and does not depend on a provider's rate limits or outages.

What do you give up?

  • Capability: a model that fits on a laptop is far smaller than a frontier model, so it needs narrower tasks and good context.
  • First run: the model has to be downloaded once, often a few gigabytes, and needs a recent browser or enough memory.
  • Hardware spread: speed varies widely from one user's device to the next.

When is on-device the right choice?

It fits narrow, frequent tasks over private data: answering from a known set of documents, classifying, summarizing or drafting. A common pattern is to handle most requests on the device and send only the hard ones to a larger hosted model.