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.