14 November 2026

دليل · Guide7 min read

شغّل موديل ضخم على كرت شاشة صغير مع AirLLM: متى ينفعك وكيف تبدأ بدون مفاجآتRun a Huge Model on a Small GPU with AirLLM: When It Helps and How to Start Without Surprises

Learn how AirLLM runs a 70 billion parameter model on a 4 GB GPU, what it costs in time and disk, and how to get your first run right.

Who this guide is for

Developers and curious builders with an ordinary GPU who want to try big models on their own machine

Key terms

Layer
A model is a stack of layers. Llama at 70 billion parameters has 80 of them, and every word passes through them one by one.
VRAM
The memory on the graphics card. The usual way needs the whole model to fit, and a 70B model in full precision is about 140 GB.
AirLLM
An open source library that loads one layer onto the GPU, runs it, drops it and loads the next. The card only has to hold one layer.
Token
A piece of a word the model writes. Every new token has to pass through all the layers again.

The steps

  1. Step 1

    Decide if your job fits AirLLM

    AirLLM is not for chat. Every token the model writes reads every layer off your disk again, so answers come out very slowly.

    It fits a job you leave running overnight, like summarising files or labelling text, or testing a huge model on your own machine before you rent a server.

    Here is my task: [task description]. I have about [count] inputs and each answer needs about [word count] words. Does this suit a slow overnight batch run on a large model, or is a smaller, faster model better? Explain briefly.
    PromptAsk Claude if your task fits

    Tip: If you need a reply in seconds, use a small local model or a cloud service instead.

  2. Step 2

    Estimate the time before you start

    Rough rule: seconds per token is about the model's size on disk divided by your disk's read speed.

    Example: a 140 GB model on a fast SSD reading about 7 GB per second is roughly 20 seconds per token. A slower SSD makes it much longer. This is an estimate; your machine decides the real number.

    The model is [size in GB] and my disk reads at [speed in GB per second]. I need [number of answers] answers of about [tokens] tokens each. Estimate the total time in hours and say it is an estimate.
    PromptQuick math
  3. Step 3

    Free up disk space

    AirLLM splits the model into layers and saves them to disk before the first run, so you need room for the original and the split copy.

    For a 70B model in full precision keep well over 100 GB free, ideally twice the model's size. Short on space? delete_original=True removes the original after the split and saves about half.

    Tip: A MetadataIncompleteBuffer error usually means the disk ran out.

  4. Step 4

    Install AirLLM

    You need Python and an NVIDIA GPU, or a Mac with Apple silicon. On a Mac install mlx and torch first; macOS currently runs Llama and Mistral style models only.

    Then install the library with one terminal command.

    A terminal window with the command pip install airllm
    IllustrationType this command in your terminal
    pip install airllm
    PromptInstall
  5. Step 5

    Try a small model first

    Before the giant one, run a smaller model to check everything works and see the speed on your machine. The same code works for every model; only the name changes.

    Put the Hugging Face model name in [model name]. Gated models need an hf_token.

    from airllm import AutoModel model = AutoModel.from_pretrained("[model name]") input_tokens = model.tokenizer(["[your question]"], return_tensors="pt", return_attention_mask=False, truncation=True, max_length=128, padding=False) out = model.generate(input_tokens['input_ids'].to(model.device), max_new_tokens=20, use_cache=True, return_dict_in_generate=True) print(model.tokenizer.decode(out.sequences[0]))
    PromptFirst run (Python)
  6. Step 6

    Turn on compression to speed it up

    The bottleneck is reading from disk, so smaller layers mean faster runs. AirLLM has a compression option, 4bit or 8bit, and the project page says it speeds things up by up to 3x with a small accuracy cost.

    Want full precision? Leave it off and accept the wait.

    model = AutoModel.from_pretrained("[model name]", compression='4bit')
    PromptWith compression
  7. Step 7

    Run it as an overnight batch

    Put all your questions in one file and let a script work through them, saving each answer as it goes. Keep max_new_tokens as small as the job allows; every extra token is extra time.

    Keep the machine plugged in and don't run anything heavy on it meanwhile.

    Write me a Python script that uses AirLLM: it reads questions from [file name] line by line, runs each on the model [model name] with max_new_tokens=[number], and appends each answer to a JSONL file as it goes so I can resume if it stops.
    PromptAsk Claude for the script

Ready prompts to copy

I tried [model name] on my machine with AirLLM and got these answers: [answers]. Help me decide: is the quality worth renting a GPU server to run it fast? Roughly what would [hours] hours cost?
PromptCompare before you rent a server

The takeaway

AirLLM lets a small GPU run a huge model, and the price is time. Use it for overnight jobs and tests, not chat.

Most value

Start building with me now

We sit together, break down your problem, and I build the AI solution with you step by step

60minutes
  • A private session with you
  • Real building during the session
  • Results you take with you when we finish
Book a build session

100% free

A free consultation about your problem

Start