LLM压缩库 是 AI Skill Hub 本期精选AI工具之一。已获得 3.3k 颗 GitHub Star,综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
专为大语言模型设计的压缩工具库,支持量化、剪枝等多种压缩算法。与Transformers无缝兼容,帮助开发者显著降低模型体积和推理成本,适合资源受限场景部署。
LLM压缩库 是一款基于 Python 开发的开源工具,专注于 模型压缩、量化、Transformers 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
专为大语言模型设计的压缩工具库,支持量化、剪枝等多种压缩算法。与Transformers无缝兼容,帮助开发者显著降低模型体积和推理成本,适合资源受限场景部署。
LLM压缩库 是一款基于 Python 开发的开源工具,专注于 模型压缩、量化、Transformers 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install llm-compressor
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install llm-compressor
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/vllm-project/llm-compressor
cd llm-compressor
pip install -e .
# 验证安装
python -c "import llm_compressor; print('安装成功')"
# 命令行使用
llm-compressor --help
# 基本用法
llm-compressor input_file -o output_file
# Python 代码中调用
import llm_compressor
# 示例
result = llm_compressor.process("input")
print(result)
# llm-compressor 配置文件示例(config.yml) app: name: "llm-compressor" debug: false log_level: "INFO" # 运行时指定配置文件 llm-compressor --config config.yml # 或通过环境变量配置 export LLM_COMPRESSOR_API_KEY="your-key" export LLM_COMPRESSOR_OUTPUT_DIR="./output"
</div>
llmcompressor is an easy-to-use library for optimizing models for deployment with vLLM, including:
compressed-tensors format, compatible with vLLM✨ Read the announcement blog here! ✨
<p align="center"> <img alt="LLM Compressor Flow" src="https://github.com/user-attachments/assets/adf07594-6487-48ae-af62-d9555046d51b" width="80%" /> </p>
---
📊 Help us improve by taking our 1-minute user survey
💬 Join us on the vLLM Community Slack and share your questions, thoughts, or ideas in:
#sig-quantization#llm-compressor---
Big updates have landed in LLM Compressor! To get a more in-depth look, check out the LLM Compressor overview.
Some of the exciting new features include:
uv pip install transformers>=5.5). For models quantized and published by the RedHat team, consider using:uv pip install --upgrade transformers and install LLM Compressor from source if using <0.11. Once updated, you should be able to run examples for the MoE and non-MoE variants of Qwen 3.5 end-to-end. For models quantized and published by the RedHat team, consider using the NVFP4 and FP8 checkpoints for Qwen3.5-122B and Qwen3.5-397B.model_free_ptq. This pathway allows you to quantize your model without the requirement of Hugging Face model definition and is especially useful in cases where oneshot may fail. This pathway is currently supported for data-free pathways only i.e FP8 quantization and was leveraged to quantize the Mistral Large 3 model. Additional examples have been added illustrating how LLM Compressor can be used for Kimi K2per-head scales and run with vLLM. Examples of more generalized attention and kv cache quantization can be found in the experimental folder.pip install llmcompressor
Applying quantization with llmcompressor:
优质开源项目,3.3k星认可度高。提供实用压缩方案,填补部署需求空白,维护活跃。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,LLM压缩库 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | llm-compressor |
| 原始描述 | 开源AI工具:Transformers-compatible library for applying various compression algorithms to L。⭐3.3k · Python |
| Topics | 模型压缩量化Transformers推理优化 |
| GitHub | https://github.com/vllm-project/llm-compressor |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-05-21 · 更新时间:2026-05-22 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。