How much RAM does a local LLM need?
A local LLM needs about as much memory as its quantized weight file, and that file has to fit in the share of memory your device leaves for AI. Our fit engine budgets 72% on macOS, 75% on Linux, 68% on Windows, 45% on iOS and 42% on Android, or 90% of a discrete GPU's VRAM. So RAM needed ≈ file size ÷ that share. In our catalog, Llama 3.1 8B at Q4 is a 4.6 GB file, so a Mac needs at least 6.4 GB: an 8 GB Mac holds it (5.8 GB usable), a 4 GB Mac fits only Q2, and at 16 GB the engine rates it Runs well at Q8.
Every fit label, weight and speed on onmydevice is an estimate from the formulas on this page, not a measurement.
Methodology · Updated
RAM needed by model size
RAM needed ≈ Q4 file size ÷ usable share, rounded up to 0.1 GB. File sizes come from each model's catalog record.
| Model | Parameters | Q4 file | Mac RAM (72%) | Windows PC RAM (68%) | iPhone RAM (45%) | Discrete GPU VRAM (90%) |
|---|---|---|---|---|---|---|
| Llama 3.2 3B | 3.21B | 1.9 GB | 2.7 GB | 2.8 GB | 4.3 GB | 2.2 GB |
| Llama 3.1 8B | 8.03B | 4.6 GB | 6.4 GB | 6.8 GB | 10.3 GB | 5.2 GB |
| Gemma 3 12B | 12.2B | 7.0 GB | 9.8 GB | 10.3 GB | 15.6 GB | 7.8 GB |
| Gemma 4 31B | 31B | 18.0 GB | 25.0 GB | 26.5 GB | 40.0 GB | 20.0 GB |
The share left over covers the operating system, other apps and the runtime's own working memory, including the context cache. The engine adds no separate allowance for long contexts, so very long prompts can need more.
Llama 3.1 8B on each RAM tier
Our RAM tier pages fit every model on a reference Mac with unified memory. The engine picks the highest-quality quantization that fits, so it can choose a larger file with less headroom over a smaller file with more.
| RAM | Usable (72%) | Engine picks | File | Share of budget | Label (est.) |
|---|---|---|---|---|---|
| 4 GB | 2.9 GB | Q2 | 2.7 GB | 94% | Tight fit |
| 8 GB | 5.8 GB | Q5 | 5.3 GB | 92% | Tight fit |
| 16 GB | 11.5 GB | Q8 | 8.5 GB | 74% | Runs well |
| 32 GB | 23.0 GB | FP16 | 16.1 GB | 70% | Runs well |
The reference Macs use these memory bandwidths, which also set the tier pages' speed estimates: 4 GB at 40 GB/s, 8 GB at 68 GB/s, 16 GB at 100 GB/s and 32 GB at 200 GB/s. They are representative figures, not a specific product. For real hardware, see the device pages.
Usable memory by platform
| Platform | Share of RAM for AI |
|---|---|
| macOS | 72% |
| Linux | 75% |
| Windows | 68% |
| iOS (iPhone, iPad) | 45% |
| Android | 42% |
| Discrete GPU (VRAM) | 90% |
On devices with unified memory, such as Apple Silicon Macs, iPhones and Android phones, the CPU and GPU share the platform's share of RAM. A discrete GPU gets 90% of its VRAM, because VRAM is dedicated to the GPU. The engine falls back to 70% for any other platform; every catalog device uses one of the five above.
How fit is estimated
For each device and model, the engine tries up to three memory budgets in order and stops at the first one that holds some quantization of the model:
- GPU. Unified-memory devices use the platform's share of RAM. Discrete GPUs use 90% of VRAM.
- GPU with CPU offload, discrete GPUs only: 90% of VRAM plus 30% of system RAM.
- CPU only. The platform's share of system RAM.
For example, the Gaming PC (RTX 4070) 32GB gets 10.8 GB on the GPU (90% of 12 GB VRAM), 20.4 GB with CPU offload (90% of VRAM + 30% of 32 GB RAM) and 21.8 GB on the CPU alone (68% of 32 GB RAM).
Quantization
Within a budget, the engine picks the highest-quality quantization listed in the model's catalog record that fits. File sizes are the full quantized weights. The quality scores below rank quantizations; they are not measured accuracy.
| Quantization | Quality score |
|---|---|
| FP16 | 100% |
| Q8 | 95% |
| Q6 | 85% |
| Q5 | 78% |
| Q4 | 70% |
| Q3 | 58% |
| Q2 | 42% |
| Q1 | 30% |
Fit labels
The engine divides the selected file size by the budget it used, then labels the fit:
- Runs great: the file uses at most 60% of the budget and the quantization scores at least 78% (Q5 or better).
- Runs well: at most 80% of the budget and at least 70% quality (Q4 or better).
- Tight fit: the file fits but uses more than 80% of the budget, or only a quantization below Q4 fits.
- Too heavy: no listed quantization fits any budget.
Device, model, RAM tier and compare pages count every label except Too heavy as able to run. The estimate tables on the benchmark pages list the same runnable fits.
Ranking
Where a page ranks models or devices, it orders them by a score from 0 to 100, after grouping by label on device pages: quality 35%, speed 25%, fit 25% and context 15%. Quality is 50% parameter count, at full marks from 8B parameters, and 50% quantization quality. Speed reaches full marks at 50 tok/s. Fit scores 100 for a file using up to 60% of the budget, 75 up to 80% and 40 up to 100%. Context scores 100 from 128,000 tokens, 75 from 32,000 tokens, 50 from 8,000 tokens and 25 below 8,000 tokens.
How speed is estimated
Generating each token reads the model's weights from memory once, so decode speed is limited by memory bandwidth. The engine estimates tokens per second ≈ memory bandwidth ÷ GB of weights read per token, rounded to a whole number:
- In CPU-only mode, usable bandwidth is 12% of the device's memory bandwidth, at most 60 GB/s.
- GPU with CPU offload estimates still use the GPU's full memory bandwidth, even though part of the weights sits in slower system RAM, so they are especially optimistic.
- iOS and Android devices get a 70% multiplier for thermal throttling under sustained load.
- No estimate exceeds 200 tok/s.
- Speed estimates cover chat, reasoning, code and vision models. Pages show embedding, image, voice and transcription models with their weights and fit label only.
The formula ignores prompt processing, context-cache reads and runtime overhead, so treat each figure as an upper bound.
| Device | Model | Mode and quant | Bandwidth used | Weights | Est. decode |
|---|---|---|---|---|---|
| MacBook Air M4 16GB | Llama 3.1 8B | GPU, Q8 | 120 GB/s | 8.5 GB | 14 tok/s |
| Gaming PC (RTX 4070) 32GB | Llama 3.1 8B | GPU, Q8 | 504 GB/s | 8.5 GB | 59 tok/s |
| iPhone 16 Pro 8GB | Llama 3.2 3B | GPU, Q8 | 47.6 GB/s | 3.6 GB | 13 tok/s |
Mixture-of-experts models
A mixture-of-experts (MoE) model sends each token through a few of its experts, so it uses fewer parameters per token than it holds.
- Memory: every expert stays loaded, so the budget check uses the full quantized file.
- Speed: each token reads only the active share of the weights, active ÷ total parameters. A model with 30B total and 3B active parameters reads 10% of its weights per token.
- Quality: the score uses √(total × active) parameters, about 9.5B for that model, a common rule of thumb for the dense size with similar quality. It ranks models; it does not measure quality.
- Legacy records: a catalog record without an architecture uses its listed parameter count for quality and assumes every weight is read for each token. Some legacy MoE records list their active parameters as the parameter count, which makes their speed estimates conservative and their quality scores low until they move to the MoE rules.
All 76 catalog models use the legacy rules today. None uses the dense or MoE rules yet.
Estimates, not measurements
Every fit label, weight size and tok/s figure on this site is an estimate from the formulas above, computed when the site is built. None is a measurement of a real device, and pages label them as estimates. Estimates are never stored as benchmark results. Browse them by device on the benchmark pages.
We have not published any measured runs yet. Before a measured run is published, it must state:
| Field | What it records |
|---|---|
| Kind | Always "measured". Estimates are generated at build time and never stored. |
| Device | The catalog device that ran the model. |
| Model | The catalog model that ran. |
| Model revision | The exact weights, such as a repository at a commit or a file name with its SHA-256. |
| Quantization | The quantization level that ran. |
| App | The catalog app or runtime that ran the model. |
| App version | The app or runtime version as it reports itself. |
| Context | The context window the run used, in tokens. Required for decode, prefill and time-to-first-token runs. |
| Workload | What each repetition processed, such as a 512-token prompt and 128 generated tokens. |
| Repetitions | The number of timed repetitions behind the value. |
| Metric | Decode speed, prefill speed, time to first token, realtime factor or time per image. |
| Value | The result, summarized across repetitions. |
| Unit | One unit per metric: tok/s for decode and prefill, ms for time to first token, x for realtime factor, s for time per image. |
| Peak memory | Peak memory the run used, in GB, when recorded. |
| Date | The date the run took place. |
| Sources | The raw log of a first-party run, or the publication of a cited run. |
How repetitions are combined into one value will be stated here before the first measured run is published.
How device detection works
The homepage guesses your device in your browser from a few signals and shows the closest catalog device. The detection code does not send these signals to our server. It reads:
- the user agent, for the platform;
- the logical CPU core count;
- reported device memory, in Chromium browsers only, which is coarse and capped at 8 GB;
- screen width times pixel ratio, for iPhones;
- CPU architecture, in Chromium browsers only, to tell Apple Silicon from Intel Macs.
The signals have limits:
- Macs: browsers report at most 8 GB of memory, and Safari reports none, so Apple Silicon Macs are grouped by core count and detection cannot tell RAM configurations apart. Safari and Firefox do not report the architecture, so Macs on those browsers get a mid-tier guess.
- iPhones: Safari does not report RAM. Detection looks up the screen width and picks the catalog iPhone with the most RAM that every iPhone at that width still has. When every iPhone at a width has less RAM than any catalog iPhone, or the width is not in the table, it picks the catalog iPhone with the least RAM: the iPhone 15, with 6 GB. At 5 of the 11 widths below, that guess has more RAM than some phones of that width.
- Android, Windows and Linux: reported memory and core count pick a tier.
| iPhone screen width | Least RAM at that width | Detection picks |
|---|---|---|
| 1,320 px | 8 GB | iPhone 16 Pro 8GB |
| 1,290 px | 6 GB | iPhone 15 6GB |
| 1,284 px | 6 GB | iPhone 15 6GB |
| 1,260 px | 12 GB | iPhone 16 Pro 8GB |
| 1,242 px | 3 GB | iPhone 15 6GB |
| 1,206 px | 8 GB | iPhone 16 Pro 8GB |
| 1,179 px | 6 GB | iPhone 15 6GB |
| 1,170 px | 4 GB | iPhone 15 6GB |
| 1,125 px | 3 GB | iPhone 15 6GB |
| 828 px | 3 GB | iPhone 15 6GB |
| 750 px | 2 GB | iPhone 15 6GB |
Detection is a guess. Pick your exact device in the picker on the homepage, or browse all devices, to see estimates for your actual hardware.
Context length
Context windows use binary units: 1K is 1,024 tokens and 1M is 1,048,576 tokens. A 131,072-token window shows as 128K and 262,144 tokens as 256K. Windows under 1,024 tokens show as exact counts. The fit engine does not reserve memory for the context window.
Catalog data and sources
Device specifications (RAM, VRAM and memory bandwidth), model file sizes for each quantization and parameter counts come from our catalog of 67 devices, 76 models and 14 apps. A record can cite its sources and carry a verified date, a release date and a license. Catalog checks reject a record that sets a release date, verified date or license without listing sources.
Today, no device, model or app record cites sources or carries a verified date. Sources are being added record by record from makers' specifications, model cards and release notes.
Attribution and corrections
Estimates come from the onmydevice fit engine described on this page, not from any app's or runtime's benchmark output. Measured runs will name the app and version that produced them, and runs we cite will link their original publication. Device, model and app names and logos belong to their makers.
When a formula or an engine constant changes, the date at the top of this page changes with it.