Install
openclaw skills install bitnet微软官方 1-bit LLM 推理框架,在 CPU 上运行 1.58-bit 量化大语言模型,速度提升 1.4-6x、能耗降低 55-82%,单 CPU 可运行 100B 参数模型,达到人类阅读速度
openclaw skills install bitnetbitnet.cpp 是微软研究院发布的官方 1-bit LLM 推理框架,基于 llama.cpp 构建,专为 BitNet b1.58 系列模型优化。在 x86 CPU 上速度提升 2.37-6.17 倍,能耗降低 71-82%;在 ARM CPU 上速度提升 1.37-5.07 倍,能耗降低 55-70%。单台消费级 CPU 即可以 5-7 tokens/秒的速度运行 100B 参数模型,达到人类阅读速度,彻底改变本地 LLM 部署的经济性。
git clone --recursive https://github.com/microsoft/BitNet.githuggingface-cli download 下载官方 BitNet 模型python setup_env.py 量化模型并编译推理内核python run_inference.py 进行对话或文本生成python e2e_benchmark.py 测量吞吐量和延迟使用本技能时,AI 可以:
huggingface-cli 下载指定 BitNet 模型setup_env.py 完成量化和环境配置run_inference.py 进行对话推理e2e_benchmark.py 测试推理性能-cnv 标志启用交互式聊天(系统提示支持)e2e_benchmark.py 测量 tokens/秒和能耗# 克隆并进入项目
git clone --recursive https://github.com/microsoft/BitNet.git
cd BitNet
# 安装依赖
conda create -n bitnet-cpp python=3.9 && conda activate bitnet-cpp
pip install -r requirements.txt
# 下载官方模型并量化
huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T
python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s
# 运行对话推理
python run_inference.py \
-m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \
-p "You are a helpful assistant" \
-cnv
| 依赖 | 版本要求 |
|---|---|
| Python | >= 3.9 |
| CMake | >= 3.22 |
| Clang | >= 18 |
| conda | 推荐(环境隔离) |
| 磁盘空间 | 模型约 1-20 GB |