经 AI Skill Hub 精选评估,AirLLM 获评「强烈推荐」。在 GitHub 上收获超过 21.5k 颗 Star,这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.5 分,适合有一定技术背景的用户使用。
AirLLM 是一款基于 Jupyter Notebook 开发的开源工具,专注于 chinese-llm、chinese-nlp、finetune 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
AirLLM 是一款基于 Jupyter Notebook 开发的开源工具,专注于 chinese-llm、chinese-nlp、finetune 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 克隆仓库 git clone https://github.com/lyogavin/airllm cd airllm # 查看安装说明 cat README.md # 按 README 完成环境依赖安装后即可使用
# 查看帮助 airllm --help # 基本运行 airllm [options] <input> # 详细使用说明请查阅文档 # https://github.com/lyogavin/airllm
# airllm 配置说明 # 查看配置选项 airllm --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export AIRLLM_CONFIG="/path/to/config.yml"
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 Kimi K3 (2.8T) — the largest open-source model released to date — on under 4GB, Qwen3.8-Flash-Next (125B) on 6GB, and DeepSeek-V3 (671B) on ~12GB. We now also support training huge models on small VRAM: Qwen3.8-Flash-Next (125B) under 6GB.
<a href="https://github.com/lyogavin/airllm/stargazers"></a>
First, install the airllm pip package.
pip install airllm
Example colabs here:
<a target="_blank" href="https://colab.research.google.com/github/lyogavin/airllm/blob/main/air_llm/examples/run_all_types_of_models.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
<details>
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])
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])
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])
</details>
When initialize the model, we support the following configurations:
from airllm import AirLLMLoRAQwen4Exp
trainer = AirLLMLoRAQwen4Exp(
"Qwen/Qwen3.8-Flash-Next",
max_seq_len=512,
lora_r=16,
delete_original=True,
)
tok = trainer.tokenizer
if tok.pad_token_id is None:
tok.pad_token = tok.eos_token
encoded = tok(
"Your training text here.",
return_tensors="pt",
truncation=True,
max_length=512,
)
loss = trainer.train_step(
encoded["input_ids"].cuda(),
attention_mask=encoded.get("attention_mask"),
)
print(loss)
trainer.save_adapter("qwen38-flash-next-lora.pt")
AirLLMLoRA is the same API for Qwen/Qwen3.8-27B.
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, Flash-Next, 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.
高性能AI模型,支持单GPU推理
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
AI Skill Hub 点评:AirLLM 的核心功能完整,质量优秀。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | airllm |
| 原始描述 | 开源AI工具:AirLLM 70B inference with single 4GB GPU。⭐21.5k · Jupyter Notebook |
| Topics | chinese-llmchinese-nlpfinetunegenerative-aiinstruct-gpt |
| GitHub | https://github.com/lyogavin/airllm |
| License | Apache-2.0 |
| 语言 | Jupyter Notebook |
收录时间:2026-06-26 · 更新时间:2026-06-26 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。