by Samy (Kondasamy Jayaraman)

Module 57 · Models on your device

Intermediate

Pack the model into the phone

A model on a phone must fit its memory and spare its battery; in return, nothing leaves the device. Here its memory is bricks packed into a crate and its battery is a water tank: pack one, drain the other, and see what stays.

Read as

The whole idea in one example

One reply, rounded

16 bits

full size

Returns are accepted within five business days.

Larkspur mini at full precision, as chapter 2 runs it live in your browser.

8 bits

half the bytes

Returns are accepted within five business days.

The same words. At 2 bits: “days days days days days days days days”.

Larkspur mini is tiny, so its replies show the mechanism, not a real product’s quality. The handheld’s memory, battery and speed are Larkspur’s planning numbers; the 1B and 3B take Llama 3.2’s published sizes.

How it works

Four ideas carry the module

  1. 1 Will it fit?

    Parameters times bytes, against the free memory

    Meta’s Llama 3.2 model card lists its small models at 1.23 and 3.21 billion parameters, made for constrained places such as mobile devices.

    Source, checked 30 October 2026

  2. 2 Smaller numbers

    Fewer bits per weight, fewer bricks

    Apple said in June 2024 that its on-device model has about 3 billion parameters, stored at an average of 3.7 bits per weight, and writes about 30 tokens a second on an iPhone 15 Pro.

    Source, checked 30 October 2026

  3. 3 The working memory

    Every token of context adds to the cache

    Llama 3.2 1B keeps 16 layers of 8 key-value heads of 64 numbers each; the 3B keeps 28 layers of 8 heads of 128, as their published configs give.

    Source, checked 30 October 2026

  4. 4 The battery tank

    Every token written costs energy

    Laskaridis et al. (MELTing point, 2024) measured 0.16 to 0.21 mWh per token for 3-billion-parameter models on phones: about 490 to 590 replies of 135 tokens on one full battery.

    Source, checked 30 October 2026

The story

Larkspur’s back aisles

Larkspur Supply Co. wants its stock-lookup assistant on the warehouse handhelds, working offline in the back aisles. You’re on the team that packs the handheld.

2.00 GB
free memory on Larkspur’s handheld (planning number)
6.42 GB
the 3B model’s weights at 16 bits
1.60 GB
the same weights at 4 bits
3,750
short replies per charge; a shift asks 600

Your path

The chapters

  1. Chapter 1

    Will it fit?

    Will a model fit in the handheld’s free memory?

  2. Chapter 2

    Smaller numbers

    How few bits can a weight keep before the reply breaks?

  3. Chapter 3

    The working memory

    How much memory does the context take, and when does it overflow?

  4. Chapter 4

    The battery tank

    How many replies does one charge give, and what decides it?

  5. Chapter 5

    Heat and speed

    What happens to speed when the handheld runs hot?

  6. Chapter 6

    What never leaves

    What leaves the handheld, and when should it fall back to the cloud?

  7. Chapter 7

    Pack the handheld

    Which setup answers well, fits, stays private and lasts a shift?

Who it’s for

  • Engineers
  • Product managers
  • Analysts
  • No code needed

Anyone asked whether a model can run on a phone, a laptop or a handheld. The Inference engineering module (running models on servers) helps first, but no maths is needed.