Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Yes—you can run a model that is larger than your GPU memory. In llama.cpp, put as many layers as possible in VRAM with -ngl or --n-gpu-layers, leave the remaining weights on the CPU/system-memory path, and use memory mapping (mmap) so the operating system can read model pages from the GGUF file as needed. If resident RAM is also insufficient, llama.cpp’s lazy mode can read selected tensor rows from an SSD on demand.

This is a capacity strategy, not a way to obtain GPU-like speed from storage. VRAM is fastest, system RAM is slower, and SSD-backed pages are slower still because they require storage I/O. The practical goal is to keep the active working set in VRAM and RAM, using the SSD as a backing tier rather than pretending it is extra VRAM.

The three memory tiers and what each one does

An offloaded model can use three different places for its data. Understanding the distinction prevents the most common setup mistake: assuming that a model fitting on disk must also fit in memory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Tier What is stored there Relative behavior Typical decision
GPU VRAM Layers selected for GPU execution, plus any GPU-resident KV cache Highest bandwidth and usually the lowest token latency Fill as much as the card can safely hold
System RAM CPU layers, CPU-resident expert or feed-forward weights, runtime buffers and possibly the KV cache More capacity than VRAM, but slower access and shared with the operating system Keep the non-GPU portion here when possible
SSD file and mapped pages The GGUF model file and pages read on demand through mmap or lazy mode Largest practical capacity, but storage latency and bandwidth make generation substantially slower when pages are repeatedly fetched Use as a backing source when RAM cannot hold everything

These tiers are not interchangeable. A 20 GB GGUF file can be stored on a 1 TB SSD while still failing at startup because the process needs RAM for weights, temporary buffers and the KV cache. Conversely, a model can start with mmap while its active pages consume enough RAM to trigger swapping and severe stalls.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

The controls below describe llama.cpp’s current server and command-line behavior. Exact availability can vary by build, backend and version, so check the options printed by your own executable with ./llama-server --help before scripting a production launch.

Measure the real constraints before choosing an offload plan

Record four quantities for the exact model, quantization and context length you intend to use:

  • GGUF file size: this is the storage requirement, not a complete memory budget.
  • Free VRAM: measure after the display server and other GPU applications are accounted for.
  • Free system RAM: leave headroom for the operating system, the llama.cpp process, runtime work buffers and the KV cache.
  • KV-cache demand: it grows with context length, batch or parallel request settings, model architecture and cache precision. A configuration that works at a short prompt can fail when the context is doubled.

Also check free SSD capacity. NVIDIA’s 2026 “Serve Models with llama.cpp on DGX Spark” walkthrough specifies about 40 GB free for its example download and build artifacts. That figure is for the walkthrough, not a universal model requirement; your model files, duplicate downloads, compiled binaries and logs may need more.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The same NVIDIA material lists DGX Spark configurations with 64 GB or 128 GB of unified memory. Unified memory is shared by CPU and GPU work, so do not interpret those numbers as dedicated VRAM plus separate RAM. For a discrete GPU, make the two budgets separately.

For perspective, the llama.cpp performance guide’s illustrative benchmark used an A6000 with 48 GB of VRAM, a seven-core CPU, 32 GB of RAM and a 30B 4-bit model. Those specifications describe that example only; they do not establish a speed or capacity guarantee for other hardware.

Start with GPU layers, then let llama.cpp place the remainder

The primary control is -ngl, also written --n-gpu-layers. It sets the maximum number of model layers that may be stored in VRAM. If the requested count does not fit, llama.cpp can offload fewer layers. A high value is therefore a request to use the maximum possible GPU portion, not a promise that every layer will fit.

A safe first launch

  1. Choose the GGUF file and a deliberately modest context size while testing.
  2. Launch the server with a high layer limit, for example ./llama-server -m /models/model.gguf --n-gpu-layers 999 --ctx-size 4096. Some builds accept -ngl 999 as the short form.
  3. Read the startup diagnostics. The llama.cpp performance guide recommends checking messages such as offloading 60 layers to GPU and the reported total VRAM used.
  4. Send a short prompt and watch for an allocation failure, process termination or system-wide memory pressure before increasing context length.

The exact number in the log is the useful result. If the model has 80 layers but the log says 43 were offloaded, the other layers are on the CPU path. If startup reports that no layers fit, verify that the intended GPU backend is present and that another process has not consumed VRAM.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When to lower the layer count yourself

Set an explicit lower value when you need predictable headroom for the KV cache or another GPU workload, or when an automatic high value leaves too little memory for runtime buffers. For example, change --n-gpu-layers 999 to --n-gpu-layers 32, restart, and compare the new VRAM and latency figures. Lowering the count moves more weight traffic to the CPU path, so generation usually slows, but it can make a previously unstable configuration reliable.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

For CPU-only execution, use --n-gpu-layers 0. This is useful as a diagnostic: if CPU-only loading succeeds while GPU loading fails, the problem is likely VRAM allocation or backend configuration rather than a corrupt model file.

Splitting across multiple GPUs

When more than one compatible GPU is available, llama.cpp can distribute work with --tensor-split. The split values determine the relative share assigned to each device. A simple example is --tensor-split 7,5 for two cards, but the useful ratio depends on each card’s free VRAM and the overhead of the selected backend. Confirm the per-device allocation in the startup log instead of assuming that the nominal VRAM totals are fully usable.

Use system RAM deliberately for CPU layers and expert weights

CPU placement is a separate tier from GPU offload. The runtime keeps layers that were not placed in VRAM on the CPU/system-memory path, where they are executed by the processor and read from RAM or mapped storage.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Mixture-of-Experts models

Mixture-of-Experts (MoE) checkpoints contain expert weights that can dominate the memory footprint. The server README documents --cpu-moe to keep all MoE weights on the CPU, and --n-cpu-moe to keep the first N layers’ MoE weights there. These options trade GPU capacity for CPU memory and CPU-side access.

If an MoE model fails while most dense layers fit, try the all-CPU expert path first:

./llama-server -m /models/moe-model.gguf --n-gpu-layers 999 --cpu-moe --ctx-size 4096

If that leaves too much work on the CPU, use a numeric layer count where supported and compare startup memory and generated-token latency. Keep enough RAM for the experts plus the operating system; placing experts on the CPU does not make their memory requirement disappear.

Dense feed-forward weights

For dense models, --n-cpu-ffn performs the analogous job for feed-forward network weights. Moving FFN weights to CPU can free a large contiguous amount of VRAM while leaving attention-related portions on the GPU. The best value is model- and build-dependent, so change one control at a time and record the resulting allocation and speed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use mmap to make large GGUF files practical

Memory mapping lets llama.cpp map the model file instead of eagerly copying every tensor into private anonymous memory. The operating system brings file-backed pages into RAM as they are accessed and can reclaim them under pressure. For a large GGUF, keeping mmap enabled is usually the sensible baseline.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

In llama.cpp builds this is exposed as the mmap option (commonly shown as --mmap; inspect your build’s help for the exact spelling). The mapped file still needs to exist on local storage, and the process still needs RAM for pages that are actively used, runtime buffers and the KV cache.

Lazy mode for selected tensor rows

--lazy-mode on tells llama.cpp to read selected tensor rows from disk on demand rather than keeping them resident. It requires mmap. The auto setting applies lazy behavior only to tensors larger than 4 GiB, while on applies it without that size threshold where the build supports it.

./llama-server -m /models/model.gguf --n-gpu-layers 999 --mmap --lazy-mode on --ctx-size 4096

Lazy mode is a capacity escape hatch, not a free performance improvement. If generation repeatedly touches rows that are no longer resident, the process waits on storage. An NVMe SSD is preferable to a hard disk, but even a fast NVMe device has far less latency and bandwidth than VRAM or ordinary RAM for this access pattern.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not confuse mmap with swap

mmap and lazy mode read the model’s existing file. Deliberately paging anonymous memory to a swap file is different: it can involve runtime allocations, cache pages and other process memory, and it is often dramatically slower and less predictable. Treat swap as an emergency safety net that prevents an immediate out-of-memory kill, not as a planned tier for interactive generation.

When mlock helps—and when it hurts

The mlock option asks the operating system to keep mapped model pages resident instead of swapping or compressing them. It can stabilize latency when you have abundant RAM, but it can also fail due to process limits or starve the rest of the system. Use it only after confirming that the model and KV cache fit comfortably in RAM and that your operating system permits the required locked-memory amount.

Budget the KV cache separately from model weights

The KV cache stores attention keys and values for the conversation context. It grows as tokens accumulate, so a model that loads at a 2,048-token context may fail at 32,768 tokens even when the GGUF file and layer placement are unchanged.

llama.cpp exposes --kv-offload and --no-kv-offload. With KV offload enabled, the cache stays on the GPU when possible. With --no-kv-offload, it is kept off the GPU, freeing VRAM at the cost of slower access through the CPU/system-memory path.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
./llama-server -m /models/model.gguf --n-gpu-layers 999 --no-kv-offload --ctx-size 8192

Use the smallest context that satisfies the application, then increase it in measured steps. If a long-context workload is the reason for VRAM exhaustion, moving the KV cache may be more effective than removing several model layers from the GPU. If the resulting latency is unacceptable, reduce context, reduce concurrent sequences or reserve more VRAM by lowering --n-gpu-layers only as much as necessary.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

A repeatable setup procedure

  1. Prepare local storage. Keep the GGUF file, llama.cpp build and temporary artifacts on an SSD with ample free space. NVIDIA’s example calls for about 40 GB free for its download and build artifacts; treat that as a floor for that example, not a universal total.
  2. Verify the file. Confirm that the GGUF download completed and that the model architecture is supported by the llama.cpp build you are running.
  3. Establish a baseline. Start with a short context, mmap enabled and a high GPU-layer limit. Save the complete startup log.
  4. Inspect placement. Record the number of layers offloaded, total VRAM used, CPU memory consumed and any warnings about buffers or the KV cache.
  5. Test a short generation. Use a prompt that exercises the intended chat or completion path. Watch both generated-token latency and system memory while it runs.
  6. Reserve KV-cache headroom. If VRAM is nearly full at startup, lower the layer count or test --no-kv-offload before increasing context.
  7. Move specialized weights if needed. For MoE models test --cpu-moe or --n-cpu-moe; for dense FFN pressure test --n-cpu-ffn.
  8. Add lazy reads only for a RAM shortfall. Enable --lazy-mode on with mmap when the model’s active pages cannot remain resident. Expect storage-related stalls and measure them.
  9. Increase workload gradually. Raise context length, batch size or concurrent requests one at a time. Stop when free RAM or VRAM becomes dangerously low, rather than waiting for the operating system to start swapping.

How to compare two configurations that both run

“It starts” is not enough to identify the better configuration. Record the following for each launch:

Measure Why it matters What to record
GPU layer count More GPU layers usually reduce CPU work, but consume VRAM needed by the KV cache The startup-log count and the requested --n-gpu-layers
Resident system RAM Shows whether CPU weights and mapped pages fit without reclaim or swap Peak process memory and free RAM during a long prompt
KV-cache placement Determines how context growth competes with model layers for VRAM GPU or CPU placement, context length and concurrency
Storage path Lazy reads can turn a memory problem into an I/O bottleneck SSD type, free capacity and whether lazy mode is on or automatic
Generated-token latency Capacity changes can be operationally useless if responses become too slow Tokens per second or time per token under the same prompt and context

There is no universal tokens-per-second figure for RAM or SSD offload. Results depend on GPU model, CPU, memory bandwidth, model architecture, quantization, context length, batch settings, SSD, operating-system cache state and the exact llama.cpp build. Publish or compare measurements only when those conditions are stated.

Troubleshooting common failure modes

“The model fits on disk but runs out of memory”

Storage capacity is not execution memory. Check free RAM, VRAM and KV-cache demand separately. Lower context, move the KV cache off GPU, reduce GPU layers, place MoE or FFN weights on CPU, and enable mmap. If RAM still cannot hold the active working set, use lazy mode and accept the I/O penalty.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Startup says fewer layers were offloaded than requested

This is normal when the requested maximum exceeds available VRAM. Confirm that the log reports the expected GPU backend and note the actual count. If the count is unexpectedly low, close other GPU applications, reduce context or check whether the selected quantization and runtime buffers consume more VRAM than anticipated.

CUDA or another GPU backend reports an allocation failure

Start with --n-gpu-layers 0 to distinguish a model-file problem from a GPU allocation problem. Then retry with a small positive layer count and increase it incrementally. Keep the KV cache off GPU during the test if it is competing for the remaining space.

The process starts but the desktop freezes or the machine swaps

Stop the server, disable mlock if enabled, reduce context and concurrency, and leave operating-system headroom. A mapped file can still create heavy memory pressure when many pages are active. Swap may prevent a crash but will not make interactive generation usable.

Lazy mode makes generation extremely slow

That indicates repeated storage reads. Move the model to a faster local NVMe SSD, reduce the active context or concurrent requests, increase RAM, or place more layers and frequently used weights in VRAM or RAM. Lazy mode is most defensible when the workload tolerates latency or when only a small fraction of the mapped file is touched repeatedly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

CPU offload works but throughput is poor

Every token may require synchronization between GPU-resident and CPU-resident layers. Compare a lower CPU boundary, more VRAM layers, a different KV-cache placement and a shorter context. A larger SSD cannot compensate for a CPU bottleneck because it changes capacity, not compute bandwidth.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Practical configuration patterns

GPU-first interactive chat

Use a high GPU-layer limit, mmap enabled, GPU KV offload and a context size that leaves visible VRAM headroom:

./llama-server -m /models/chat-model.gguf --n-gpu-layers 999 --mmap --kv-offload --ctx-size 4096

This is the preferred starting point when the model mostly fits in VRAM and RAM is plentiful.

Large model with CPU-resident remainder

Keep the maximum fitting layer count on the GPU and allow the rest to use system RAM:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
./llama-server -m /models/large-model.gguf --n-gpu-layers 999 --mmap --ctx-size 4096

The startup log tells you the actual split. Increase context only after confirming that CPU memory remains stable.

MoE model with expert weights on CPU

./llama-server -m /models/moe-model.gguf --n-gpu-layers 999 --cpu-moe --mmap --ctx-size 4096

This sacrifices some CPU-side access speed to keep VRAM available for dense portions and the KV cache.

RAM-constrained, SSD-backed loading

./llama-server -m /models/large-model.gguf --n-gpu-layers 24 --mmap --lazy-mode on --no-kv-offload --ctx-size 2048

Here the reduced GPU layer count and CPU KV cache preserve VRAM, while mmap and lazy mode reduce the need to keep every model page resident. It is the most capacity-oriented pattern and normally the least responsive.

What an SSD upgrade can and cannot solve

An NVMe SSD of 2 TB or more is a sensible capacity choice for local LLM work because it can hold multiple GGUF quantizations, build artifacts, temporary downloads and disk-backed model files. Confirm the interface supported by your computer, available endurance and current capacity before buying. Storage prices and product availability change, so they are not part of the runtime guarantee.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An SSD solves the question “Where can the model file live?” It does not solve “Can the active weights, buffers and KV cache be serviced quickly enough?” If the working set fits in RAM, mmap may perform acceptably because the operating system can cache file pages. If the working set repeatedly exceeds RAM, latency is governed by storage reads and can vary with other disk activity.

Bottom-line decision framework

  • Enough VRAM: set --n-gpu-layers high, verify the actual offloaded count and keep KV cache on GPU.
  • Model larger than VRAM but fits RAM: keep the maximum fitting layers on GPU and let the remaining layers run from CPU/system memory.
  • MoE or FFN weights crowd out useful GPU space: use --cpu-moe, --n-cpu-moe or --n-cpu-ffn as appropriate.
  • RAM is tight: retain mmap and consider --lazy-mode on; expect SSD-driven stalls.
  • KV cache causes the failure: shorten context, reduce concurrency or use --no-kv-offload before sacrificing more model layers.
  • Only swap remains: treat it as emergency protection, not a performance tier.

The llama.cpp performance guide summarizes the GPU-first behavior: when the layer count is set very high, the runtime offloads the maximum number of layers that fit. NVIDIA’s 2026 guidance likewise states that a GGUF checkpoint that fits in available memory can use the same workflow. “Available memory,” however, includes the practical RAM, VRAM, KV-cache and storage constraints described above—not merely the free space shown for the model file.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.