← 返回 Skills 市场
cn-big-cabbage

Skill

作者 CN-big-cabbage · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
88
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install bitnet
功能描述
微软官方 1-bit LLM 推理框架,在 CPU 上运行 1.58-bit 量化大语言模型,速度提升 1.4-6x、能耗降低 55-82%,单 CPU 可运行 100B 参数模型,达到人类阅读速度
使用说明 (SKILL.md)

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

项目链接

  • GitHub:https://github.com/microsoft/BitNet
  • 官方模型(HuggingFace):https://huggingface.co/microsoft/BitNet-b1.58-2B-4T
  • GPU 推理文档:https://github.com/microsoft/BitNet/blob/main/gpu/README.md
  • 技术报告:https://arxiv.org/abs/2410.16144
安全使用建议
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.
功能分析
Type: OpenClaw Skill Name: bitnet Version: 0.1.0 The skill bundle provides instructions for an AI agent to set up and run Microsoft's BitNet 1-bit LLM inference framework. It includes standard procedures for environment setup (conda, Homebrew, LLVM), repository cloning from GitHub (microsoft/BitNet), and model downloading from HuggingFace. While it utilizes curl|bash and wget|sh for Homebrew and LLVM installation in guides/01-installation.md, these are directed at official, trusted sources. There is no evidence of data exfiltration, persistence mechanisms, or malicious prompt injection; the instructions are entirely consistent with the stated purpose of local LLM deployment.
能力标签
crypto
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bitnet
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bitnet 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
- 首个版本,集成微软官方 BitNet 1-bit LLM 高效 CPU 推理框架 - 支持在消费级 x86/ARM CPU 上本地高效运行 1.58-bit 量化大语言模型 - 提供端到端安装、模型下载、量化、推理及性能基准测试流程 - 覆盖多模型格式,支持交互式对话、批量推理及多线程优化 - 文档详尽,涵盖安装指引、疑难解答与核心用例
元数据
Slug bitnet
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Skill 是什么?

微软官方 1-bit LLM 推理框架,在 CPU 上运行 1.58-bit 量化大语言模型,速度提升 1.4-6x、能耗降低 55-82%,单 CPU 可运行 100B 参数模型,达到人类阅读速度. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 88 次。

如何安装 Skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install bitnet」即可一键安装,无需额外配置。

Skill 是免费的吗?

是的,Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Skill 支持哪些平台?

Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Skill?

由 CN-big-cabbage(@cn-big-cabbage)开发并维护,当前版本 v0.1.0。

💬 留言讨论