Who it is forA developer with a laptop GPU who wants to try large models locally.
The problemLarge models normally need far more VRAM than consumer GPUs have, so people rent cloud GPUs to test them.
The outcomeText generated by a large model on your own small GPU, with layers streamed from disk.
What you need first
- Python and pip
- A CUDA GPU (a few GB of VRAM) or a Mac with mlx and torch for Llama-style models
- Lots of disk for split layer shards; some models need specific transformers versions
- Optional: bitsandbytes for compression
Steps
- Run
pip install airllm - In Python,
from airllm import AutoModeland load a model withAutoModel.from_pretrained("Qwen/Qwen3-32B")or another repo ID - Tokenize your prompt with model.tokenizer as in the Quickstart
- Call model.generate with max_new_tokens and decode the output
- Set layer_shards_saving_path if you want the split model saved on a different disk
Prompt for your agent
Install lyogavin/airllm and write a script that loads <Hugging Face model ID> with AutoModel, answers <prompt>, and prints tokens per second. Warn me first if the model's split shards need more free disk than I have.
Caveat. Layer streaming trades speed for memory, so generation is slow; first runs also split and save the model, which needs a lot of disk.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for lyogavin/airllm and "Run a 70B-class model on a single 4GB GPU"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer