SimpleA plain explanation, one diagram and an analogy, with where the analogy breaks.
Guess first: Look at the stack: which layer decides whether the model fits? Show the answerThe bottom one: your computer's memory. Everything above it, including the model file, has to fit there.
Some AI models can be downloaded as one big file, like a film you keep instead of stream.
A local runtime is the player for that file. It runs the model on your own computer, so your words never leave the house.
The catch: the file has to fit in your computer's memory.
A local runtime loads a model's weights into your GPU or CPU memory and generates tokens on your machine.
Models are usually shared as single files that bundle the weights, the tokenizer and settings such as the chat template. GGUF is a common format, and each model is often published in several quantization levels.
Most runtimes also start a small local server that speaks the same request format as the big cloud APIs, so existing apps and coding tools can point at your machine instead.
Memory decides what you can run: the weights (parameters × bits ÷ 8) plus the KV cache for your context must fit. Memory bandwidth then sets how fast tokens come out.
What runs where when a model runs at home
Like: Downloading a film instead of streaming it. Where it breaks: A downloaded film plays the same on any player. A model file can run noticeably differently depending on the quantization level, the runtime's settings and whether the chat template matches, and a big model may not fit at all.
ResearchWhere the simple picture breaks, open problems and primary sources.
"Does it fit in memory?" is only the first question. Speed, quality and trust depend on details the rule of thumb hides.
Splitting a model. Runtimes can put some layers on the CPU when the GPU is full, so a model too big for the GPU still runs, but tokens then come out at the pace of the slower memory (llama.cpp).
Quality per bit varies. The same bit width costs some models more than others; one study found a newer model degraded noticeably at low bit widths (2024 study). Community testing is often the only guide.
Templates and settings. A wrong chat template or missing control tokens can make a model "drastically worse" with no error message (chat template docs), so a local model can trail the same model in the cloud.
Trusting downloaded files. Pickle-based files can run code when loaded (pickle scanning docs), and a model can be crafted to misbehave only after quantization (Egashira et al., 2024). Where a file came from matters.
Security on this concept: 2 threats Pending expert review
Self-hosted model servers left open to anyone Pending expert review
Exposed
Model servers run on workstations and cloud machines, listening on all network interfaces
Their APIs, which by default often need no login
The compute, models and tool access those servers provide
Attacks
Scanning the internet for open model-server ports
Using someone else's server for free, or reselling its compute
Pulling, deleting or replacing models through the open API
Bind model servers to localhost or a private network; never open them to the internet
Put an authenticating proxy or VPN in front of any shared model server
Scan your own address ranges for open model-server ports and keep servers patched
Owner
Platform/Cloud, with ML engineering
Reference
LLM06:2026 Unbounded Consumption AML.T0132 Misconfigured or Publicly Exposed AI Services AML.T0006.002 Scan for Exposed AI Infrastructure AML.T0034 Cost Harvesting
Model files that run code when you load them Pending expert review
Exposed
Machines that download and load third-party model files
The credentials and data on those machines
Attacks
Hiding commands in pickle-based model files that run on load
Compressing or breaking the file in unusual ways so model-hub scanners miss the payload
Model APIs & routers Paying per token to send requests to a hosted model, either directly to a provider or through a router that picks among many providers.
Batching & KV caching Serving tricks that process many users at once and avoid recomputing work already done.
Quantization Storing a model's numbers with fewer bits so it's smaller and faster, at a small cost in accuracy.
Speculative decoding A small, fast model guesses the next few tokens and the big model checks them all at once: fewer slow steps, with output identical under greedy decoding and the same distribution when sampling.
Model supply chain Everything you didn't build yourself (model files, datasets, libraries, tool packages) can carry an attack; checking where it came from and loading it safely is supply-chain security.