Streaming Weights From Disk and Other Tricks Behind Viral Demos

Every few months a project goes viral with a headline that sounds impossible: a model with trillions of parameters running inference on a single CPU in a few gigabytes of RAM, written in portable C with no GPU and no framework. Reactions split between excitement and disbelief, and the most common response is a simple question: has anyone actually tried this?
Similar excitement greets very different projects, such as tiny gradient-free systems with a few thousand parameters that learn to play a simple game without any GPU at inference. Both kinds of story raise the same practical question for anyone who has spent money on NVIDIA hardware: do you need a GPU at all?
This article explains what is technically going on in demos that run giant models on minimal hardware, what the trade-offs really are, and when CPU inference is a sensible choice. It does not judge any specific project; it gives you the tools to evaluate such claims yourself.
Frequently asked questions
How can a model larger than RAM run at all?
By not loading it all at once. The weights stay on disk and are read in pieces as each layer or expert is needed, often through memory mapping. RAM then holds only what is in use at that moment plus some cache.
Why does this work better with mixture-of-experts models?
In a sparse model only a few experts are used per token. If the program reads only those from disk, each token touches a small fraction of the total weights. A dense model of the same size would need to read everything for every token.
How fast is it?
Usually very slow. Reading gigabytes from storage for each token takes far longer than reading from RAM or GPU memory. Speeds can be measured in seconds or minutes per token, depending on storage speed and how many weights each token needs.
Is the output the same as on a GPU?
It can be, if the program uses the same weights and precision and implements the model correctly. Many such projects use heavy quantization to reduce disk reads, which changes outputs and may reduce quality.
How does this differ from normal CPU inference?
Normal CPU inference loads the whole model into RAM and runs it from there, which is slow compared with a GPU but practical for small and medium models. Streaming from disk is an extreme variant for models that do not fit in RAM at all.
When is CPU inference actually useful?
For small models, for batch jobs where speed does not matter, on servers without GPUs, for testing and education, or where power and cost limits rule out a GPU. Modern CPUs with fast memory run small quantized models at usable speeds.
Does a tiny neuroevolution model compete with language models?
No. Systems with a few thousand parameters solving a narrow game are interesting research on learning methods, but they solve entirely different problems from language models and are not substitutes for them.
What the headline leaves out
Viral claims are usually technically true and practically misleading at the same time. Running inference means producing output from the model; it says nothing about how long that takes. A model that produces one token per minute does run, but you would not want to chat with it.
The details that matter are almost always in the project's notes: the quantization used, the storage device, the tokens per second measured, and which parts of the model were tested. Reading those before reacting to the headline saves a lot of confusion.
Questions to ask any such demo
Which precision were the weights stored at? How fast was the storage? How many tokens per second or seconds per token? Were outputs compared with a reference implementation? Was it a full generation or a single forward pass?
Educational value is real
Even when impractical, compact implementations without dependencies are excellent learning material. Reading a clean C implementation of a transformer teaches more about how models work than any framework's documentation.
Memory mapping in plain terms
Operating systems can map a file into a program's address space so that reading memory transparently reads the file. Pages are loaded from disk on first access and dropped when memory is needed elsewhere. Inference programs use this to open huge model files without reading them into RAM first.
Tools in the llama.cpp family have long used memory mapping for fast loading. When a model is slightly larger than RAM, the operating system keeps swapping pages in and out, and speed drops sharply. When a model is many times larger than RAM, almost every token requires fresh disk reads.
The page cache helps a little
Recently used parts of the model stay in the operating system's cache. For sparse models where some experts are used often, that cache absorbs part of the load. For truly random access patterns, it helps much less.

Why sparse models make the trick plausible
A dense model reads all its weights for every token. A mixture-of-experts model reads shared layers plus the few experts the router selects. If those experts make up only a small fraction of the total, the bytes needed per token are far fewer than the model's size.
That is why giant sparse models are the usual subject of these demos. The total size can be enormous while the per-token working set stays within reach of RAM plus fast storage. The explainer on active parameters describes how sparse models are structured.
Heavy quantization reduces reads further
Storing weights at very low precision shrinks each expert, so each token reads fewer bytes. The cost is quality: very aggressive quantization can damage a model's abilities, especially on reasoning and less common languages.
Expert locality matters
If consecutive tokens tend to use the same experts, the cache works well and speed improves. If routing jumps between experts constantly, every token triggers new disk reads.
Storage becomes the bottleneck
Once weights stream from disk, storage speed replaces memory bandwidth as the limit. Even fast NVMe drives deliver a small fraction of the bandwidth of system RAM, which itself delivers a fraction of what a high-end GPU offers. Each step down is an order of magnitude or so.
That hierarchy explains the speed of these demos. Bytes per token divided by storage bandwidth gives a rough floor on time per token. With several gigabytes needed per token and a few gigabytes per second from storage, you are looking at seconds per token at best.
It is also worth separating loading time from generation time. A program that maps a huge file can start almost instantly, which looks impressive, but the real cost shows up only once tokens are produced and pages are read from disk. Conversely, a normal engine that loads a model fully into fast memory may take a minute to start and then generate quickly for hours. For anything beyond a demo, the steady-state speed is what you live with, so measure it over a long answer rather than the first few seconds.
Drive wear is a minor concern
Streaming weights is mostly reading, which does not wear flash storage the way writing does. Heavy swapping caused by low RAM, however, can add writes. Watch swap usage during such experiments.
- GPU memory: fastest, smallest, most expensive per gigabyte.
- System RAM: slower, larger, cheaper.
- NVMe storage: much slower again, very large, cheapest.
- Network storage: slowest, only useful for loading, not streaming.

Normal CPU inference is a different story
Running a small or medium model fully in RAM on a modern CPU is entirely practical. Desktop and server CPUs with many cores and fast memory channels can generate tokens at readable speeds for small quantized models. Servers with many memory channels do even better.
This is useful in places without GPUs: cheap virtual servers, office machines, laptops with integrated graphics, or batch jobs where nobody waits for the answer. It is also a good fallback when your GPU is busy with something else.
Memory channels matter more than cores
Token generation on CPU is bandwidth-bound like on GPU. A CPU platform with more memory channels often beats one with more cores but fewer channels. Check the memory configuration before blaming the processor.
Prompt processing is the weak spot
CPUs process long prompts far more slowly than GPUs, because prefill is compute-heavy. CPU inference suits short prompts better than long-document work, as explained in the prefill article.
Tiny models and other learning methods
Projects with a few thousand parameters that learn without backpropagation, through evolution-like methods, are a different kind of story. They show that some tasks can be solved by very small systems trained in unusual ways and run on any CPU.
They are not language models and do not compete with them. They are valuable as research and as a reminder that not every problem needs a large neural network. For narrow control problems, a tiny specialised model can be more efficient than any general-purpose LLM.
Pick the smallest tool that works
If your problem is narrow, such as a simple game, a sensor rule or a classifier, consider small dedicated models first. Reach for language models when you need language understanding or open-ended generation.

Evaluating a demo yourself
If you want to try a CPU or streaming project, measure carefully. Record time per token over a long generation, not just the first few tokens. Note RAM usage, swap activity and storage read rates. Compare a few outputs with the same model running through an established engine or a hosted reference to check correctness.
Keep expectations realistic. A demo that proves a model can run on minimal hardware is an engineering achievement, not a recommendation to replace your setup with it.
Use a hosted reference for correctness
Running the same prompts through a working model elsewhere helps you spot broken implementations, which tend to produce plausible but wrong text. Any OpenAI-compatible endpoint works; the free one on this site is described below.
# watch memory, swap and disk reads while a CPU inference demo runs (Linux)
vmstat 2
# in another terminal: per-device read throughput every 2 seconds
iostat -dx 2Where GPUs and hosted APIs still win
For interactive use with capable models, GPUs remain far faster than CPU inference, and dramatically faster than streaming from disk. For the strongest reasoning, long contexts and multimodal input, large commercial APIs running on data-centre hardware are in another league entirely.
If you want a capable model without any local hardware at all, a hosted endpoint is the practical answer. The keyless API on this site serves free-ai, an independent open-weight model of about 35B parameters, at https://api.apifreenvidia.com/v1. It runs on the service's own infrastructure, is not an NVIDIA product, and APIFreeNVIDIA is not affiliated with NVIDIA. It answers in seconds rather than minutes, within per-IP limits of one request per second.
Matching method to need
Curiosity and learning: try the demo. Small models on a budget: CPU inference in RAM. Interactive work with capable models: a GPU or a hosted API. Comparing options before buying: see the GPU memory comparison.

Send a prompt from the chat box on the home page: no key, no account and no card, just a quick look at how free-ai answers.