← 03 / BLOG

How many steps to fit an LLM on a phone

Quantization, pruning and picking an inference engine — notes from an on-device experiment.

NOV 30, 20261 MIN READEngineeringSERIES · Agents in practice744 READS# Demo# LLM
Sample cover MODEL

The goal was simple: run a small chat model on an ordinary phone with under one second to first token.

Steps

  1. Pick a model around 1B parameters
  2. Quantize to 4-bit with acceptable accuracy loss
  3. Switch to a mobile-optimized inference engine
  4. Cache KV to avoid recomputation
bashbash
python quantize.py --bits 4 --group-size 128 --model ./base

Result: 0.8 s to first token, 18 tokens per second.

COMMENTS

Sign in to comment — coming soon.