
Confidential document analysis
Lawyers, clinicians and analysts can ask a 70B model about sensitive files without uploading a single word. Once the weights are downloaded, AirLLM runs fully offline.
AirLLM streams model weights one layer at a time. Run compatible 70B models on a 4 GB GPU and process prompts locally after setup.


AirLLM is an open-source Python library that runs inference on large language models without loading the whole model into GPU memory.
Instead of holding every parameter at once, AirLLM splits a model into its individual transformer layers, stores them as shards on your SSD and moves them through the GPU one after another. Each layer is loaded, computed and released before the next arrives, so peak memory equals one layer plus a small set of activations. The result is striking: models that normally demand data-centre hardware run on an ordinary desktop or laptop.
Created by the developer lyogavin and released under the Apache-2.0 licence, AirLLM AI works with Llama, Qwen, DeepSeek, Mistral, ChatGLM, Gemma, Phi and, from version 3.1, Moonshot AI's 2.8-trillion-parameter Kimi K3.
Six capabilities that turn an everyday GPU into a workbench for frontier-scale models.
AirLLM keeps only a single transformer layer in VRAM at any moment. A 70B model whose weights total around 140 GB runs within roughly 4 GB of graphics memory, and the results match conventional inference because every layer still performs exactly the same calculation.
peak VRAM ≈ largest layer + activations
Compress stored weights to shrink every shard. Because AirLLM quantizes weights only and keeps activations at higher precision, accuracy loss stays small while disk reads fall sharply, delivering up to three times faster generation.
AutoModel.from_pretrained(repo, compression="4bit")
While the GPU computes one layer, AirLLM already reads the next from disk. Overlapping input and computation keeps the graphics card busy and trims idle time from every token. It is enabled by default.
prefetching=True # default
A single loader detects the architecture and selects the right implementation, whether you point it at Llama 4, Qwen3, DeepSeek-V3, Mixtral, Phi-4, Gemma or a local fine-tuned checkpoint.
from airllm import AutoModel
For mixture-of-experts models, AirLLM loads only the experts the router selects for each token. That is how DeepSeek-V3 (671B), Qwen3-235B and the 2.8T-parameter Kimi K3 become reachable on consumer hardware.
router → top-k experts → load → compute → release
Run with NVIDIA CUDA on Linux and Windows, with the MLX backend on Apple silicon Macs, or on CPU when no GPU is available. The same Python code works across all of them with minimal changes.
CUDA · MLX · CPU
Every token travels through the same four-stage loop, layer after layer, until the next word appears.
On first use, AirLLM divides the checkpoint into per-layer shards and saves them to your fastest drive.
The next layer's weights move from SSD into GPU memory, while prefetching prepares the one after it.
The GPU runs that layer and hands a small set of activations to the next stage.
The layer is freed, memory returns to its baseline and the loop continues until the token is complete.
Transformer layers depend only on their own weights and the output of the layer before them. AirLLM exploits that independence: no layer needs its neighbours in memory, so VRAM use is set by the single largest layer rather than the whole model.
The trade-off is time. Each new token reads every layer again, which is why fast NVMe storage and compression matter far more for AirLLM speed than raw GPU power.

AirLLM installs like any Python package. Prepare a clean environment, add CUDA-enabled PyTorch and you are ready.
Keep AirLLM's dependencies separate from other projects. Python 3.10 or 3.11 is the most reliable choice.
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activateUse the official index that matches your NVIDIA driver, then confirm the GPU is visible. Mac users can skip this step.
pip install torch --index-url https://download.pytorch.org/whl/cu124
python -c "import torch; print(torch.cuda.is_available())"Add bitsandbytes if you plan to use 4-bit or 8-bit compression. To work from source, extract the ZIP and run pip install -e . inside air_llm.
pip install -U airllm
pip install -U bitsandbytes # optional, for compressionStart with a 7B model to confirm everything works, then move up to 70B and beyond.
from airllm import AutoModel
model = AutoModel.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
ids = model.tokenizer(["Hello, airllm!"], return_tensors="pt")["input_ids"].cuda()
out = model.generate(ids, max_new_tokens=30, use_cache=True, return_dict_in_generate=True)
print(model.tokenizer.decode(out.sequences[0]))AirLLM favours depth over speed. These are the situations where that trade pays off.

Lawyers, clinicians and analysts can ask a 70B model about sensitive files without uploading a single word. Once the weights are downloaded, AirLLM runs fully offline.

Benchmark Llama, Qwen or DeepSeek at original precision on a university workstation instead of waiting for scarce cluster time.

Queue hundreds of summaries, classifications or translations before leaving the office and collect high-quality results in the morning.

Students can watch memory stay flat while layers stream, making transformer architecture tangible on classroom hardware.
Download the latest main-branch archive straight from the official GitHub repository. It includes the Python package, setup script, README and example notebooks.
Prefer pip? Run pip install airllm instead.
AirLLM complements tools such as Ollama rather than replacing them. The right choice depends on model size and how long you can wait.
| Aspect | AirLLM | Ollama | llama.cpp | vLLM |
|---|---|---|---|---|
| VRAM for a 70B model | ≈ 4 GB | ≈ 40 GB+ at 4-bit | ≈ 40 GB+ or CPU offload | Multiple large GPUs |
| Generation speed | Slow, disk-bound | Fast | Fast to moderate | Very fast |
| Model format | Hugging Face | GGUF | GGUF | Hugging Face |
| Quantization required | No, optional | Usually | Usually | Optional |
| Interface | Python library | CLI, API, app | CLI, server | Server, API |
| Best for | Huge models, small GPUs | Everyday local chat | Lightweight local use | Production serving |
Most problems trace back to the PyTorch build, free disk space or storage speed. Open an issue to see the fix.
--index-url https://download.pytorch.org/whl/cu124, then update your NVIDIA driver if needed.max_length and max_new_tokens, enable compression="4bit" and set PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True.layer_shards_saving_path to a larger NVMe drive, delete partial shard folders and retry. delete_original=True frees space after a successful split.hf_token="hf_...".pip install -U bitsandbytes, or remove the compression argument if you do not need it.Storage speed shapes the experience more than any other component.
| Component | Minimum | Recommended | Ideal for MoE giants |
|---|---|---|---|
| GPU | NVIDIA 4 GB VRAM or Apple M1 | NVIDIA 8 GB or Apple M-series 16 GB+ | NVIDIA 12–24 GB |
| Storage | SATA SSD | NVMe Gen3, 3 GB/s | NVMe Gen4/Gen5, several TB |
| Free disk space | 2× model size | 2× model size + 20% | Multiple terabytes |
| System RAM | 16 GB | 32 GB | 64 GB or more |
| Software | Python 3.9, PyTorch | Python 3.10/3.11, CUDA 12.x | Latest AirLLM release |
| Operating system | Linux, Windows 10, macOS 13 | Ubuntu 22.04+, Windows 11, recent macOS | Linux on a dedicated workstation |
AirLLM is open-source, readable and runs entirely on your own hardware, which makes it one of the more transparent ways to use large models.
HF_HUB_OFFLINE=1 for strictly offline use.
AirLLM is an open-source Python library that runs very large language models on small GPUs. It loads one transformer layer at a time instead of the whole model, so a 4 GB graphics card can run a 70B model.
Yes. AirLLM is released under the Apache-2.0 licence, so it is free for personal and commercial use. Individual models you load carry their own licences, which you should check separately.
Use the download section on this page, which links to the official main-branch ZIP on GitHub, or install the published package with pip install airllm.
No. AirLLM is the inference engine. Models are downloaded separately from Hugging Face the first time you load them, or read from a local folder.
Import AutoModel, call from_pretrained with a model repository name, tokenise your prompt and call generate. The installation section shows a complete working example.
No. AirLLM AI refers to the software that runs models. The answers come from whichever model you load, such as Llama, Qwen or DeepSeek.
Only to download packages and model weights. After that it can run completely offline, which is ideal for confidential work.
Yes. AirLLM Windows installations work on Windows 10 and 11 with an NVIDIA GPU. The key step is installing a CUDA-enabled PyTorch build before installing airllm.
Yes, on Apple silicon Macs. AirLLM uses the MLX backend on macOS, and the code is almost identical to Linux. Intel Macs are not supported.
AirLLM speed depends mostly on disk throughput. Large models typically take seconds to around a minute per token on consumer NVMe drives. Compression and faster storage shorten that significantly.
Slightly. AirLLM compresses only the weights using block-wise quantization, so 8-bit output is nearly identical to the original and 4-bit shows minor differences on demanding tasks.
Plan for about twice the model size during the first run, plus a margin. A 70B model at 16-bit precision needs roughly 300 GB free; compressed shards are much smaller.
Yes, CPU inference has been supported since version 2.10, but it is considerably slower. A GPU, even a small one, is strongly recommended.
No, AirLLM is a library. You can build a private browser-based chat interface in a few lines with Gradio, as explained in our AirLLM UI guide.
Llama 2, 3 and 4, Qwen through Qwen3, DeepSeek V2 and V3, Mistral and Mixtral, ChatGLM, Baichuan, InternLM, Phi-4, Gemma and, from version 3.1, Kimi K3.
Yes. AirLLM Kimi K3 support arrived in version 3.1. Because Kimi K3 is a mixture-of-experts model, AirLLM streams only the active experts, though it still needs terabytes of fast storage.
Ollama loads quantized models fully into memory for fast chat. AirLLM streams layers from disk to run far larger models on small GPUs, but more slowly. Many people use both.
No. AirLLM uses standard Hugging Face checkpoints such as safetensors. GGUF files are used by llama.cpp and Ollama.
AirLLM is open source, readable and runs locally. Download it only from GitHub or PyPI, prefer safetensors model files and use a virtual environment to keep dependencies isolated.
The Apache-2.0 licence permits commercial use of AirLLM itself. Each model has its own licence, so confirm the model terms before using outputs in a product.
No. This website is an independent resource that explains the project and links to the official GitHub source. It is not affiliated with AirLLM or its developer.