Tier9AI logoTier9AI

Chapter 03

How AI Models Are Stored and Why Hardware Limits Matter

Understand checkpoints, precision, runtime memory, model provenance, and why many large models exceed a typical laptop without oversimplifying the tradeoffs.

Peter Olson

8 min read

An AI model is not normally stored as an executable application. It is distributed as a set of learned tensors plus enough configuration to reconstruct the computation that uses them. Operating a model safely means understanding both the artifact on disk and the larger memory footprint created at runtime.

This also explains a more precise version of a common claim: many large models do not run comfortably on a typical laptop, but smaller or quantized models often can. The boundary depends on the model, precision, context, software, and hardware—not the label “AI.”

Anatomy of a model artifact

A model package commonly includes:

  • one or more weight files containing tensors;
  • an architecture configuration describing dimensions and model type;
  • tokenizer vocabulary and rules;
  • generation defaults or special-token configuration; and
  • metadata such as license, revision, and intended use.

Large checkpoints are often sharded into several files so repositories, downloads, and loaders can manage them. An index maps parameter names to shards. Sharding the files on disk is not the same as tensor or pipeline parallelism at runtime; it is primarily an artifact-management format.

Framework-native checkpoints can also contain optimizer state, scheduler state, and training progress. Those items are useful when resuming training but unnecessary for a lean inference package. In PyTorch, saving a module's state_dict is generally more portable than serializing an entire live Python object, because application code reconstructs the architecture before loading weights.

Precision changes the weight footprint

A rough lower bound for weight memory is parameter count multiplied by bytes per stored parameter. A seven-billion-parameter model at two bytes per parameter begins near 14 GB for weights alone; lower-bit quantization can reduce that amount. This arithmetic is a planning estimate, not a final capacity figure.

Runtime can add temporary tensors, quantization metadata, kernels, allocator fragmentation, framework overhead, and attention state. Some operations use a higher accumulation precision than the stored weight precision. The model may also require working space during loading or graph compilation. Leave headroom and measure the exact software build on the target device.

Quantization trades numerical representation for smaller memory use and often faster inference. The quality and speed effect depends on the method, hardware support, model, and task. “Four bit” is not a universal performance promise. Evaluate the quantized artifact against representative prompts and quality criteria.

Active requests consume memory too

Weights are only one major memory consumer. Autoregressive servers retain key and value tensors from prior tokens so they do not recompute the entire sequence at every decode step. This key-value cache grows with active token count and depends on the architecture, precision, batching, and parallel layout.

A model that loads successfully can therefore still fail under concurrency or long contexts. Capacity testing should increase prompt length, requested output length, and simultaneous sequences—not merely send one short prompt. Reserve space for peak operational behavior and define what the service does when admission limits are reached.

Why a typical laptop reaches limits

Four constraints commonly appear.

Capacity. The weights, cache, and runtime must fit into available memory. On unified-memory systems, CPU and accelerator may share a pool, but the operating system and other applications also need it.

Bandwidth. Token generation repeatedly moves model data through the memory hierarchy. A device can have enough nominal capacity yet generate tokens too slowly for an interactive target.

Compute support. Serving engines depend on supported kernels, numerical formats, drivers, and device backends. Peak arithmetic specifications are not useful if the chosen software cannot use the relevant path.

Thermal and operational limits. A laptop is designed for interactive personal use, not necessarily sustained multi-user inference, redundant power, remote replacement, or predictable cooling.

Local inference can still be excellent for development, privacy-sensitive experiments, offline use, and appropriately sized models. The right conclusion is to match workload to hardware, not to dismiss either laptops or servers categorically.

Store models as governed dependencies

A production team should identify an immutable model revision, verify its source and license, record checksums, scan formats where appropriate, and restrict who can publish an approved artifact. Loading arbitrary serialized objects can execute code in some ecosystems; prefer safer tensor formats and trusted sources when available.

Separate model binaries from customer data and runtime secrets. Use an artifact registry or controlled object store, encrypt transport and storage, and log promotion between environments. Cache artifacts near compute when startup time matters, while retaining a clear eviction and rollback policy.

The release record should bind the model revision to tokenizer, serving-engine version, quantization method, prompt or policy bundle, and evaluation result. Changing only the tokenizer or chat template can alter behavior even when weight files remain identical.

A practical fit check

Before selecting hardware:

  1. Calculate an initial weight estimate from parameters and precision.
  2. Add measured runtime overhead and key-value-cache demand for the target context and concurrency.
  3. Confirm the engine supports the artifact, quantization, and device.
  4. Benchmark representative prompt and output distributions.
  5. Test startup, overload, cancellation, and recovery behavior.
  6. Preserve enough headroom for variance and safe rolling updates.

The disk size tells you what must be transferred. It does not tell you whether the model will fit at peak load or meet a latency objective. That answer comes from a capacity model followed by measurement.

Continue the series

Turn those constraints into a practical estimate in GPU Sizing for LLM Inference Without Guesswork.

Further reading