LLM Hub Studio · Blog

Quantization for Production: Shipping LLMs That Fit on a Phone

Quantization is what turns a server-sized language model into an app that runs on a phone. Here's how it works, what it costs in quality, and how to ship it without breaking your users.

Quantization for Production: Shipping LLMs That Fit on a Phone

Quantization for Production: Shipping LLMs That Fit on a Phone

A modern language model at full precision is a data-centre workload. Its weights — the billions of numbers the model learned during training — are typically stored as 16-bit floating point numbers, and a capable model can easily need tens of gigabytes of memory just to load. That is fine on a server. It is impossible on a phone.

Quantization is the technique that closes that gap. It is the reason a phone can now run a capable language model entirely offline, with no signal, no account and no data leaving the device. If you are building an on-device AI app, quantization is not an optimisation you add at the end — it is the decision that determines whether your app can exist at all.

What quantization actually does

Every weight in a neural network is a number. At full precision, each one is stored as a 16-bit float (FP16) or a 32-bit float (FP32). Quantization re-encodes those numbers at lower precision: 8-bit integers (INT8), 4-bit integers (INT4), and sometimes even lower.

The effect on size is dramatic. Halving the bits per weight halves the model file, and the savings compound:

  • FP16 to INT8 roughly halves the model and the memory needed to load it.
  • FP16 to INT4 cuts it to roughly a quarter — a model that needed 16 GB now needs around 4 GB, before any other compression.
  • INT4 with further packing tricks can push capable models down into the 2–4 GB range, which is where a phone app becomes realistic.

But quantization is not just about storage. On a phone, memory bandwidth and power matter as much as disk space. Smaller weights mean less data to move from memory to the processor on every token, which means faster responses and less battery drain. The phone's neural engine — the NPU — is also built around integer arithmetic, so quantized weights often run faster on the hardware that is actually in the device.

The quality trade-off, honestly

Quantization is lossy. You are throwing away information, and some of it was load-bearing. The question is how much quality you lose, and whether your users will notice.

In practice, the answer depends on the precision level and the method:

  • INT8 quantization is close to lossless for most models. For many tasks you would need a side-by-side test to tell the difference. It is the safest starting point, and on devices with plenty of memory it is often the right answer.
  • INT4 quantization is the workhorse of on-device AI. A well-quantized 4-bit model keeps most of the original's capability for chat, summarisation, translation and coding assistance. There is a measurable quality drop on hard reasoning tasks, but for the everyday prompts inside a mobile app it is usually invisible.
  • Below 4 bits the degradation becomes real. Two-bit and one-bit methods exist, and they are improving fast, but for a production app in 2026 they are still a research choice, not a shipping choice.

The method matters as much as the bit-width. Naive rounding — simply rounding every weight to the nearest representable value — loses more quality than necessary. Modern methods are smarter: they protect the small number of weights that matter most, use per-channel or per-group scales instead of one scale for the whole model, and calibrate on real example data so the quantizer knows which errors hurt. Two models quantized to the same bit-width can behave very differently depending on how they were quantized.

Choosing a quantization strategy for your app

There is no single right answer. The choice depends on your model, your hardware targets and your quality bar. A few practical rules:

Start from the runtime, not the model. Your inference engine decides which formats are fast. LiteRT-LM, for example, is built for running LLMs on phones and supports the quantized formats that make sense on mobile hardware. Pick a format your runtime accelerates well on CPU, GPU and NPU — a format that is theoretically small but runs slowly on your target chips is worse than a slightly larger format that flies.

Match the precision to the task. A chat assistant that answers casual questions can live happily at 4 bits. A code-generation feature or a tool that needs precise, structured output may deserve 8 bits for the model doing that job. Many apps ship more than one model at more than one precision — LLM Hub, for example, runs 15+ AI models entirely on the phone, with quantized LLMs across CPU, GPU and NPU, choosing the right model and the right precision for each feature rather than forcing one model to do everything.

Mind the memory ceiling, not just the file size. A phone app's memory budget is shared with the operating system, the camera, and every other app in the background. The model file on disk is only part of the story — the runtime also needs working memory for the context window and the key-value cache, which grows with conversation length. A model that loads fine in a demo can still be killed by the OS during a long conversation on a phone with less RAM. Size your model for the phones your users actually own, not the flagship on your desk.

Test on real devices, early. This is the single most important rule. Desktop benchmarks lie by omission: they tell you the model is fast on a machine with unlimited cooling and power. Phones throttle. They get warm, slow down, and stay slow until they cool. A quantized model that generates 20 tokens per second in a benchmark can drop to half that after a minute of sustained use on a mid-range phone. Test load time, time to first token, sustained speed, battery drain, and answer quality on your real prompts, on the oldest phone you intend to support.

The quantization pipeline in practice

For a production app, quantization is a repeatable build step, not a one-off experiment. A typical pipeline looks like this:

  1. Pick the base model and validate its quality at full precision on your actual prompts. If the full model cannot do the job, no amount of quantization will save it.
  2. Quantize with calibration data that matches your use case. Calibration on generic text gives generic results; calibration on your app's real prompts protects the behaviour your users will actually see.
  3. Evaluate the quantized model against the original on the same prompts, with the same scoring. Look at failures, not just averages — a model that is 2% worse on average but catastrophically worse on one prompt type has a bug, not a rounding error.
  4. Benchmark on devices. Load time, tokens per second, memory use, battery drain, and thermal behaviour on your minimum supported device.
  5. Ship the quantized file as an asset in the app or as a downloadable model, with versioning so you can update or roll back without shipping a new app build.
  6. Re-quantize on every model update. Quantization is tied to a specific set of weights, so a new model version means a new quantized file. Build this into your release process from day one — it is much harder to retrofit than it looks.

What quantization makes possible

Quantization is the enabling technology behind the whole on-device AI category. Without it, there is no offline AI app — only a client for a server. With it, a phone becomes a self-contained AI computer: chat, image generation, music, code assistance, translation and transcription, all running locally.

The most interesting consequence is privacy. When a quantized model runs on the phone, prompts, images and outputs never leave the device. There is no server log, no account, no tracking. OpenSleep's AI sleep coach works the same way — a Gemma-powered coach running on LiteRT-LM on the phone itself, analysing sleep data locally rather than uploading it. That privacy story only exists because quantization made the models small enough to live on the device in the first place.

It also changes the economics. On-device inference has no per-token API bill: once the app is installed, the cost of answering a prompt is the user's battery, not your server budget. That is what makes a one-time purchase model viable for an AI app, and it is why the economics of on-device AI look so different from the economics of a cloud API.

The future: smaller, smarter, on-device

Quantization is still improving. Better methods squeeze more quality out of fewer bits, runtimes get faster at integer math, and phone NPUs get more capable every year. Models that needed a server two years ago run on a phone today — the RunAnywhere case study behind LLM Hub's iOS port showed models up to 31B parameters running on iPhone, something that would have sounded absurd not long ago.

The direction of travel is clear: the models keep getting better at lower precision, and the phones keep getting better at running them. For a product team, the practical implication is simple — the question is no longer whether a capable model can fit on a phone. It is which model, at which precision, for which feature, on which devices. Quantization is how you answer that question, and it is the first engineering decision of any serious on-device AI product.

If you are planning an AI app that runs on-device, that is exactly the kind of decision LLM Hub Studio helps teams make. We are an Australian software studio specialising in on-device AI app development — private, offline-first AI that runs on phones, laptops, browsers and edge hardware. If you want to talk through model choice, quantization strategy or what your app could do entirely on-device, reach out at timmy@llmhub.com.au.

quantizationon-device AImobile LLMLLM engineeringoffline AI

Questions

What is quantization in simple terms?

Quantization is a compression technique that stores a model's weights at lower numerical precision — for example, using 4-bit integers instead of 16-bit floats. A model that needs tens of gigabytes of memory at full precision can shrink to a few gigabytes, small enough to load and run on a phone.

Does quantization make an AI model noticeably worse?

For most everyday tasks — chat, summarisation, translation — a well-quantized model is very close to the original. Quality loss depends on the method and the precision level: 8-bit quantization is usually near-lossless, 4-bit is the common sweet spot for phones, and 2-bit starts to show real degradation. The right choice depends on the task and the hardware.

Can a quantized LLM run entirely offline on a phone?

Yes. Once quantized, the model file ships inside the app and runs on the phone's CPU, GPU or NPU with no network connection. Prompts, images and outputs never leave the device. LLM Hub, for example, runs 15+ AI models entirely on the phone, using quantized LLMs on CPU, GPU and NPU.

Which quantization format should I choose for my app?

It depends on your target devices and quality bar. INT8 is the safest starting point for near-original quality. INT4 is the practical choice for phones, where memory and battery matter most. Start with a format your inference runtime supports well — LiteRT-LM, for example — and validate quality on real devices before you commit.

How do I test a quantized model before shipping?

Benchmark on the actual phones your users own, not just the latest flagship. Measure load time, time to first token, sustained speed under thermal throttling, battery drain, and answer quality on your real prompts. A model that looks great in a desktop benchmark can still stutter on a mid-range phone.

Do I need to re-quantize when I update my model?

Yes — quantization is tied to a specific set of weights, so a new model version means a new quantized file. Plan your update pipeline around that: ship model updates as downloadable content with versioning and rollback, and test each quantized build the same way you would test the original model.