lyogavin/airllm

AirLLM 70B inference with single 4GB GPU

What it solves

AirLLM 允许用户在消费级硬件上运行巨大的大型语言模型(LLM),即使 VRAM 非常有限。它可以在仅 12GB VRAM 的 GPU 上运行高达 671B 参数的模型(如 DeepSeek‑V3),或在 4GB 显卡上运行 70B 模型,且无需量化、蒸馏或剪枝。

How it works

AirLLM 并不是把整个模型一次性加载到 GPU 内存,而是将模型拆分并按层保存。推理时,它一次只把模型的一层放到 GPU 上,这意味着 VRAM 的需求由单层大小决定,而不是整个模型的大小。它还支持可选的块级量化(4 位或 8 位),可以减小磁盘上权重的体积,并将加载时间提升至最高 3 倍。

Who it’s for

开发者和研究人员,希望在低端商品电脑或业余 GPU 上运行最前沿、巨大的开源 LLM,并且不想因大量量化而导致精度下降。

Highlights

  • Extreme VRAM Efficiency: Run 405B Llama 3.1 on 8GB VRAM or DeepSeek-V3 (671B) on 12GB VRAM.
  • Broad Model Support: Works with Llama (2/3/3.1/3.3/4), Qwen, DeepSeek, Mistral, Mixtral, Phi, Gemma, ChatGLM, and more.
  • No-Quantization Option: Capability to run models in full precision without needing pruning or distillation.
  • Cross-Platform: Supports Linux and Apple Silicon (MacOS).
  • Coded for Simplicity: Uses a single AutoModel class to automatically detect and load models from Hugging Face.