LLM Hub Studio · Blog

What Is LiteRT-LM? Running LLMs on Phones in Production

LiteRT-LM is Google's runtime for running large language models entirely on a phone. Here's how it works, what it can and can't do, and what it takes to ship with it.

What Is LiteRT-LM? Running LLMs on Phones in Production

Most LLM features in apps today are a network call in disguise: the user types, the phone sends the text to a server, the server thinks, and the answer comes back. That works until there is no signal, until the data is too sensitive to send anywhere, or until the per-request bill grows faster than the business.

LiteRT-LM is Google's answer to that problem. It is a runtime that lets an Android app run a large language model entirely on the phone — no server, no account, no data leaving the device. This article explains what it is, how it works, what it is good at, and what it honestly takes to ship a production feature on it.

What LiteRT-LM actually is

LiteRT-LM is a high-level library for running LLMs on-device, built on top of LiteRT — Google's lightweight runtime for on-device machine learning, formerly known as TensorFlow Lite. Under the hood it uses the MediaPipe LLM Inference API, which handles the messy parts of LLM inference: loading quantized weights, managing the context window, and streaming tokens back as they are generated.

The important word is "high-level". Raw LiteRT gives you tensors in and tensors out. LiteRT-LM gives you something a product team can actually work with: load a model, start a session, send a prompt, receive a stream of text. It is designed for app developers, not ML researchers.

It is built around Google's Gemma family of open models — small, capable models designed specifically to run on-device. That pairing is the point: LiteRT-LM plus a Gemma model is a complete, shippable on-device chat stack with no cloud dependency at all.

How it works on the phone

Running an LLM on a phone sounds implausible until you look at the three tricks that make it possible.

Quantization. A model's weights are normally stored as high-precision numbers. Quantization compresses them to fewer bits per weight — typically 4 or 8 — which shrinks the model file dramatically and makes it fast enough for a phone's processor. The trade-off is a small loss in output quality, which is why choosing the right quantization level is one of the most important decisions in an on-device project. Too aggressive and the model starts giving vague or wrong answers; too conservative and it won't fit or runs too slowly.

Hardware acceleration. Modern phones have dedicated AI hardware: GPUs and NPUs (neural processing units) built for exactly this kind of math. LiteRT-LM routes inference through LiteRT's delegates, which hand the heavy work to the GPU or NPU instead of the general-purpose CPU. The same model can feel fast on a flagship and sluggish on a three-year-old budget phone, which is why real-device testing matters so much.

Streaming and the KV cache. When you chat with an on-device model, it generates one token at a time and streams each token to the UI as it appears — the same typing effect you see in cloud chatbots. Behind the scenes, a key-value cache (KV cache) stores the model's memory of the conversation so far, so each new token doesn't require re-reading the whole chat history. The size of that cache is part of why the context window matters: longer conversations need more memory.

Put together, the flow is simple from the user's perspective: the model downloads once, loads into memory, and then every prompt is answered on the spot. Our own work uses the same building blocks — OpenSleep's on-device AI sleep coach runs on LiteRT-LM with a Gemma model, and LLM Hub runs quantized LLMs entirely on-device for chat and other features. No signal, no accounts, no tracking: prompts, images and outputs never leave the device.

What you can build with it

The best LiteRT-LM features are the ones where on-device is a genuine advantage, not just a novelty:

  • A personal coach or assistant that knows the user's data without that data ever leaving the phone. A sleep coach, a fitness companion, a journaling helper — anything where the input is private by nature.
  • Summarization and rewriting of the user's own content: notes, messages, documents, meeting transcripts. The text is already on the device; sending it to a server adds risk for no benefit.
  • Offline chat for field work, travel, flights, hospitals and anywhere else with unreliable signal. If your users work where connectivity is a luxury, on-device is the only option that always works.
  • Translation and transcription helpers that run locally, keeping conversations and recordings private.
  • Guided flows where the model follows a tight script — onboarding, troubleshooting, structured data entry — and its outputs are constrained enough to be reliable.

The common thread is that the model is close to the user's data and available at all times. If your feature doesn't benefit from either of those, a cloud API is probably simpler.

The honest limits

On-device LLMs are real, but they are not magic. Anyone planning a LiteRT-LM feature should go in with eyes open about the constraints.

Model size vs. capability. The models that fit comfortably on a phone are far smaller than the frontier models running in data centres. They are excellent at summarization, rewriting, classification, structured extraction and guided conversation. They are weaker at open-ended reasoning, obscure knowledge and long multi-step tasks. Pick the use case to fit the model, not the other way around.

Memory and thermals. A quantized model is still measured in gigabytes, and it has to share the phone's RAM with everything else. Sustained generation heats the phone up, and a hot phone throttles — your benchmark on a cold device in the office is not the performance your user gets after ten minutes of use. Test warm, test on low-end hardware, and test with other apps running.

First-token latency. The time between the user hitting send and the first word appearing depends on how much context the model has to process first. Long conversation histories and long pasted documents make this worse. Design the experience around it: stream tokens early, keep system prompts tight, and consider summarising older conversation turns instead of keeping everything in context.

No training on-device. LiteRT-LM is an inference runtime. It runs a model; it doesn't train one. If you need the model to learn a new skill, that work happens beforehand, and the result is shipped as an updated model file. There is support for lightweight adaptation techniques such as LoRA adapters, which let you specialise a base model without retraining it from scratch — but that is still a build-time activity, not something the phone does live.

Supported models are narrow. LiteRT-LM is centred on the Gemma family. If your product depends on a different model family, check support before you commit: conversion may be possible, but it is work, and some architectures simply aren't supported.

LiteRT-LM vs. a cloud LLM API

There is no universally right answer — only trade-offs that fit a given product:

  • Privacy: on-device wins outright. Prompts never leave the phone, so there is nothing to leak, nothing to subpoena from a server, and no third-party data processor in the loop.
  • Offline: on-device works anywhere. Cloud features stop working the moment the connection does.
  • Latency: on-device answers start fast and stay consistent, with no network round trip. Cloud answers depend on the connection and on server load.
  • Cost: on-device has no per-request bill — you pay once to build and ship it. Cloud APIs charge per token, which is cheap at first and becomes the dominant cost line as usage grows.
  • Capability: cloud wins for the largest models, the hardest reasoning, and features that need tools and retrieval across huge datasets.
  • Updates: cloud models can be swapped server-side in minutes. On-device models ship inside the app, so updates ride along with app releases or a model-download flow you build yourself.

Many serious products use both: on-device for the private, everyday, offline-capable features, and the cloud for the occasional heavy lift. That hybrid is often the right architecture — but it is also twice the work, so start with the side your users actually need first.

Shipping LiteRT-LM in production

If you decide to build on it, here is the checklist we would use before calling a feature done:

  1. Pick the model and quantization together. Test the smallest model that does the job well, at the most aggressive quantization that doesn't degrade quality. Evaluate on your actual prompts, not on generic benchmarks.
  2. Design the download. The model is a large file. Download it on Wi-Fi by default, show real progress, let the user defer it, and never block the rest of the app while it downloads.
  3. Test on real devices. Emulators hide the truth. Test on the cheapest phone you support, with a warm device, low battery and a nearly full storage. Watch for crashes from memory pressure, not just slow answers.
  4. Measure what users feel. Time to first token, tokens per second, and how often the model gives a useless or wrong answer. Those three numbers tell you more than any benchmark.
  5. Plan model updates. Models improve, and so will yours. Decide early how a new model version reaches users — bundled in an app update, or downloaded in the background — and how you roll back if a new version is worse.
  6. Have a fallback. Decide what the app does when the model can't load: not enough memory, a corrupted download, an unsupported device. A graceful fallback beats a crash every time.
  7. Check the licence. Gemma models ship under their own terms of use, which cover what you can and can't do commercially. Read them before you ship, not after.
  8. Keep the prompts honest. An on-device model will confidently invent facts if you let it. Ground it in the user's own data, constrain the output format, and don't present its answers as verified truth when they aren't.

When to choose it

Choose LiteRT-LM when privacy, offline availability or per-request cost is the deciding factor — and when the task fits what a small on-device model does well. It shines for personal, private, always-available features, and it is the right default for apps that promise their users nothing leaves the device.

Choose a cloud API when you need the biggest models, the hardest reasoning, or rapid iteration on the model itself without shipping app updates.

And if you're unsure, prototype it. A minimal LiteRT-LM demo — one Gemma model, one screen, one prompt — can be built quickly, and it answers the only question that matters: does this model, on this phone, do this job well enough for your users? Everything else is discussion.

If you're weighing on-device AI for your own app and want a team that has shipped it — including a LiteRT-LM-powered sleep coach and an app running 15+ AI models entirely on-device — LLM Hub Studio builds exactly this kind of product. Reach us at timmy@llmhub.com.au.

LiteRT-LMon-device AImobile LLMGemmaAndroid AI

Questions

Is LiteRT-LM free to use?

LiteRT-LM itself is Google's open runtime for on-device LLM inference, and using it costs nothing per request — there is no API bill, because the model runs on the user's phone. You still need to respect the licence of whichever model you ship, and you pay the usual costs of app development, testing and distribution.

Which models run on LiteRT-LM?

LiteRT-LM is built around Google's Gemma family of open models, which are designed to run on-device. Support is centred on Gemma; other model families need conversion into the formats LiteRT understands, and not every architecture is supported. Check the current supported-model list before committing to a model.

Does LiteRT-LM work offline?

Yes. Once the model weights are on the device, inference happens entirely on the phone — no signal, no server, no round trip. The model usually needs to be downloaded once, so plan for that first download and for how you ship updates.

How much memory does a LiteRT-LM model need?

Model files are measured in gigabytes even after quantization, and the phone needs enough free RAM to hold the weights plus the context window while it generates. Smaller quantized models run on more devices; larger ones need flagship hardware. Test on the lowest-spec device you plan to support.

Can LiteRT-LM run on iOS?

LiteRT-LM targets Android first, and the underlying LiteRT stack is cross-platform. If you need the same feature on iOS, plan the port early: the model, the quantization and the prompt behaviour can be shared, but the integration and the hardware acceleration path differ per platform.

When should I choose LiteRT-LM over a cloud LLM API?

Choose on-device when privacy, offline use or per-request cost matters most — for example a personal coach, a writing assistant or anything handling sensitive input. Choose a cloud API when you need the largest frontier models, heavy reasoning or features that don't fit in a phone's memory. Many apps end up using both.