{"id":23,"date":"2026-10-21T04:13:22","date_gmt":"2026-10-21T04:13:22","guid":{"rendered":"https:\/\/newsmagazinexpro.kinsta.cloud\/demo\/?p=23"},"modified":"2026-10-21T16:32:56","modified_gmt":"2026-10-21T16:32:56","slug":"run-70b-llm-4gb-gpu-airllm","status":"publish","type":"post","link":"https:\/\/www.firevm.com\/blog\/run-70b-llm-4gb-gpu-airllm\/","title":{"rendered":"How to Run 70B LLMs on a 4GB GPU with AirLLM"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">The short version (TL;DR)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">AirLLM is an open-source Python library. It runs very large language models on a GPU with as little as 4GB of VRAM. It keeps one layer of the model on the GPU at a time and reads the rest from disk. The README says a 70B model fits on a 4GB card without quantization. It lists Kimi K3 (2.8T) in under 4GB, Qwen3.8-Flash-Next (125B) in about 6GB, and DeepSeek-V3 (671B) in about 12GB.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We explain it with pictures and graphs: a layer diagram, a speed chart, and a quick decision guide for you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The catch is speed. Every token is read from disk. The release notes measure Kimi K3 at 292 seconds per token. So it suits overnight batch jobs and experiments. Chat is too slow.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The project is lyogavin\/airllm on GitHub. It uses the Apache 2.0 license and has close to 40k stars.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The problem: big models need big GPUs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A 70B model at 16-bit precision is about 140GB of weights. No consumer GPU holds that much. The usual fixes are a quantized copy, a rented GPU, or a paid API. AirLLM does something else. It keeps the full-precision weights and changes how they reach the GPU.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The fix: stream one layer at a time<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">AirLLM keeps one layer of the model on the GPU at a time. The VRAM you need depends on the size of one layer. The whole model stays on disk.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the first run, AirLLM splits the downloaded model into one file per layer. When you generate text, it loads a layer, runs it, and frees it. Then it moves to the next layer. Mixture-of-experts models like Kimi K3 get one more trick. The README says AirLLM loads only the experts each token is routed to.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"630\" src=\"https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/02-layer-streaming-1024x630-1.webp\" alt=\"\" class=\"wp-image-613\" srcset=\"https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/02-layer-streaming-1024x630-1.webp 1024w, https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/02-layer-streaming-1024x630-1-300x185.webp 300w, https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/02-layer-streaming-1024x630-1-768x473.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What it can run (and the VRAM it needs)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The README lists VRAM figures from about 1GB for 8B models up to 12GB for DeepSeek-V3. Table 1 collects them. The README says Qwen3.8-27B, Qwen3.8-Flash-Next, and Kimi K3 were measured on an RTX 3090, an RTX 4090, and an RTX 6000 Ada.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th colspan=\"3\">Table 1: Models and GPU VRAM listed in the AirLLM README<\/th><\/tr><tr><td><strong>Model<\/strong><\/td><td><strong>Size<\/strong><\/td><td><strong>GPU VRAM<\/strong><\/td><\/tr><tr><td>Qwen3 \/ Mistral \/ Phi<\/td><td>8B<\/td><td>~1 to 2 GB<\/td><\/tr><tr><td>Qwen3.8-27B (dense, vision)<\/td><td>27B<\/td><td>3.33 GB<\/td><\/tr><tr><td>Qwen3-30B \/ Mixtral (MoE)<\/td><td>30 to 47B<\/td><td>~1 to 3 GB<\/td><\/tr><tr><td>Llama 3.x (full precision)<\/td><td>70B<\/td><td>~4 GB<\/td><\/tr><tr><td>Qwen3.8-Flash-Next (MoE + PLE)<\/td><td>~180B<\/td><td>5.95 GB<\/td><\/tr><tr><td>Qwen3-235B (MoE)<\/td><td>235B<\/td><td>~3 GB<\/td><\/tr><tr><td>Llama 3.1<\/td><td>405B<\/td><td>~8 GB<\/td><\/tr><tr><td>DeepSeek-V3<\/td><td>671B<\/td><td>~12 GB<\/td><\/tr><tr><td>Kimi K3<\/td><td>2.8T<\/td><td>3.72 GB<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The README says it works with most popular open models through one <code>AutoModel<\/code> class. That includes Llama, Qwen, DeepSeek, Mistral, Mixtral, Phi, Gemma, ChatGLM, Baichuan, InternLM, and Yi.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Run it yourself right now (it&#8217;s easy)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Three steps take you from install to a first answer. Start with an 8B model. Check your setup before you commit disk space to a 70B download.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install AirLLM<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Install the package from PyPI.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install airllm<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Some models need extra packages. Qwen3.8-Flash-Next needs a recent <code>transformers<\/code> build. Kimi K3 needs <code>compressed-tensors<\/code> and <code>flash-attn<\/code>. Both are covered in the challenges section.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Run your first model<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Pass a Hugging Face repo ID or a local path to <code>AutoModel.from_pretrained<\/code>. Then generate text the way you would with any transformers model.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from airllm import AutoModel\n\nMAX_LENGTH = 128\nmodel = AutoModel.from_pretrained(\"Qwen\/Qwen3-32B\")\n\ninput_text = &#91;'What is the capital of United States?']\n\ninput_tokens = model.tokenizer(input_text,\n    return_tensors=\"pt\",\n    return_attention_mask=False,\n    truncation=True,\n    max_length=MAX_LENGTH,\n    padding=False)\n\ngeneration_output = model.generate(\n    input_tokens&#91;'input_ids'].to(model.device),\n    max_new_tokens=20,\n    use_cache=True,\n    return_dict_in_generate=True)\n\nprint(model.tokenizer.decode(generation_output.sequences&#91;0]))<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To go bigger, change only the model ID. The README uses <code>Qwen\/Qwen3-235B-A22B<\/code> for the 235B model. It uses <code>deepseek-ai\/DeepSeek-V3<\/code> for the 671B one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Gated models, such as Llama, need a Hugging Face token. Pass it with the <code>hf_token<\/code> argument.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Speed it up with compression<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">AirLLM has an optional compression mode. It uses block-wise quantization. The README says it can speed up inference by up to 3x, with almost no accuracy loss. Install <code>bitsandbytes<\/code>, then pass the <code>compression<\/code> argument.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -U bitsandbytes<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>model = AutoModel.from_pretrained(\"garage-bAInd\/Platypus2-70B-instruct\",\n                                  compression='4bit')  # or '8bit'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Disk loading is the bottleneck. Smaller weights mean less to load. Only the weights get quantized. That makes accuracy easier to keep.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bonus: fine-tune big models on a low-VRAM GPU<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">AirLLM can also fine-tune big models. The README says Qwen3.8-Flash-Next (125B) trains in under 6GB. Qwen3.8-27B trains in about 2GB at sequence length 512. The frozen base weights stream from disk one layer at a time. Only the LoRA adapters stay on the GPU. It runs on its own code path, separate from Hugging Face Trainer and bitsandbytes QLoRA.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your data is a <code>.jsonl<\/code> file with one JSON object per line. The usual field is <code>text<\/code>. Prompt and completion pairs also work.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python air_llm\/examples\/train_qwen38_flash_next_lora.py \\\n  --data my_data.jsonl \\\n  --seq-len 512 \\\n  --epochs 1 \\\n  --save-adapter qwen38-flash-next-lora.pt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For the 27B dense model, use <code>train_qwen38_lora.py<\/code> instead. Add <code>--steps N<\/code> for a quick test run.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The challenges: speed, disk space, and requirements<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A 4GB GPU covers the VRAM. The load moves to your disk and your system RAM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Speed.<\/strong> Every token passes through all the layers. Every layer is read from disk. The README says disk loading is the bottleneck. That is why it offers compression. The Kimi K3 release notes give one figure: 292 seconds per token on an RTX 6000 Ada. The next section has more numbers. A fast NVMe drive matters more than a faster GPU. Test on your own hardware first.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Disk space.<\/strong> The first run splits the model into layer files. You need room for both copies. The README suggests <code>delete_original=True<\/code> to remove the original download. If you see a <code>MetadataIncompleteBuffer<\/code> error, the README&#8217;s first guess is a full disk.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Extra requirements.<\/strong> The biggest models have their own conditions. Table 2 lists them.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th colspan=\"3\">Table 2: Extra requirements for specific models<\/th><\/tr><tr><td><strong>Model<\/strong><\/td><td><strong>Disk and RAM<\/strong><\/td><td><strong>Software<\/strong><\/td><\/tr><tr><td>Qwen3.8-27B<\/td><td>Not stated<\/td><td><code>transformers<\/code> 5.8 or newer<\/td><\/tr><tr><td>Qwen3.8-Flash-Next<\/td><td>~360GB checkpoint disk, 64GB host RAM<\/td><td><code>transformers<\/code> build with <code>qwen4_exp<\/code>, installed from GitHub<\/td><\/tr><tr><td>Kimi K3<\/td><td>Not stated<\/td><td><code>compressed-tensors<\/code>, <code>flash-attn<\/code>, CUDA 12 build of torch, <code>transformers<\/code> 4.56.x<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>macOS.<\/strong> It runs on Apple silicon only. For now it supports only Llama-style models, such as Llama and Mistral.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Is it worth it? What critics and forums say<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Most of the pushback is about speed. Nobody disputes the memory claim. The <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/news.ycombinator.com\/item?id=49154228\">Hacker News thread<\/a> reached 232 points and 84 comments. Reviews and commenters agree that a 70B model runs in about 4GB of VRAM. They say it is too slow for most people. Table 3 collects the speeds people report.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th colspan=\"3\">Table 3: Speeds reported for AirLLM and alternatives<\/th><\/tr><tr><td><strong>Setup<\/strong><\/td><td><strong>Speed<\/strong><\/td><td><strong>Basis<\/strong><\/td><\/tr><tr><td>AirLLM, Kimi K3, RTX 6000 Ada 48GB<\/td><td>292 s\/token, plus 900 s one-time init<\/td><td>Measured, <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/lyogavin\/airllm\/releases\">AirLLM v3.1.0 release notes<\/a><\/td><\/tr><tr><td>AirLLM, 70B fp16, Gen4 NVMe, cold<\/td><td>~20 s\/token<\/td><td>Calculated from 141GB of weights at ~7GB\/s (<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/runaihome.com\/blog\/airllm-70b-4gb-vram-inference-guide-2026\/\">RunAIHome<\/a>)<\/td><\/tr><tr><td>AirLLM, 70B, 4-bit compression, warm cache<\/td><td>~0.3 tokens\/s<\/td><td>One hands-on test, as cited by RunAIHome<\/td><\/tr><tr><td>AirLLM, 70B on a MacBook<\/td><td>~14 s\/token<\/td><td>Community reports, as cited by <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/dev.to\/arshtechpro\/airllm-runs-a-70b-model-on-a-4gb-gpu-its-true-and-thats-not-the-interesting-part-hha\">DEV Community<\/a><\/td><\/tr><tr><td>llama.cpp, 70B Q4_K_M held in 64GB RAM<\/td><td>2 to 4 tokens\/s<\/td><td>Estimate from RunAIHome<\/td><\/tr><tr><td>llama.cpp, quantized 70B on an RTX 4090<\/td><td>8 to 15 tokens\/s<\/td><td>Figure cited by DEV Community<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"630\" src=\"https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/03-speed-chart-1024x630-1.webp\" alt=\"\" class=\"wp-image-612\" srcset=\"https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/03-speed-chart-1024x630-1.webp 1024w, https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/03-speed-chart-1024x630-1-300x185.webp 300w, https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/03-speed-chart-1024x630-1-768x473.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The maintainer&#8217;s own number.<\/strong> The K3 release notes call 292 seconds per token disk-bound. A 100-token reply would take a little over eight hours. Several Hacker News commenters first read it as tokens per second. One commenter ran the cost. They assumed 100 watts and Moonshot&#8217;s published API prices. They found the local run costs about 80 times more than the API. Those are their assumptions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Faster alternatives exist.<\/strong> Reviewers point to llama.cpp with a quantized model. RunAIHome says it is 10 to 50 times faster than AirLLM when the model fits in RAM. One Hacker News commenter asked what AirLLM adds over that setup. These ratios come from blog estimates. Treat them as rough.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>RAM sets your speed.<\/strong> The operating system caches layers once they are read. Later passes read from memory. That is why reports differ so much between a 16GB machine and a 128GB machine. RunAIHome&#8217;s view is that AirLLM only feels usable on machines with enough RAM that you may not have needed it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The &#8220;no quantization&#8221; claim has fine print.<\/strong> The speedup in Step 3 comes from 4-bit or 8-bit compression. That is quantization. You pick full precision or the faster mode.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Disk wear is disputed.<\/strong> DEV Community warns that constant full-model reads are not what consumer drives were built for. RunAIHome says endurance ratings count writes. On that view, reads are safe and the wear happens once, when the shards are written. I could not verify either claim. Check your own drive&#8217;s rating.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Project quality.<\/strong> A few Hacker News commenters called the documentation thin. Some worried about long-term maintenance. The <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/lyogavin\/airllm\/releases\">release page<\/a> shows regular releases. The latest is v4.0.0 on 5 September.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Where critics still see value.<\/strong> The same sources agree on some uses. Those are overnight batch jobs, full-precision evaluation, and data that can&#8217;t leave your machine. DEV Community cites one reported benchmark. Batching 50 prompts cut the cost from 35 to 5.3 seconds per token. The layer loading is shared across the batch. I could not trace that figure to its source.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The takeaway<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">AirLLM trades speed for reach. Models that once needed a cluster now run on one consumer card. That suits experiments, evaluation, and fine-tuning. For fast answers, use a multi-GPU setup.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"630\" src=\"https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/04-decision-flow-1024x630-1.webp\" alt=\"\" class=\"wp-image-611\" srcset=\"https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/04-decision-flow-1024x630-1.webp 1024w, https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/04-decision-flow-1024x630-1-300x185.webp 300w, https:\/\/www.firevm.com\/blog\/wp-content\/uploads\/2026\/10\/04-decision-flow-1024x630-1-768x473.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you have a spare GPU and a fast SSD, install it and run an 8B model first. Then raise the model size. See where your disk becomes the limit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AirLLM streams one layer at a time, so a 70B model fits on a 4GB GPU. See how it works, how to run it, and how fast it really is.<\/p>\n","protected":false},"author":1,"featured_media":618,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[11],"class_list":["post-23","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-engineering","tag-editors-pick"],"_links":{"self":[{"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":4,"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":617,"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/posts\/23\/revisions\/617"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/media\/618"}],"wp:attachment":[{"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.firevm.com\/blog\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}