{"id":2848,"date":"2026-08-30T18:42:06","date_gmt":"2026-08-30T18:42:06","guid":{"rendered":"https:\/\/dmarketertayeeb.com\/blog\/run-local-llms-low-vram-llama-cpp-pytllm-swap-moe\/"},"modified":"2026-08-30T18:45:12","modified_gmt":"2026-08-30T18:45:12","slug":"run-local-llms-low-vram-llama-cpp-pytllm-swap-moe","status":"publish","type":"post","link":"https:\/\/dmarketertayeeb.com\/blog\/run-local-llms-low-vram-llama-cpp-pytllm-swap-moe\/","title":{"rendered":"How to Run Local LLMs on Low VRAM: llama.cpp, PyTLLM and Swap-MoE"},"content":{"rendered":"\n<p><strong>Short answer:<\/strong> If you want to run an open model on a machine with limited VRAM or RAM, start with an official <a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\">llama.cpp<\/a> build and a compatible GGUF quantization. Let the runtime fit layers automatically, keep the context and server slot count conservative, and measure the output on your hardware. PyTLLM (also branded TLLM) and Swap-MoE are interesting experimental approaches for models that exceed ordinary memory limits, but their headline model-size and speed claims are not independently validated. They should be treated as experiments, not as guaranteed replacements for a smaller model.<\/p>\n\n\n\n<p>This guide is a practical snapshot checked on 30 August 2026. It covers desktop and small-server inference, not model training. The earlier DMT <a href=\"https:\/\/dmarketertayeeb.com\/blog\/you-can-now-run-ai-locally-google-quietly-released-a-game-changing-app\">overview of mobile and on-device AI<\/a> explains why local execution matters; this article focuses on the very different problem of fitting open models into constrained desktop memory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Choose the memory strategy before you choose a model<\/h2>\n\n\n\n<p>\u201cA model has 70 billion parameters\u201d is not a deployment plan. The important questions are where the weights live, how much of each layer must be resident, how much memory the key-value (KV) cache needs, and how much capacity remains for activations and the operating system.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr><th>Approach<\/th><th>What it changes<\/th><th>Best fit<\/th><th>Evidence and trade-off<\/th><\/tr>\n<\/thead>\n<tbody>\n<tr><td>llama.cpp + GGUF<\/td><td>Quantizes weights and can split work between CPU and GPU.<\/td><td>Most constrained desktops; CPU-only or mixed CPU\/GPU machines.<\/td><td>Strongest documented baseline. Quality, speed and supported operations vary by model, quantization and backend.<\/td><\/tr>\n<tr><td>PyTLLM\/TLLM<\/td><td>Streams transformer layers and caches them across VRAM, pinned RAM and disk.<\/td><td>Python\/CUDA users willing to test very large checkpoints.<\/td><td>Promising repository implementation, but model\/VRAM figures are project claims with no independent comparative benchmark found.<\/td><\/tr>\n<tr><td>Swap-MoE<\/td><td>Demand-pages routed MoE experts from an SSD and adds optional expert caching\/prefetch.<\/td><td>MoE experiments where the model file is larger than physical RAM.<\/td><td>Experimental patch tied to a specific llama.cpp commit. SSD latency, quality risk and maintenance burden are real.<\/td><\/tr>\n<tr><td>MLX-LM<\/td><td>Uses Apple Silicon unified memory and MLX quantized models.<\/td><td>Macs with Apple Silicon.<\/td><td>Strong Apple-specific path. It is not a Windows\/NVIDIA replacement, and models larger than RAM can be slow.<\/td><\/tr>\n<tr><td>Transformers + bitsandbytes<\/td><td>Loads 8-bit or 4-bit linear layers in a normal PyTorch stack.<\/td><td>NVIDIA\/compatible GPU users who can fit a quantized checkpoint.<\/td><td>Established quantization path, but it does not provide SSD expert paging and still needs runtime headroom.<\/td><\/tr>\n<tr><td>vLLM CPU\/offload options<\/td><td>Moves selected weights or KV data to host memory for serving.<\/td><td>Higher-throughput servers with a fast CPU-GPU interconnect.<\/td><td>Useful server feature, not a magic fix for a 4 GB GPU or a slow laptop.<\/td><\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Start with a memory budget, not a parameter-count headline<\/h2>\n\n\n\n<p>A useful planning estimate is <code>peak memory = model weights + KV cache + activations\/workspace + runtime and OS headroom<\/code>. It is an estimate, not a sizing guarantee: tensor layouts, multimodal components, batching, context length, backend workspaces and allocator fragmentation all matter.<\/p>\n\n\n\n<p>Quantization changes the weight term. The official llama.cpp quantization guide gives this Llama 3.1 example:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr><th>Model<\/th><th>Original size<\/th><th>Q4_K_M size<\/th><\/tr>\n<\/thead>\n<tbody>\n<tr><td>8B<\/td><td>32.1 GB<\/td><td>4.9 GB<\/td><\/tr>\n<tr><td>70B<\/td><td>280.9 GB<\/td><td>43.1 GB<\/td><\/tr>\n<tr><td>405B<\/td><td>1,625.1 GB<\/td><td>249.1 GB<\/td><\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<p>Those are file-size examples, not the amount of free VRAM required and not a promise that an 8B Q4 model will fit in exactly 4.9 GB. A 70B Q4 file is still about 43.1 GB before the KV cache and runtime overhead. Conversely, a sparse MoE model may have a large total file but activate only part of its experts per token. That is why layer or expert streaming can change the capacity problem, while still leaving a latency and bandwidth problem.<\/p>\n\n\n\n<p>Do not forget the conversion machine. The same official guide says the current quantization process fully loads the model and needs enough RAM and disk for the original and intermediate files. A small target device does not imply that the quantization step can run on that same device.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What changed in llama.cpp in August 2026<\/h2>\n\n\n\n<p>llama.cpp now has two release rhythms. Stable version <strong>v0.2.0<\/strong> was published on 21 August 2026 and its release notes describe the new <code>vX.Y.Z<\/code> line as the slower-cadence choice for downstream distributors and casual users. The <code>b[NUM]<\/code> tags are nightly\/development builds for users who need newer functionality and can absorb more change. For a reproducible how-to, pin a stable tag or a known commit; use a nightly only when a specific fix matters.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The observed latest nightly at the research cutoff was <a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/releases\/tag\/b10699\">b10699<\/a>, published on 30 August 2026. Its headline change improves how RPC asks backends about operations whose transient allocation can expand. That is a correctness and allocation detail, not a universal speed increase.<\/li>\n<li><a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/releases\/tag\/b10684\">b10684<\/a> improves SYCL <code>--fit<\/code> and <code>--fit-target<\/code> accounting for actual peak VRAM at a selected context. The release note\u2019s test used an Intel Arc B70 and a particular Qwen quantization, so do not generalize its result.<\/li>\n<li><a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/releases\/tag\/b10584\">b10584<\/a> makes fit account for server streams and a second or draft model. This matters when speculative or draft execution would otherwise reserve the wrong context memory.<\/li>\n<li><a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/releases\/tag\/b10594\">b10594<\/a> avoids an unnecessary device-information loop that could create a CUDA context and allocate about 550 MB of VRAM when trace-level logging was not requested. It is a useful diagnostic footgun, not a rule for every GPU.<\/li>\n<li><a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/releases\/tag\/b10677\">b10677<\/a> fixes a Vulkan view-alias dependency issue that could silently alter greedy-decoding output for affected stateful models. Correctness checks still matter after a backend or build change.<\/li>\n<\/ul>\n\n\n\n<p>The project also lists OpenVINO, Vulkan, SYCL, OpenCL, CUDA, HIP, Metal and other backends. The <a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/releases\/tag\/b10672\">b10672<\/a> release updated OpenVINO to 2026.3.1 and added related model\/NPU work, while the backend documentation still describes quantized validation as a work in progress. Pick a backend that your model and hardware actually support; the feature list is not a performance ranking.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The recommended baseline: llama.cpp plus GGUF<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Pick a compatible quantized file<\/h3>\n\n\n\n<p>For a first test, use a model-specific GGUF that matches the model\u2019s chat template and architecture. Q4_K_M is a sensible starting point because it is widely supported and balances size and quality reasonably well, but it is not automatically optimal. Test Q5 or Q6 when quality matters and memory permits; use more aggressive formats only when the capacity constraint leaves no practical alternative.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Build or install a known version<\/h3>\n\n\n\n<p>The official build guide provides a plain CPU build and backend-specific instructions. A simple source build is:<\/p>\n\n\n\n<pre><code>cmake -B build\ncmake --build build --config Release<\/code><\/pre>\n\n<p>On Windows, use a Visual Studio developer PowerShell or another supported C++ toolchain. If you need CUDA, Metal, Vulkan, SYCL or OpenVINO, follow that backend\u2019s build section instead of assuming the plain CPU binary contains it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Let the runtime fit the first run<\/h3>\n\n\n\n<p>With a local file, begin conservatively:<\/p>\n\n\n\n<pre><code>llama-cli -m \/models\/model-Q4_K_M.gguf --n-gpu-layers auto --ctx-size 4096 --fit on<\/code><\/pre>\n\n<p>The current server documentation accepts <code>auto<\/code> or <code>all<\/code> for GPU layers and has <code>--fit on<\/code> enabled by default. If the GPU path is unstable, compare against a CPU-only smoke test:<\/p>\n\n\n\n<pre><code>llama-cli -m \/models\/model-Q4_K_M.gguf --n-gpu-layers 0 --ctx-size 4096<\/code><\/pre>\n\n<p>For a local OpenAI-compatible endpoint, start with one slot and a modest context:<\/p>\n\n\n\n<pre><code>llama-server -m \/models\/model-Q4_K_M.gguf --n-gpu-layers auto --ctx-size 4096 --parallel 1<\/code><\/pre>\n\n<p>Only after that works should you test a quantized KV cache such as <code>--cache-type-k q8_0 --cache-type-v q8_0<\/code>, and only where the selected backend supports it. A smaller KV representation can reduce memory pressure, but it is another quality and compatibility variable to measure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Troubleshoot in the least destructive order<\/h3>\n\n\n\n<p>When fitting fails, lower <code>--ctx-size<\/code> first because KV memory grows with context. For a server, lower <code>--parallel<\/code> because each concurrent sequence needs cache capacity. Then reduce <code>--n-gpu-layers<\/code> as a last resort; the remaining layers run on the CPU and generation can become much slower. This order follows the current llama.cpp multi-GPU guidance and keeps the cause of each change visible.<\/p>\n\n\n\n<p>Record the exact model filename, llama.cpp tag, backend, context, slot count and GPU-layer setting. \u201cIt ran\u201d without those details is not a reproducible result.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PyTLLM\/TLLM: layer streaming with a three-tier cache<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/Cognitivess\/pytllm\">PyTLLM<\/a> presents a different answer to the same bottleneck. Its README says it constructs the Transformers model on the meta device, streams one layer to the GPU before it runs, evicts it afterward, and prefetches the next layer. Its cache can keep some layers in VRAM, spill others to pinned host RAM, and reread the remainder from disk.<\/p>\n\n\n\n<p>The project\u2019s model table claims examples such as Llama 3.x 70B in about 4 GB of VRAM, Llama 3.1 405B in about 8 GB, DeepSeek-V3 671B in about 12 GB and Kimi K3 2.8T under 4 GB. Those figures are clearly useful hypotheses for testing, but they are project claims. The repository was created on 24 August 2026, reports zero stars and no issues at this snapshot, and does not provide an independent comparative benchmark or a broad hardware matrix. Do not copy the table into a deployment promise.<\/p>\n\n\n\n<p>A minimal experiment looks like this:<\/p>\n\n\n\n<pre><code>pip install pytllm<\/code><\/pre>\n\n<pre><code>from pytllm import AutoModel\n\nmodel = AutoModel.from_pretrained(\n    \"Qwen\/Qwen3-32B\",\n    cache_layers=True,\n    vram_cache_reserve_gb=2.0,\n)\n\ninputs = model.tokenizer(\n    [\"Summarize this document in five bullets.\"],\n    return_tensors=\"pt\",\n    return_attention_mask=False,\n    truncation=True,\n    max_length=512,\n    padding=False,\n)\noutput = model.generate(\n    inputs[\"input_ids\"].cuda(),\n    max_new_tokens=128,\n    use_cache=True,\n)\nprint(model.tokenizer.decode(output[0]))<\/code><\/pre>\n\n<p>Use the exact model documentation, not just the repository headline. The first run can split the original checkpoint into per-layer shards and temporarily need roughly twice the disk space. The README says compression disables the layered cache because compressed shards are decompressed on each load. Native dtype, Transformers version, CUDA\/PyTorch compatibility, tokenizer behavior and disk capacity are all part of the test.<\/p>\n\n\n\n<p>My recommendation is to use PyTLLM for an offline experiment when the normal Transformers path is already familiar and the disk\/RAM budget is understood. Compare it with a smaller llama.cpp GGUF model on the same prompt. If the goal is a dependable team endpoint, wait for independent reproducibility, issue history and a documented upgrade path before making it the default.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Swap-MoE: when a sparse model is larger than physical RAM<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/ek15072809\/Swap-MoE\">Swap-MoE<\/a> is not another model format or a drop-in binary. It is an MIT-licensed patch set against llama.cpp. Its core idea is to keep routed expert tensors memory-mapped on an SSD and let demand paging pull selected expert pages into RAM. Router tensors and shared experts stay resident because every token needs them.<\/p>\n\n\n\n<p>The current README says the patch targets llama.cpp commit <code>f5e85d43a<\/code> from 28 August 2026. A simplified CPU-only build path is:<\/p>\n\n\n\n<pre><code>git clone https:\/\/github.com\/ggml-org\/llama.cpp.git\ncd llama.cpp\ngit checkout f5e85d43a\ngit apply \/path\/to\/llama.cpp-expert-streaming.patch\ncmake -B build -DCMAKE_BUILD_TYPE=Release\ncmake --build build --config Release<\/code><\/pre>\n\n<p>The patch adds several flags:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr><th>Flag<\/th><th>Purpose<\/th><th>Important caution<\/th><\/tr>\n<\/thead>\n<tbody>\n<tr><td><code>--expert-streaming<\/code><\/td><td>Demand-page routed expert weights from the SSD.<\/td><td>Needs the patched build and an SSD fast enough for the workload.<\/td><\/tr>\n<tr><td><code>--expert-keep-recent N<\/code><\/td><td>Explicitly retain a per-layer recent-expert window.<\/td><td>The report found explicit eviction slower than letting the OS manage its page cache in most tests.<\/td><\/tr>\n<tr><td><code>--expert-fixation N<\/code><\/td><td>Reuse a router choice for a short window to reduce SSD reads.<\/td><td>It changes routing and can collapse generation quality; the README says it is CPU-backend-only.<\/td><\/tr>\n<tr><td><code>--expert-prefetch<\/code><\/td><td>Warm predicted next-pass expert pages in a background thread.<\/td><td>It does not change routing, but predictions and storage latency remain workload-dependent.<\/td><\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<p>Start with the accuracy-preserving mechanism and measure:<\/p>\n\n\n\n<pre><code>llama-cli -m \/models\/DeepSeek-V4-Flash-0731-IQ1_M.gguf \\\n  --expert-streaming \\\n  --expert-prefetch \\\n  --ctx-size 2048 \\\n  -n 128<\/code><\/pre>\n\n<p>The repository\u2019s README reports CPU-only measurements on one 13th-generation Intel Core i7, 16 GB of RAM and an NVMe SSD. It reports expert streaming at 7.01 tokens per second for Qwen3.5-35B-A3B Q4_K_M, 2.00 for Qwen3.5-122B-A10B Q2_K and 0.75 for MiniMax-2.7 IQ1_M. The linked eight-page report covers three models and says fixation produced visibly repetitive or incoherent output in several configurations even when the raw token rate looked acceptable. These figures are feasibility evidence from one machine, not a cross-hardware benchmark.<\/p>\n\n\n\n<p>There is also a systems trade-off beyond speed. A 2025 IEEE Computer Architecture Letters analysis estimated that SSD-offloaded MoE inference can consume up to about 12 times the per-token generation energy of an HBM baseline under its assumptions. That study does not benchmark Swap-MoE, so it is not a verdict on this patch. It is a reason to describe SSD paging as a capacity escape hatch with a storage cost, not as free or green compute.<\/p>\n\n\n\n<p>Use Swap-MoE only when you are comfortable pinning the upstream commit, rebuilding after upstream changes, keeping backups, checking output quality and accepting that a future llama.cpp update may require a new port. For a normal low-VRAM desktop, a smaller quantized model is usually the lower-risk choice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Alternatives that may fit your hardware better<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Apple Silicon: MLX-LM<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/ml-explore\/mlx-lm\">MLX-LM<\/a> is built for Apple Silicon and can use MLX\u2019s unified memory, where CPU and GPU operations share the same memory pool. Its README documents quantization, rotating KV caches and a configurable prefill step size. It also warns that models larger than available RAM can be slow and that its large-model memory wiring requires macOS 15 or newer. If you have a Mac, test an MLX-community quantized model before forcing a CUDA-oriented workflow onto it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Standard Transformers: bitsandbytes<\/h3>\n\n\n\n<p>The official <a href=\"https:\/\/huggingface.co\/docs\/transformers\/quantization\/bitsandbytes\">Transformers bitsandbytes integration<\/a> exposes 8-bit and 4-bit loading through <code>BitsAndBytesConfig<\/code>. This is a sensible choice when you need the Python Transformers ecosystem and the quantized checkpoint plus runtime fits in available memory. It is not an SSD expert-streaming system; lower-bit weights still leave KV, activations, framework overhead and model-specific requirements.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Serving hardware: vLLM CPU offload<\/h3>\n\n\n\n<p>vLLM\u2019s current engine documentation exposes <code>--cpu-offload-gb<\/code>, KV offloading and asynchronous layer-group offload. The docs describe CPU offload as a per-GPU virtual memory extension and warn that weights move from CPU memory to GPU memory during forward passes, which requires a fast CPU-GPU interconnect. That can be useful on a server with the right bus and RAM. It is a poor default for a low-end laptop with a slow interconnect.<\/p>\n\n\n\n<p>Research such as <a href=\"https:\/\/arxiv.org\/abs\/2312.11514\">LLM in a flash<\/a> and <a href=\"https:\/\/arxiv.org\/abs\/2508.06978\">the SSD-offloading energy analysis<\/a> is valuable for understanding windowing, contiguous reads, latency and energy. These papers are not installation guides. Keep research results separate from a supported consumer workflow.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Measure the setup honestly<\/h2>\n\n\n\n<p>Before comparing tools, define what \u201cuseful\u201d means. The <a href=\"https:\/\/dmarketertayeeb.com\/blog\/ai-agent-cost-per-accepted-result-calculator\">accepted-result evaluation method<\/a> is a good reminder that a raw speed number is not the same as an accepted result.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Pin the model file, quantization, runtime version, backend, driver and operating-system build.<\/li>\n<li>Use a fixed prompt set and generation length. Keep the seed and sampling settings fixed when the runtime permits it.<\/li>\n<li>Measure cold start and warm decode separately. Record time to first token, prompt processing, decode tokens per second, peak VRAM, peak process RAM and available SSD space.<\/li>\n<li>Run at least one quality check against a smaller known-good model or a full-memory reference. Look for repetition, truncated answers, wrong tool calls, broken formatting and loss of instruction following.<\/li>\n<li>Change one variable at a time: context, slot count, GPU layers, quantization, KV type, prefetch or cache. Keep a short test log.<\/li>\n<li>Stop if the machine begins swapping heavily, the SSD is nearly full, the output becomes incoherent or the backend reports numerical errors. \u201cIt eventually produced text\u201d is not a production gate.<\/li>\n<\/ol>\n\n\n\n<p>For a marketing team, also inspect the data path. Local weights do not automatically mean private processing if prompts are logged, a UI calls a remote service, plugins have network access or the model directory is shared. Document retention, access and failure behavior before using local inference for client material.<\/p>\n\n\n\n<p>If you are evaluating a model because it is open-weight, separate the license, access and safety questions from the memory question. DMT\u2019s <a href=\"https:\/\/dmarketertayeeb.com\/blog\/anthropic-position-open-weight-models\">open-weight model context<\/a> is a useful adjacent read before a team treats \u201copen\u201d as a complete governance answer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How this fits a practical marketing stack<\/h2>\n\n\n\n<p>Local inference is best framed as one component in a governed workflow, not as a universal replacement for hosted models. The <a href=\"https:\/\/dmarketertayeeb.com\/blog\/ai-in-digital-marketing-2026-guide\">2026 AI in digital marketing overview<\/a> provides the wider strategy context. A local model may be useful for offline classification, first-pass content grouping, private drafts or repetitive transformations when latency and quality are acceptable.<\/p>\n\n\n\n<p>Use the <a href=\"https:\/\/dmarketertayeeb.com\/blog\/ai-marketing-automation-guide-2026\">AI automation workflow reference<\/a> to map where a model belongs in an end-to-end process, then add explicit human review, source checks and rollback. A local model that saves API cost but creates a silent factual or brand error is not a saving.<\/p>\n\n\n\n<p>The operational layer matters too. A <a href=\"https:\/\/dmarketertayeeb.com\/blog\/technical-seo-guide\">technical SEO crawl and monitoring guide<\/a> is useful for thinking about observability and crawl\/render failure modes; apply the same discipline to model versioning, prompt fixtures, logs and endpoint health. If the workflow is agentic, compare it with the <a href=\"https:\/\/dmarketertayeeb.com\/blog\/agentic-ai-in-marketing-2026\">agentic workflow guide<\/a> and keep tool permissions narrower than the model\u2019s imagination.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A simple decision tree<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr><th>Question<\/th><th>First path to test<\/th><\/tr>\n<\/thead>\n<tbody>\n<tr><td>Do you need the lowest-risk general desktop path?<\/td><td>llama.cpp with a compatible Q4_K_M GGUF, automatic fitting and a conservative context.<\/td><\/tr>\n<tr><td>Are you on Apple Silicon?<\/td><td>Compare MLX-LM with llama.cpp Metal using the same prompt and quality checks.<\/td><\/tr>\n<tr><td>Do you need Python Transformers features and can fit a quantized model?<\/td><td>Transformers plus bitsandbytes 8-bit or 4-bit loading.<\/td><\/tr>\n<tr><td>Is a sparse MoE file larger than RAM and are you willing to build a patch?<\/td><td>Evaluate Swap-MoE expert streaming on an NVMe SSD; do not enable fixation until quality is proven.<\/td><\/tr>\n<tr><td>Does a very large full-precision checkpoint matter more than latency?<\/td><td>Run a bounded PyTLLM experiment, account for first-run disk duplication and verify output before scaling.<\/td><\/tr>\n<tr><td>Do you need multi-user serving?<\/td><td>Use a server-oriented runtime such as llama-server or vLLM, then size slots, KV cache and interconnect explicitly.<\/td><\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Can a 4 GB GPU run a 70B model?<\/h3>\n\n\n\n<p>It depends on the runtime, quantization, host RAM, context and what \u201crun\u201d means. The official llama.cpp example lists a 70B Llama 3.1 Q4_K_M file at 43.1 GB, so ordinary full-file loading is not a 4 GB-GPU scenario. PyTLLM\u2019s README claims a 70B full-precision example at about 4 GB of VRAM through layer streaming, but that is an unverified project claim and still involves host\/disk work. Treat it as a test hypothesis, not a guarantee.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Which quantization should I try first?<\/h3>\n\n\n\n<p>Start with a model-specific Q4_K_M GGUF, then compare Q5 or Q6 if quality matters and memory allows. Quantization tables and speed figures are format- and hardware-specific. Keep a known-good reference so a smaller file does not quietly become a lower-quality workflow.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does SSD offload make large models fast?<\/h3>\n\n\n\n<p>No. It can make some models launch when resident memory would fail, but storage bandwidth and latency remain in the critical path. Swap-MoE\u2019s own measurements show a wide range of token rates on one NVMe machine, while independent research warns about SSD energy cost. Capacity and throughput are different problems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is PyTLLM production-ready?<\/h3>\n\n\n\n<p>The repository is new and its headline VRAM table is self-reported. Test the exact model, Transformers version, GPU, RAM budget, disk capacity and output quality. Until independent benchmarks and a stable maintenance history exist, keep it in an experimental lane.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I avoid an out-of-memory error?<\/h3>\n\n\n\n<p>Lower context first, lower server parallelism next, and reduce GPU layers last. Then inspect KV-cache type, backend support and hidden multimodal or draft-model memory. Keep headroom for the operating system instead of filling every advertised byte.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is Swap-MoE part of official llama.cpp?<\/h3>\n\n\n\n<p>No. It is a separate patch set tied to a specific upstream commit. Pin both repositories, retain the patch, test output quality and expect to re-port it after upstream loader or graph changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sources and version notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\">llama.cpp repository<\/a> and <a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/blob\/master\/tools\/quantize\/README.md\">quantization guide<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/blob\/master\/tools\/server\/README.md\">llama.cpp server options<\/a> and <a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/blob\/master\/docs\/multi-gpu.md\">multi-GPU and fit guidance<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/releases\/tag\/v0.2.0\">llama.cpp v0.2.0 stable release<\/a> and <a href=\"https:\/\/github.com\/ggml-org\/llama.cpp\/releases\/tag\/b10699\">b10699 nightly release<\/a>, observed 30 August 2026.<\/li>\n<li><a href=\"https:\/\/github.com\/Cognitivess\/pytllm\">PyTLLM\/TLLM repository<\/a>, including its README, implementation and tests.<\/li>\n<li><a href=\"https:\/\/github.com\/ek15072809\/Swap-MoE\">Swap-MoE repository<\/a> and its <a href=\"https:\/\/github.com\/ek15072809\/Swap-MoE\/blob\/main\/docs\/Swap-MoE_Technical_Report.pdf\">technical report<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/ml-explore\/mlx-lm\">MLX-LM<\/a>, <a href=\"https:\/\/huggingface.co\/docs\/transformers\/quantization\/bitsandbytes\">Transformers bitsandbytes documentation<\/a> and <a href=\"https:\/\/docs.vllm.ai\/en\/latest\/configuration\/engine_args\/\">vLLM engine arguments<\/a>.<\/li>\n<li><a href=\"https:\/\/arxiv.org\/abs\/2312.11514\">LLM in a flash<\/a> and <a href=\"https:\/\/arxiv.org\/abs\/2508.06978\">SSD Offloading for LLM Mixture-of-Experts Weights Considered Harmful in Energy Efficiency<\/a>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Bottom line:<\/strong> Use llama.cpp and a measured GGUF baseline first. Reach for MLX-LM or bitsandbytes when your hardware and software stack point there. Use PyTLLM or Swap-MoE when you deliberately want to test an experimental capacity escape hatch and are prepared to validate the result yourself.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Compare llama.cpp, PyTLLM, Swap-MoE, MLX-LM and bitsandbytes for local LLMs on limited VRAM or RAM, with safe settings and honest benchmarks.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[180,178],"tags":[446,443,442,441,440,444,445],"class_list":["post-2848","post","type-post","status-publish","format-standard","hentry","category-ai-news","category-artificial-intelligence","tag-ai-hardware","tag-gguf","tag-llama-cpp","tag-llm-inference","tag-local-ai","tag-low-vram","tag-open-models","no-featured-image"],"_links":{"self":[{"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/posts\/2848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/comments?post=2848"}],"version-history":[{"count":1,"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/posts\/2848\/revisions"}],"predecessor-version":[{"id":2849,"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/posts\/2848\/revisions\/2849"}],"wp:attachment":[{"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/media?parent=2848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/categories?post=2848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dmarketertayeeb.com\/blog\/wp-json\/wp\/v2\/tags?post=2848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}