Skill

v0.1.0

微软官方 1-bit LLM 推理框架,在 CPU 上运行 1.58-bit 量化大语言模型,速度提升 1.4-6x、能耗降低 55-82%,单 CPU 可运行 100B 参数模型,达到人类阅读速度

0· 83·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for cn-big-cabbage/bitnet.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Skill" (cn-big-cabbage/bitnet) from ClawHub.
Skill page: https://clawhub.ai/cn-big-cabbage/bitnet
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install bitnet

ClawHub CLI

Package manager switcher

npx clawhub@latest install bitnet
Security Scan
Capability signals
Crypto
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name/description (BitNet CPU inference) matches the instructions: cloning a BitNet repo, installing build deps, downloading models, running setup_env.py and inference/benchmark scripts. Network access and build steps are expected for this purpose.
Instruction Scope
SKILL.md and guides instruct the agent to run system package installs, clone the GitHub repo, use huggingface-cli to download models, run setup_env.py (compilation/quantization) and run_inference.py/e2e_benchmark.py. These are appropriate for local model setup, but the docs also instruct running remote installer scripts (Homebrew install via curl, apt llvm.sh) and suggest using environment variables (HUGGING_FACE_HUB_TOKEN, HF_ENDPOINT) for downloads—actions that execute remote code and may require credentials. The instructions do not ask to read unrelated files or exfiltrate data.
Install Mechanism
This is instruction-only (no install spec), so nothing is written by the registry. However the guides direct executing standard external installers (Homebrew installer via curl, apt llvm.sh) and pip installs; those are normal for building from source but inherently execute remote code and should be reviewed before running.
!
Credentials
The skill itself declares no required env vars, but the troubleshooting section explicitly references HUGGING_FACE_HUB_TOKEN and HF_ENDPOINT for model downloads and suggests exporting them. Asking for a Hugging Face token is proportionate to downloading gated models, but the token requirement is not declared in metadata—agents or users should be aware they may need to provide credentials to download some models.
Persistence & Privilege
No elevated privileges requested, always:false, no persistent install spec, and the skill does not modify other skills or system-wide agent settings. Autonomous invocation is allowed (platform default) but not a special privilege here.
Assessment
This skill appears to be a typical 'build and run a local model' guide: it will clone a GitHub repo, install system and Python dependencies, download models (possibly requiring a Hugging Face token), compile native code, and run inference/benchmarks. Before installing or running: (1) verify the GitHub repository and model links actually belong to Microsoft (or the claimed owner) and review the repo contents if possible; (2) do not paste secrets into an untrusted environment—only provide a Hugging Face token if you trust the source and scope of the token; (3) run build steps (Homebrew/apt remote install scripts, pip installs, compilation) in an isolated VM or container if you want to limit risk; (4) ensure you have adequate disk space and understand the license/usage terms for the models; and (5) if you need higher assurance, inspect setup_env.py and other scripts in the cloned repo before executing them.

Like a lobster shell, security has layers — review code before you run it.

latestvk977yd2grckbgmx9ar5j6z73hs85b7ma
83downloads
0stars
1versions
Updated 6d ago
v0.1.0
MIT-0

BitNet — 1-bit LLM 本地高效推理

bitnet.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 部署的经济性。

核心使用场景

  • CPU 本地 LLM 推理:无需 GPU,在消费级 CPU 上运行数十亿参数模型
  • 边缘设备部署:极低能耗,适合嵌入式设备、笔记本电脑、服务器 CPU
  • 隐私敏感场景:完全本地运行,数据不离开设备
  • 大规模批量推理:多线程优化,节省数据中心能源成本
  • 学术研究:研究 1-bit LLM 量化技术和推理优化

AI 辅助使用流程

  1. 环境搭建 — AI 创建 conda 环境并安装编译依赖(Python、CMake、Clang)
  2. 克隆仓库 — AI 执行 git clone --recursive https://github.com/microsoft/BitNet.git
  3. 下载模型 — AI 使用 huggingface-cli download 下载官方 BitNet 模型
  4. 编译环境 — AI 运行 python setup_env.py 量化模型并编译推理内核
  5. 运行推理 — AI 执行 python run_inference.py 进行对话或文本生成
  6. 性能测试 — AI 运行 python e2e_benchmark.py 测量吞吐量和延迟

关键章节导航

  • 安装指南 — 依赖安装、conda 环境、模型下载
  • 快速开始 — 编译量化、运行推理、对话模式
  • 高级用法 — GPU 推理、性能测试、多线程配置
  • 故障排查 — 编译错误、模型加载失败、性能问题

AI 助手能力

使用本技能时,AI 可以:

  • ✅ 搭建 conda 环境并安装编译依赖(CMake、Clang)
  • ✅ 克隆 BitNet 仓库并安装 Python 依赖
  • ✅ 使用 huggingface-cli 下载指定 BitNet 模型
  • ✅ 运行 setup_env.py 完成量化和环境配置
  • ✅ 执行 run_inference.py 进行对话推理
  • ✅ 运行 e2e_benchmark.py 测试推理性能
  • ✅ 配置多线程参数优化吞吐量

核心功能

  • 极速 CPU 推理 — x86 CPU 提升 2.4-6.2x,ARM CPU 提升 1.4-5.1x
  • 超低能耗 — 比传统 INT8 推理节能 55-82%
  • 大模型单 CPU — 100B 模型在单 CPU 以 5-7 tokens/秒运行
  • 官方量化内核 — I2_S、TL1、TL2 三种针对不同硬件优化的内核
  • GPU 支持 — 官方 GPU 推理内核(2025 年发布)
  • 多模型支持 — BitNet-b1.58 2B/3B、Llama3-8B-1.58bit、Falcon3 系列
  • 对话模式-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

项目链接

Comments

Loading comments...