Issued by the memory ration office · 14 October 2026 · rambudget 0.1.0
Counting a Model's Memory Exactly
Parameters, weights and the key-value cache from a model's shape, checked against the library that builds the models
Summary
rambudget counts the memory a decoder-only language model needs from its shape: every parameter, the bytes of the weights in a chosen number format, and the key-value cache for a context and a batch. What it cannot know — framework overhead, working memory — is an input, not a guess. Its counts were compared with models built by the transformers library: 600 of 600 parameter counts and 48 of 48 cache sizes are equal.
Background
On 9 October 2026 MacRumors, citing Nikkei Asia, reported that Apple had asked suppliers to cut component orders for the iPhone 18 Pro for October by at least 15% after lower-than-expected demand [1]. The phones start at $1,199 and $1,299, $100 more than the models they replace; Apple has publicly blamed AI-driven memory chip costs for price rises across its line-up. The Pro models keep 12 GB of RAM; a rumour said 16 GB had been planned and dropped over cost [1].
Not connected. rambudget, this site and $RAMFAM have no connection with Apple, Nikkei Asia, MacRumors or any company that makes memory or AI models, and none of them has seen this bulletin.
The count
For each family the parameters are the embedding (and learned positions where the family has them), the attention projections per layer — fewer key-value heads shrink the keys and values — the feed-forward matrices (three for gated families, × experts for mixtures, plus the router), the norms, and the output layer unless it is tied to the embedding. Weights are priced per format; 8- and 4-bit formats carry their scales, and keep embeddings and norms at 16 bits unless told otherwise. The cache is 2 × layers × key-value heads × head size × bytes for every token of every sequence; a sliding window keeps only the last window − 1 tokens.
The check
A script builds random models of all six families with the transformers library itself, on its "meta" device so they take no memory, and counts their parameters; it also runs 48 tiny models on a CPU and measures the cache they keep. The first run found two real errors in rambudget, both fixed before release: gemma's head size defaults to 256 rather than width ÷ heads (and its output projection takes a bias), and a sliding window keeps window − 1 tokens, not window.
Table 1. rambudget against models built by transformers 5.19.0. Run Parameter counts equal Cache sizes equal First run 520 of 600 39 of 48 After the fixes 600 of 600 48 of 48 Shapes you may know
The counts of the starting shapes equal the counts published for the public models they describe, to the parameter.
Table 2. The starting shapes. Shape Parameters bf16 int4 Cache per token Limits
Six families of decoder-only transformers; other shapes are not counted. Device sizes are treated as GiB. The share of a device's memory one model may use, and the overhead, are yours to set. Quantized files vary by a few percent with the method.
References
- T. Hardwick, MacRumors, 9 October 2026: iPhone 18 Pro orders reportedly cut after a price rise dampens demand (citing Nikkei Asia). macrumors.com
- rambudget 0.1.0, the library on this page (MIT), and its
check/folder.
By order of the ration office · post on the board · do not remove