0xSojalSec/airllmFork

Runs 405B LLMs on 8GB VRAM

AI summary: Run massive language models like 405B Llama 3.1 on consumer GPUs using layer-by-layer streaming without quantization.

Stars
3.1K
Forks
238
Watchers
24
Open issues
0
Open PRs
0
Contributors
~11
Commits
372
Branches
1

Jupyter NotebookApache-2.0Created Sep 26, 2025Last push 1d ago+1 stars this week+-1 this month

Quick answers

What is airllm?
Run massive language models like 405B Llama 3.1 on consumer GPUs using layer-by-layer streaming without quantization.
What does airllm do?
AirLLM drastically reduces the VRAM required for large language model inference by streaming layers one at a time. It enables running enormous models, such as 70B models on 4GB GPUs or 405B models on 8GB VRAM, entirely without relying on quantization, distillation, or pruning techniques. By utilizing sparse Mixture of Experts (MoE) architectures, it streams single experts instead of entire layers, optimizing memory usage on standard consumer hardware. This allows developers to run state-of-the-art open-source LLMs locally on accessible hardware setups.
Who is airllm for?
AI researchers, hobbyists, and developers who want to experiment with massive language models but lack access to high-end enterprise GPUs. It is designed for those comfortable with Python who need to run state-of-the-art open-source LLMs locally.
How popular is airllm on GitHub?
0xSojalSec/airllm has 3,060 stars and 238 forks on GitHub, and gained 1 stars in the last 7 days.
What license does airllm use?
0xSojalSec/airllm is released under the Apache-2.0 license.

Star history

since Jul 28, 2026
01K2K3KJul 2026Aug 2026Sep 2026Oct 2026
3.1K stars as of Oct 3, 2026. Measured daily since Jul 28, 2026; GitHub no longer exposes earlier star timestamps.

Contribution activity

commits per day, last 52 weeks
OctNovDecJanFebMarAprMayJunJulAugSepMonWedFri2025-10-05: 0 commits2025-10-06: 0 commits2025-10-07: 0 commits2025-10-08: 0 commits2025-10-09: 0 commits2025-10-10: 0 commits2025-10-11: 0 commits2025-10-12: 0 commits2025-10-13: 0 commits2025-10-14: 0 commits2025-10-15: 0 commits2025-10-16: 0 commits2025-10-17: 0 commits2025-10-18: 0 commits2025-10-19: 0 commits2025-10-20: 0 commits2025-10-21: 0 commits2025-10-22: 0 commits2025-10-23: 0 commits2025-10-24: 0 commits2025-10-25: 0 commits2025-10-26: 0 commits2025-10-27: 0 commits2025-10-28: 0 commits2025-10-29: 0 commits2025-10-30: 0 commits2025-10-31: 0 commits2025-11-01: 0 commits2025-11-02: 0 commits2025-11-03: 0 commits2025-11-04: 0 commits2025-11-05: 0 commits2025-11-06: 0 commits2025-11-07: 0 commits2025-11-08: 0 commits2025-11-09: 0 commits2025-11-10: 0 commits2025-11-11: 0 commits2025-11-12: 0 commits2025-11-13: 0 commits2025-11-14: 0 commits2025-11-15: 0 commits2025-11-16: 0 commits2025-11-17: 0 commits2025-11-18: 0 commits2025-11-19: 0 commits2025-11-20: 0 commits2025-11-21: 0 commits2025-11-22: 0 commits2025-11-23: 0 commits2025-11-24: 0 commits2025-11-25: 0 commits2025-11-26: 0 commits2025-11-27: 0 commits2025-11-28: 0 commits2025-11-29: 0 commits2025-11-30: 0 commits2025-12-01: 0 commits2025-12-02: 0 commits2025-12-03: 0 commits2025-12-04: 0 commits2025-12-05: 0 commits2025-12-06: 0 commits2025-12-07: 0 commits2025-12-08: 0 commits2025-12-09: 0 commits2025-12-10: 0 commits2025-12-11: 0 commits2025-12-12: 0 commits2025-12-13: 0 commits2025-12-14: 0 commits2025-12-15: 0 commits2025-12-16: 0 commits2025-12-17: 0 commits2025-12-18: 0 commits2025-12-19: 0 commits2025-12-20: 0 commits2025-12-21: 0 commits2025-12-22: 0 commits2025-12-23: 0 commits2025-12-24: 0 commits2025-12-25: 0 commits2025-12-26: 0 commits2025-12-27: 0 commits2025-12-28: 0 commits2025-12-29: 0 commits2025-12-30: 0 commits2025-12-31: 0 commits2026-01-01: 0 commits2026-01-02: 0 commits2026-01-03: 0 commits2026-01-04: 0 commits2026-01-05: 0 commits2026-01-06: 0 commits2026-01-07: 0 commits2026-01-08: 0 commits2026-01-09: 0 commits2026-01-10: 0 commits2026-01-11: 0 commits2026-01-12: 0 commits2026-01-13: 0 commits2026-01-14: 0 commits2026-01-15: 0 commits2026-01-16: 0 commits2026-01-17: 0 commits2026-01-18: 0 commits2026-01-19: 0 commits2026-01-20: 0 commits2026-01-21: 0 commits2026-01-22: 0 commits2026-01-23: 0 commits2026-01-24: 0 commits2026-01-25: 0 commits2026-01-26: 0 commits2026-01-27: 0 commits2026-01-28: 0 commits2026-01-29: 0 commits2026-01-30: 0 commits2026-01-31: 0 commits2026-02-01: 0 commits2026-02-02: 0 commits2026-02-03: 0 commits2026-02-04: 0 commits2026-02-05: 0 commits2026-02-06: 0 commits2026-02-07: 0 commits2026-02-08: 0 commits2026-02-09: 0 commits2026-02-10: 0 commits2026-02-11: 0 commits2026-02-12: 0 commits2026-02-13: 0 commits2026-02-14: 0 commits2026-02-15: 0 commits2026-02-16: 0 commits2026-02-17: 0 commits2026-02-18: 0 commits2026-02-19: 0 commits2026-02-20: 0 commits2026-02-21: 0 commits2026-02-22: 0 commits2026-02-23: 0 commits2026-02-24: 0 commits2026-02-25: 0 commits2026-02-26: 0 commits2026-02-27: 0 commits2026-02-28: 0 commits2026-03-01: 0 commits2026-03-02: 0 commits2026-03-03: 0 commits2026-03-04: 0 commits2026-03-05: 0 commits2026-03-06: 0 commits2026-03-07: 0 commits2026-03-08: 0 commits2026-03-09: 0 commits2026-03-10: 1 commit2026-03-11: 0 commits2026-03-12: 0 commits2026-03-13: 0 commits2026-03-14: 0 commits2026-03-15: 0 commits2026-03-16: 0 commits2026-03-17: 0 commits2026-03-18: 0 commits2026-03-19: 0 commits2026-03-20: 0 commits2026-03-21: 0 commits2026-03-22: 0 commits2026-03-23: 0 commits2026-03-24: 0 commits2026-03-25: 0 commits2026-03-26: 0 commits2026-03-27: 0 commits2026-03-28: 0 commits2026-03-29: 0 commits2026-03-30: 0 commits2026-03-31: 0 commits2026-04-01: 0 commits2026-04-02: 0 commits2026-04-03: 0 commits2026-04-04: 0 commits2026-04-05: 0 commits2026-04-06: 0 commits2026-04-07: 0 commits2026-04-08: 0 commits2026-04-09: 0 commits2026-04-10: 0 commits2026-04-11: 0 commits2026-04-12: 0 commits2026-04-13: 0 commits2026-04-14: 0 commits2026-04-15: 0 commits2026-04-16: 0 commits2026-04-17: 0 commits2026-04-18: 0 commits2026-04-19: 0 commits2026-04-20: 0 commits2026-04-21: 0 commits2026-04-22: 0 commits2026-04-23: 0 commits2026-04-24: 0 commits2026-04-25: 0 commits2026-04-26: 0 commits2026-04-27: 0 commits2026-04-28: 0 commits2026-04-29: 0 commits2026-04-30: 0 commits2026-05-01: 0 commits2026-05-02: 0 commits2026-05-03: 0 commits2026-05-04: 0 commits2026-05-05: 0 commits2026-05-06: 0 commits2026-05-07: 0 commits2026-05-08: 0 commits2026-05-09: 0 commits2026-05-10: 0 commits2026-05-11: 0 commits2026-05-12: 0 commits2026-05-13: 0 commits2026-05-14: 0 commits2026-05-15: 0 commits2026-05-16: 0 commits2026-05-17: 0 commits2026-05-18: 0 commits2026-05-19: 0 commits2026-05-20: 0 commits2026-05-21: 0 commits2026-05-22: 0 commits2026-05-23: 0 commits2026-05-24: 0 commits2026-05-25: 0 commits2026-05-26: 0 commits2026-05-27: 0 commits2026-05-28: 0 commits2026-05-29: 0 commits2026-05-30: 0 commits2026-05-31: 0 commits2026-06-01: 0 commits2026-06-02: 0 commits2026-06-03: 0 commits2026-06-04: 0 commits2026-06-05: 0 commits2026-06-06: 0 commits2026-06-07: 0 commits2026-06-08: 0 commits2026-06-09: 0 commits2026-06-10: 0 commits2026-06-11: 0 commits2026-06-12: 0 commits2026-06-13: 0 commits2026-06-14: 0 commits2026-06-15: 0 commits2026-06-16: 0 commits2026-06-17: 0 commits2026-06-18: 5 commits2026-06-19: 5 commits2026-06-20: 0 commits2026-06-21: 0 commits2026-06-22: 0 commits2026-06-23: 0 commits2026-06-24: 0 commits2026-06-25: 0 commits2026-06-26: 0 commits2026-06-27: 0 commits2026-06-28: 0 commits2026-06-29: 0 commits2026-06-30: 3 commits2026-07-01: 0 commits2026-07-02: 0 commits2026-07-03: 3 commits2026-07-04: 2 commits2026-07-05: 1 commit2026-07-06: 1 commit2026-07-07: 1 commit2026-07-08: 1 commit2026-07-09: 1 commit2026-07-10: 1 commit2026-07-11: 1 commit2026-07-12: 1 commit2026-07-13: 0 commits2026-07-14: 0 commits2026-07-15: 0 commits2026-07-16: 1 commit2026-07-17: 0 commits2026-07-18: 0 commits2026-07-19: 0 commits2026-07-20: 2 commits2026-07-21: 1 commit2026-07-22: 1 commit2026-07-23: 1 commit2026-07-24: 0 commits2026-07-25: 0 commits2026-07-26: 0 commits2026-07-27: 0 commits2026-07-28: 4 commits2026-07-29: 0 commits2026-07-30: 0 commits2026-07-31: 0 commits2026-08-01: 0 commits2026-08-02: 0 commits2026-08-03: 0 commits2026-08-04: 0 commits2026-08-05: 2 commits2026-08-06: 1 commit2026-08-07: 0 commits2026-08-08: 1 commit2026-08-09: 1 commit2026-08-10: 1 commit2026-08-11: 1 commit2026-08-12: 1 commit2026-08-13: 1 commit2026-08-14: 1 commit2026-08-15: 1 commit2026-08-16: 1 commit2026-08-17: 1 commit2026-08-18: 4 commits2026-08-19: 1 commit2026-08-20: 1 commit2026-08-21: 1 commit2026-08-22: 1 commit2026-08-23: 1 commit2026-08-24: 1 commit2026-08-25: 1 commit2026-08-26: 1 commit2026-08-27: 1 commit2026-08-28: 1 commit2026-08-29: 1 commit2026-08-30: 1 commit2026-08-31: 1 commit2026-09-01: 1 commit2026-09-02: 1 commit2026-09-03: 1 commit2026-09-04: 1 commit2026-09-05: 1 commit2026-09-06: 1 commit2026-09-07: 1 commit2026-09-08: 1 commit2026-09-09: 1 commit2026-09-10: 1 commit2026-09-11: 1 commit2026-09-12: 1 commit2026-09-13: 1 commit2026-09-14: 1 commit2026-09-15: 1 commit2026-09-16: 1 commit2026-09-17: 1 commit2026-09-18: 1 commit2026-09-19: 1 commit2026-09-20: 1 commit2026-09-21: 1 commit2026-09-22: 1 commit2026-09-23: 1 commit2026-09-24: 1 commit2026-09-25: 1 commit2026-09-26: 1 commit2026-09-27: 1 commit2026-09-28: 1 commit2026-09-29: 1 commit2026-09-30: 1 commit2026-10-01: 1 commit2026-10-02: 1 commit2026-10-03: 1 commit
100 commits in the last yearLessMore

Signals and awards

derived from tracked data
  • Actively maintained

    Pushed within 48 hours

  • Permissive license

    Apache-2.0

  • Continuous integration

    Automated checks passing

What airllm does

AirLLM drastically reduces the VRAM required for large language model inference by streaming layers one at a time. It enables running enormous models, such as 70B models on 4GB GPUs or 405B models on 8GB VRAM, entirely without relying on quantization, distillation, or pruning techniques. By utilizing sparse Mixture of Experts (MoE) architectures, it streams single experts instead of entire layers, optimizing memory usage on standard consumer hardware. This allows developers to run state-of-the-art open-source LLMs locally on accessible hardware setups.

AI researchers, hobbyists, and developers who want to experiment with massive language models but lack access to high-end enterprise GPUs. It is designed for those comfortable with Python who need to run state-of-the-art open-source LLMs locally.

  • Layer streaming: Streams model layers one at a time to minimize VRAM usage during inference.
  • No quantization required: Runs full-precision models without degrading performance through quantization or pruning.
  • Sparse MoE support: Optimizes memory further by streaming individual experts for massive models like DeepSeek-V3.
  • Hardware accessibility: Enables running 70B parameter models on a single 4GB GPU card.
  • Broad model compatibility: Supports running massive open-source models including Llama 3.1 405B and Kimi K3.

Where teams use it

Local model inference

Run massive state-of-the-art LLMs locally on consumer-grade hardware without expensive cloud GPU instances.

Full-precision evaluation

Evaluate the true performance of large models without the degradation introduced by quantization techniques.

Hardware constrained development

Develop and test generative AI applications on budget GPUs with limited VRAM.

Private AI execution

Ensure data privacy by running massive models entirely locally rather than sending prompts to external APIs.

README

main branch

airllm_logo

Quickstart | Configurations | MacOS | Example notebooks | FAQ

AirLLM dramatically reduces inference memory usage, letting 70B large language models run on a single 4GB GPU card — without quantization, distillation, or pruning. You can even run 405B Llama 3.1 on 8GB, DeepSeek-V3 (671B) on ~12GB, and Kimi K3 (2.8T) — the largest open-source model released to date — on under 4GB, because sparse MoE models stream one expert at a time rather than a whole layer.

GitHub Repo stars Downloads

Code License Generic badge Discord PyPI - AirLLM Website Website Support me on Patreon GitHub Sponsors

AI Agents Recommendation:

Updates

[2026/08] Qwen3.8-27B support: Qwen's new dense VL (Gated DeltaNet + Gated Attention, native vision) runs in 3.33GB of VRAM, measured end to end on one RTX 3090. Needs transformers 5.8+.

[2026/07] Kimi K3 (2.8T) support: the largest open-source model runs on a single card in 3.72GB of VRAM, measured end to end on one RTX 6000 Ada. Per-expert streaming loads only the experts a token actually routes to. K3 brings three requirements of its own: pip install compressed-tensors flash-attn (its model code mandates flash attention regardless of what you request), a CUDA 12 build of torch, since no prebuilt flash-attn wheel exists for CUDA 13 yet, and transformers 4.56.x, as its remote code does not load on 5.x.

[2026/06] v3.0: FP8 model support + the latest models. Run DeepSeek-V3 (671B) on ~12GB and Qwen3-235B on ~3GB, plus Qwen3, Llama 3.x/4, DeepSeek V2/V3, Phi-4, Gemma and more — all through a single AutoModel.

[2024/08/20] v2.11.0: Support Qwen2.5

[2024/08/18] v2.10.1 Support CPU inference. Support non sharded models. Thanks @NavodPeiris for the great work!

[2024/07/30] Support Llama3.1 405B (example notebook). Support 8bit/4bit quantization.

[2024/04/20] AirLLM supports Llama3 natively already. Run Llama3 70B on 4GB single GPU.

[2023/12/25] v2.8.2: Support MacOS running 70B large language models.

[2023/12/20] v2.7: Support AirLLMMixtral.

[2023/12/20] v2.6: Added AutoModel, automatically detect model type, no need to provide model class to initialize model.

[2023/12/18] v2.5: added prefetching to overlap the model loading and compute. 10% speed improvement.

[2023/12/03] added support of ChatGLM, QWen, Baichuan, Mistral, InternLM!

[2023/12/02] added support for safetensors. Now support all top 10 models in open llm leaderboard.

[2023/12/01] airllm 2.0. Support compressions: 3x run time speed up!

[2023/11/20] airllm Initial version!

Star History

Star History Chart

Table of Contents

Quickstart

1. Install package

First, install the airllm pip package.

pip install airllm

2. Inference

Then, initialize AirLLMLlama2, pass in the huggingface repo ID of the model being used, or the local path, and inference can be performed similar to a regular transformer model.

(You can also specify the path to save the splitted layered model through layer_shards_saving_path when init AirLLMLlama2.

from airllm import AutoModel

MAX_LENGTH = 128
# just pass a hugging face repo id — works with almost any popular model:
model = AutoModel.from_pretrained("Qwen/Qwen3-32B")

# go bigger with the exact same one line:
#model = AutoModel.from_pretrained("Qwen/Qwen3.8-27B")          # 27B dense VL, 3.33GB
#model = AutoModel.from_pretrained("Qwen/Qwen3-235B-A22B")     # 235B, runs in ~3GB
#model = AutoModel.from_pretrained("deepseek-ai/DeepSeek-V3")  # 671B, runs in ~12GB

# or use a model's local path...
#model = AutoModel.from_pretrained("/home/ubuntu/.cache/huggingface/hub/models--Qwen--Qwen3-32B/snapshots/...")

input_text = [
        'What is the capital of United States?',
        #'I like',
    ]

input_tokens = model.tokenizer(input_text,
    return_tensors="pt", 
    return_attention_mask=False, 
    truncation=True, 
    max_length=MAX_LENGTH, 
    padding=False)
           
generation_output = model.generate(
    input_tokens['input_ids'].cuda(), 
    max_new_tokens=20,
    use_cache=True,
    return_dict_in_generate=True)

output = model.tokenizer.decode(generation_output.sequences[0])

print(output)

Note: During inference, the original model will first be decomposed and saved layer-wise. Please ensure there is sufficient disk space in the huggingface cache directory.

Model Compression - 3x Inference Speed Up!

We just added model compression based on block-wise quantization-based model compression. Which can further speed up the inference speed for up to 3x , with almost ignorable accuracy loss! (see more performance evaluation and why we use block-wise quantization in this paper)

speed_improvement

How to enable model compression speed up:
  • Step 1. make sure you have bitsandbytes installed by pip install -U bitsandbytes
  • Step 2. make sure airllm verion later than 2.0.0: pip install -U airllm
  • Step 3. when initialize the model, passing the argument compression ('4bit' or '8bit'):
model = AutoModel.from_pretrained("garage-bAInd/Platypus2-70B-instruct",
                     compression='4bit' # specify '8bit' for 8-bit block-wise quantization 
                    )
What are the differences between model compression and quantization?

Quantization normally needs to quantize both weights and activations to really speed things up. Which makes it harder to maintain accuracy and avoid the impact of outliers in all kinds of inputs.

While in our case the bottleneck is mainly at the disk loading, we only need to make the model loading size smaller. So, we get to only quantize the weights' part, which is easier to ensure the accuracy.

Configurations

When initialize the model, we support the following configurations:

  • compression: supported options: 4bit, 8bit for 4-bit or 8-bit block-wise quantization, or by default None for no compression
  • profiling_mode: supported options: True to output time consumptions or by default False
  • layer_shards_saving_path: optionally another path to save the splitted model
  • hf_token: huggingface token can be provided here if downloading gated models like: meta-llama/Llama-2-7b-hf
  • prefetching: prefetching to overlap the model loading and compute. By default, turned on. For now, only AirLLMLlama2 supports this.
  • delete_original: if you don't have too much disk space, you can set delete_original to true to delete the original downloaded hugging face model, only keep the transformed one to save half of the disk space.

MacOS

Just install airllm and run the code the same as on linux. See more in Quick Start.

  • make sure you installed mlx and torch
  • you probably need to install python native see more here
  • only Apple silicon is supported

Example [python notebook] (https://github.com/lyogavin/airllm/blob/main/air_llm/examples/run_on_macos.ipynb)

Example Python Notebook

Example colabs here:

Open In Colab
example of other models (ChatGLM, QWen, Baichuan, Mistral, etc):
Details
  • ChatGLM:
from airllm import AutoModel
MAX_LENGTH = 128
model = AutoModel.from_pretrained("THUDM/chatglm3-6b-base")
input_text = ['What is the capital of China?',]
input_tokens = model.tokenizer(input_text,
    return_tensors="pt", 
    return_attention_mask=False, 
    truncation=True, 
    max_length=MAX_LENGTH, 
    padding=True)
generation_output = model.generate(
    input_tokens['input_ids'].cuda(), 
    max_new_tokens=5,
    use_cache= True,
    return_dict_in_generate=True)
model.tokenizer.decode(generation_output.sequences[0])
  • QWen:
from airllm import AutoModel
MAX_LENGTH = 128
model = AutoModel.from_pretrained("Qwen/Qwen-7B")
input_text = ['What is the capital of China?',]
input_tokens = model.tokenizer(input_text,
    return_tensors="pt", 
    return_attention_mask=False, 
    truncation=True, 
    max_length=MAX_LENGTH)
generation_output = model.generate(
    input_tokens['input_ids'].cuda(), 
    max_new_tokens=5,
    use_cache=True,
    return_dict_in_generate=True)
model.tokenizer.decode(generation_output.sequences[0])
  • Baichuan, InternLM, Mistral, etc:
from airllm import AutoModel
MAX_LENGTH = 128
model = AutoModel.from_pretrained("baichuan-inc/Baichuan2-7B-Base")
#model = AutoModel.from_pretrained("internlm/internlm-20b")
#model = AutoModel.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
input_text = ['What is the capital of China?',]
input_tokens = model.tokenizer(input_text,
    return_tensors="pt", 
    return_attention_mask=False, 
    truncation=True, 
    max_length=MAX_LENGTH)
generation_output = model.generate(
    input_tokens['input_ids'].cuda(), 
    max_new_tokens=5,
    use_cache=True,
    return_dict_in_generate=True)
model.tokenizer.decode(generation_output.sequences[0])
To request other model support: here

Supported Models

AirLLM works out of the box with virtually every popular open LLM — just pass its Hugging Face ID to AutoModel.from_pretrained(...). That covers all the major families:

Llama (2 / 3 / 3.1 / 3.3 / 4) · Qwen (1 / 2 / 2.5 / 3 / 3.5 / 3.8, including MoE, FP8, and native VL) · DeepSeek (V2 / V3 / R1) · Mistral & Mixtral · Phi · Gemma · ChatGLM · Baichuan · InternLM · Yi · Kimi K3 — and most new models the day they're released.

Tiny GPU, huge models

The trick: AirLLM only ever keeps one layer on the GPU at a time, so the VRAM you need depends on the model's layer size — not its total size. That's how a 671B model fits on a hobbyist card:

Model Size GPU VRAM
Qwen3 / Mistral / Phi (≈8B) 8B ~1–2 GB
Qwen3-30B / Mixtral (MoE) 30–47B ~1–3 GB
Qwen3.8-27B (dense VL) 27B 3.33 GB
Qwen3-235B (MoE) 235B ~3 GB
Llama 3.x 70B (full precision) 70B ~4 GB
Llama 3.1 405B 405B ~8 GB
DeepSeek-V3 671B ~12 GB

Same one line of code for all of them — no special setup.

Acknowledgement

A lot of the code are based on SimJeg's great work in the Kaggle exam competition. Big shoutout to SimJeg:

GitHub account @SimJeg, the code on Kaggle, the associated discussion.

FAQ

1. MetadataIncompleteBuffer

safetensors_rust.SafetensorError: Error while deserializing header: MetadataIncompleteBuffer

If you run into this error, most possible cause is you run out of disk space. The process of splitting model is very disk-consuming. See this. You may need to extend your disk space, clear huggingface .cache and rerun.

2. ValueError: max() arg is an empty sequence

Most likely you are loading QWen or ChatGLM model with Llama2 class. Try the following:

For QWen model:

from airllm import AutoModel #<----- instead of AirLLMLlama2
AutoModel.from_pretrained(...)

For ChatGLM model:

from airllm import AutoModel #<----- instead of AirLLMLlama2
AutoModel.from_pretrained(...)

3. 401 Client Error....Repo model ... is gated.

Some models are gated models, needs huggingface api token. You can provide hf_token:

model = AutoModel.from_pretrained("meta-llama/Llama-2-7b-hf", #hf_token='HF_API_TOKEN')

4. ValueError: Asking to pad but the tokenizer does not have a padding token.

Some model's tokenizer doesn't have padding token, so you can set a padding token or simply turn the padding config off:

input_tokens = model.tokenizer(input_text,
   return_tensors="pt", 
   return_attention_mask=False, 
   truncation=True, 
   max_length=MAX_LENGTH, 
   padding=False  #<-----------   turn off padding 
)

Citing AirLLM

If you find AirLLM useful in your research and wish to cite it, please use the following BibTex entry:

@software{airllm2023,
  author = {Gavin Li},
  title = {AirLLM: scaling large language models on low-end commodity computers},
  url = {https://github.com/lyogavin/airllm/},
  version = {0.0},
  year = {2023},
}

Sponsors

Bloome — Run AI Agent Teams in the Cloud

Run AI Agent Teams in the Cloud — Bloome

Bloome is an AI-agent IM platform: build and run AI agent teams in the cloud with zero setup. Add a skill as an agent in a group chat, run it in one click from web or mobile, and share it with your team — think of it as a group chat where your AI assistants are teammates you can @mention and assign tasks to.

👉 Try Bloome

Contribution

Welcomed contributions, ideas and discussions!

If you find it useful, please ⭐ or buy me a coffee! 🙏

"Buy Me A Coffee"

View on GitHub

Recent activity

commits and pull requests

Commits per week

last 52 weeks
100Week of 2025-10-05: 0 commitsWeek of 2025-10-12: 0 commitsWeek of 2025-10-19: 0 commitsWeek of 2025-10-26: 0 commitsWeek of 2025-11-02: 0 commitsWeek of 2025-11-09: 0 commitsWeek of 2025-11-16: 0 commitsWeek of 2025-11-23: 0 commitsWeek of 2025-11-30: 0 commitsWeek of 2025-12-07: 0 commitsWeek of 2025-12-14: 0 commitsWeek of 2025-12-21: 0 commitsWeek of 2025-12-28: 0 commitsWeek of 2026-01-04: 0 commitsWeek of 2026-01-11: 0 commitsWeek of 2026-01-18: 0 commitsWeek of 2026-01-25: 0 commitsWeek of 2026-02-01: 0 commitsWeek of 2026-02-08: 0 commitsWeek of 2026-02-15: 0 commitsWeek of 2026-02-22: 0 commitsWeek of 2026-03-01: 0 commitsWeek of 2026-03-08: 1 commitsWeek of 2026-03-15: 0 commitsWeek of 2026-03-22: 0 commitsWeek of 2026-03-29: 0 commitsWeek of 2026-04-05: 0 commitsWeek of 2026-04-12: 0 commitsWeek of 2026-04-19: 0 commitsWeek of 2026-04-26: 0 commitsWeek of 2026-05-03: 0 commitsWeek of 2026-05-10: 0 commitsWeek of 2026-05-17: 0 commitsWeek of 2026-05-24: 0 commitsWeek of 2026-05-31: 0 commitsWeek of 2026-06-07: 0 commitsWeek of 2026-06-14: 10 commitsWeek of 2026-06-21: 0 commitsWeek of 2026-06-28: 8 commitsWeek of 2026-07-05: 7 commitsWeek of 2026-07-12: 2 commitsWeek of 2026-07-19: 5 commitsWeek of 2026-07-26: 4 commitsWeek of 2026-08-02: 4 commitsWeek of 2026-08-09: 7 commitsWeek of 2026-08-16: 10 commitsWeek of 2026-08-23: 7 commitsWeek of 2026-08-30: 7 commitsWeek of 2026-09-06: 7 commitsWeek of 2026-09-13: 7 commitsWeek of 2026-09-20: 7 commitsWeek of 2026-09-27: 7 commitsOct 5, 2025Sep 27, 2026
100 commits in the last 52 weeks.

When work happens

weekday and hour
SunMonTueWedThuFriSat036912151821Sun 0:00 — 0 commitsSun 1:00 — 0 commitsSun 2:00 — 0 commitsSun 3:00 — 0 commitsSun 4:00 — 0 commitsSun 5:00 — 1 commitsSun 6:00 — 3 commitsSun 7:00 — 0 commitsSun 8:00 — 2 commitsSun 9:00 — 0 commitsSun 10:00 — 1 commitsSun 11:00 — 9 commitsSun 12:00 — 1 commitsSun 13:00 — 0 commitsSun 14:00 — 2 commitsSun 15:00 — 1 commitsSun 16:00 — 0 commitsSun 17:00 — 2 commitsSun 18:00 — 2 commitsSun 19:00 — 0 commitsSun 20:00 — 2 commitsSun 21:00 — 1 commitsSun 22:00 — 0 commitsSun 23:00 — 1 commitsMon 0:00 — 3 commitsMon 1:00 — 0 commitsMon 2:00 — 0 commitsMon 3:00 — 0 commitsMon 4:00 — 0 commitsMon 5:00 — 0 commitsMon 6:00 — 1 commitsMon 7:00 — 3 commitsMon 8:00 — 1 commitsMon 9:00 — 0 commitsMon 10:00 — 1 commitsMon 11:00 — 5 commitsMon 12:00 — 4 commitsMon 13:00 — 5 commitsMon 14:00 — 0 commitsMon 15:00 — 7 commitsMon 16:00 — 13 commitsMon 17:00 — 10 commitsMon 18:00 — 0 commitsMon 19:00 — 1 commitsMon 20:00 — 2 commitsMon 21:00 — 2 commitsMon 22:00 — 2 commitsMon 23:00 — 2 commitsTue 0:00 — 0 commitsTue 1:00 — 0 commitsTue 2:00 — 0 commitsTue 3:00 — 0 commitsTue 4:00 — 0 commitsTue 5:00 — 0 commitsTue 6:00 — 3 commitsTue 7:00 — 1 commitsTue 8:00 — 2 commitsTue 9:00 — 2 commitsTue 10:00 — 0 commitsTue 11:00 — 12 commitsTue 12:00 — 7 commitsTue 13:00 — 2 commitsTue 14:00 — 3 commitsTue 15:00 — 0 commitsTue 16:00 — 2 commitsTue 17:00 — 0 commitsTue 18:00 — 4 commitsTue 19:00 — 0 commitsTue 20:00 — 1 commitsTue 21:00 — 0 commitsTue 22:00 — 8 commitsTue 23:00 — 2 commitsWed 0:00 — 0 commitsWed 1:00 — 0 commitsWed 2:00 — 0 commitsWed 3:00 — 2 commitsWed 4:00 — 0 commitsWed 5:00 — 1 commitsWed 6:00 — 1 commitsWed 7:00 — 2 commitsWed 8:00 — 7 commitsWed 9:00 — 4 commitsWed 10:00 — 6 commitsWed 11:00 — 7 commitsWed 12:00 — 1 commitsWed 13:00 — 0 commitsWed 14:00 — 0 commitsWed 15:00 — 0 commitsWed 16:00 — 0 commitsWed 17:00 — 2 commitsWed 18:00 — 0 commitsWed 19:00 — 0 commitsWed 20:00 — 1 commitsWed 21:00 — 0 commitsWed 22:00 — 5 commitsWed 23:00 — 0 commitsThu 0:00 — 0 commitsThu 1:00 — 0 commitsThu 2:00 — 1 commitsThu 3:00 — 0 commitsThu 4:00 — 0 commitsThu 5:00 — 0 commitsThu 6:00 — 1 commitsThu 7:00 — 2 commitsThu 8:00 — 3 commitsThu 9:00 — 6 commitsThu 10:00 — 0 commitsThu 11:00 — 5 commitsThu 12:00 — 1 commitsThu 13:00 — 0 commitsThu 14:00 — 1 commitsThu 15:00 — 5 commitsThu 16:00 — 1 commitsThu 17:00 — 2 commitsThu 18:00 — 5 commitsThu 19:00 — 2 commitsThu 20:00 — 5 commitsThu 21:00 — 4 commitsThu 22:00 — 1 commitsThu 23:00 — 1 commitsFri 0:00 — 0 commitsFri 1:00 — 0 commitsFri 2:00 — 0 commitsFri 3:00 — 0 commitsFri 4:00 — 0 commitsFri 5:00 — 0 commitsFri 6:00 — 1 commitsFri 7:00 — 3 commitsFri 8:00 — 4 commitsFri 9:00 — 3 commitsFri 10:00 — 1 commitsFri 11:00 — 4 commitsFri 12:00 — 1 commitsFri 13:00 — 0 commitsFri 14:00 — 3 commitsFri 15:00 — 4 commitsFri 16:00 — 13 commitsFri 17:00 — 11 commitsFri 18:00 — 6 commitsFri 19:00 — 0 commitsFri 20:00 — 0 commitsFri 21:00 — 16 commitsFri 22:00 — 9 commitsFri 23:00 — 0 commitsSat 0:00 — 0 commitsSat 1:00 — 0 commitsSat 2:00 — 1 commitsSat 3:00 — 0 commitsSat 4:00 — 0 commitsSat 5:00 — 0 commitsSat 6:00 — 3 commitsSat 7:00 — 1 commitsSat 8:00 — 7 commitsSat 9:00 — 2 commitsSat 10:00 — 3 commitsSat 11:00 — 2 commitsSat 12:00 — 1 commitsSat 13:00 — 0 commitsSat 14:00 — 0 commitsSat 15:00 — 0 commitsSat 16:00 — 1 commitsSat 17:00 — 4 commitsSat 18:00 — 4 commitsSat 19:00 — 2 commitsSat 20:00 — 0 commitsSat 21:00 — 0 commitsSat 22:00 — 5 commitsSat 23:00 — 0 commits
Commit volume by weekday and hour (UTC). Larger dots mean more commits.

Who is committing

last 52 weeks
Maintainer commits42 (41%)
Community commits60 (59%)

102 commits in total over the last year.

DateListRankStars gained
Jan 22, 2026daily#18+171