{"id":"6dff294c-d05f-494f-88be-5497dc13c733","entityType":"agent","slug":"clawhub-cn-big-cabbage-bitnet","name":"Bitnet","canonicalUrl":"https://www.xpersona.co/agent/clawhub-cn-big-cabbage-bitnet","canonicalPath":"/agent/clawhub-cn-big-cabbage-bitnet","generatedAt":"2026-10-12T16:32:19.140Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T22:46:25.354Z","emptyReason":null},"description":"微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度 Skill: Bitnet Owner: cn-big-cabbage Summary: 微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度 Tags: latest:0.1.1 Version history: v0.1.1 | 2026-06-16T10:09:06.774Z | auto - Update to version 0.1.1 - Added _meta.json file for enhanced metadata management - Updated SKILL.md: metadata structure improved (now nested under \"openclaw\" and with \"bins\" requirements) - Remove","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 982 downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17dbd0j0kazk5ay31x9kv1z3n84f04v:bitnet","sourceUrl":"https://clawhub.ai/cn-big-cabbage/bitnet","homepage":"https://clawhub.ai/cn-big-cabbage/skills/bitnet","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/cn-big-cabbage/bitnet","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/cn-big-cabbage/skills/bitnet","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度 Skill: Bitnet Owner: cn-big-cabbage Summary: 微软官方 1-bit LLM "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T22:46:25.354Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T22:46:25.354Z","emptyReason":null},"stars":null,"forks":null,"downloads":982,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"0.1.1","tractionLabel":"982 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T22:46:25.346Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T22:46:25.354Z","lastCrawledAt":"2026-10-11T22:46:25.346Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T22:46:25.346Z","lastVerifiedAt":null,"highlights":[{"version":"0.1.1","createdAt":"2026-06-16T10:09:06.774Z","changelog":"- Update to version 0.1.1 - Added _meta.json file for enhanced metadata management - Updated SKILL.md: metadata structure improved (now nested under \"openclaw\" and with \"bins\" requirements) - Removed skill-card.md for simplification of documentation files","fileCount":7,"zipByteSize":12078},{"version":"0.1.0","createdAt":"2026-04-22T00:41:48.169Z","changelog":"- 首个版本，集成微软官方 BitNet 1-bit LLM 高效 CPU 推理框架 - 支持在消费级 x86/ARM CPU 上本地高效运行 1.58-bit 量化大语言模型 - 提供端到端安装、模型下载、量化、推理及性能基准测试流程 - 覆盖多模型格式，支持交互式对话、批量推理及多线程优化 - 文档详尽，涵盖安装指引、疑难解答与核心用例","fileCount":7,"zipByteSize":11984}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17dbd0j0kazk5ay31x9kv1z3n84f04v:bitnet","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-12T16:32:19.139Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-cn-big-cabbage-bitnet/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T22:46:25.354Z","emptyReason":null},"readme":"Skill: Bitnet\n\nOwner: cn-big-cabbage\n\nSummary: 微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度\n\nTags: latest:0.1.1\n\nVersion history:\n\nv0.1.1 | 2026-06-16T10:09:06.774Z | auto\n\n- Update to version 0.1.1\n- Added _meta.json file for enhanced metadata management\n- Updated SKILL.md: metadata structure improved (now nested under \"openclaw\" and with \"bins\" requirements)\n- Removed skill-card.md for simplification of documentation files\n\nv0.1.0 | 2026-04-22T00:41:48.169Z | auto\n\n- 首个版本，集成微软官方 BitNet 1-bit LLM 高效 CPU 推理框架\n- 支持在消费级 x86/ARM CPU 上本地高效运行 1.58-bit 量化大语言模型\n- 提供端到端安装、模型下载、量化、推理及性能基准测试流程\n- 覆盖多模型格式，支持交互式对话、批量推理及多线程优化\n- 文档详尽，涵盖安装指引、疑难解答与核心用例\n\nArchive index:\n\nArchive v0.1.1: 7 files, 12078 bytes\n\nFiles: _meta.json (125b), guides/01-installation.md (3289b), guides/02-quickstart.md (3537b), guides/03-advanced-usage.md (3699b), skill-card.md (2627b), SKILL.md (4377b), troubleshooting.md (6044b)\n\nFile v0.1.1:SKILL.md\n\n---\nname: bitnet\ndescription: 微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度\nversion: 0.1.1\nmetadata:\n  openclaw:\n    requires:\n      bins:\n        - python3\n        - cmake\n    emoji: ⚡\n    homepage: https://github.com/microsoft/BitNet\n---\n\n# BitNet — 1-bit LLM 本地高效推理\n\nbitnet.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 部署的经济性。\n\n## 核心使用场景\n\n- **CPU 本地 LLM 推理**：无需 GPU，在消费级 CPU 上运行数十亿参数模型\n- **边缘设备部署**：极低能耗，适合嵌入式设备、笔记本电脑、服务器 CPU\n- **隐私敏感场景**：完全本地运行，数据不离开设备\n- **大规模批量推理**：多线程优化，节省数据中心能源成本\n- **学术研究**：研究 1-bit LLM 量化技术和推理优化\n\n## AI 辅助使用流程\n\n1. **环境搭建** — AI 创建 conda 环境并安装编译依赖（Python、CMake、Clang）\n2. **克隆仓库** — AI 执行 `git clone --recursive https://github.com/microsoft/BitNet.git`\n3. **下载模型** — AI 使用 `huggingface-cli download` 下载官方 BitNet 模型\n4. **编译环境** — AI 运行 `python setup_env.py` 量化模型并编译推理内核\n5. **运行推理** — AI 执行 `python run_inference.py` 进行对话或文本生成\n6. **性能测试** — AI 运行 `python e2e_benchmark.py` 测量吞吐量和延迟\n\n## 关键章节导航\n\n- [安装指南](guides/01-installation.md) — 依赖安装、conda 环境、模型下载\n- [快速开始](guides/02-quickstart.md) — 编译量化、运行推理、对话模式\n- [高级用法](guides/03-advanced-usage.md) — GPU 推理、性能测试、多线程配置\n- [故障排查](troubleshooting.md) — 编译错误、模型加载失败、性能问题\n\n## AI 助手能力\n\n使用本技能时，AI 可以：\n\n- ✅ 搭建 conda 环境并安装编译依赖（CMake、Clang）\n- ✅ 克隆 BitNet 仓库并安装 Python 依赖\n- ✅ 使用 `huggingface-cli` 下载指定 BitNet 模型\n- ✅ 运行 `setup_env.py` 完成量化和环境配置\n- ✅ 执行 `run_inference.py` 进行对话推理\n- ✅ 运行 `e2e_benchmark.py` 测试推理性能\n- ✅ 配置多线程参数优化吞吐量\n\n## 核心功能\n\n- ✅ **极速 CPU 推理** — x86 CPU 提升 2.4-6.2x，ARM CPU 提升 1.4-5.1x\n- ✅ **超低能耗** — 比传统 INT8 推理节能 55-82%\n- ✅ **大模型单 CPU** — 100B 模型在单 CPU 以 5-7 tokens/秒运行\n- ✅ **官方量化内核** — I2_S、TL1、TL2 三种针对不同硬件优化的内核\n- ✅ **GPU 支持** — 官方 GPU 推理内核（2025 年发布）\n- ✅ **多模型支持** — BitNet-b1.58 2B/3B、Llama3-8B-1.58bit、Falcon3 系列\n- ✅ **对话模式** — `-cnv` 标志启用交互式聊天（系统提示支持）\n- ✅ **性能基准** — 内置 `e2e_benchmark.py` 测量 tokens/秒和能耗\n\n## 快速示例\n\n```bash\n# 克隆并进入项目\ngit clone --recursive https://github.com/microsoft/BitNet.git\ncd BitNet\n\n# 安装依赖\nconda create -n bitnet-cpp python=3.9 && conda activate bitnet-cpp\npip install -r requirements.txt\n\n# 下载官方模型并量化\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# 运行对话推理\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"You are a helpful assistant\" \\\n  -cnv\n```\n\n## 安装要求\n\n| 依赖 | 版本要求 |\n|------|---------|\n| Python | >= 3.9 |\n| CMake | >= 3.22 |\n| Clang | >= 18 |\n| conda | 推荐（环境隔离） |\n| 磁盘空间 | 模型约 1-20 GB |\n\n## 项目链接\n\n- GitHub：https://github.com/microsoft/BitNet\n- 官方模型（HuggingFace）：https://huggingface.co/microsoft/BitNet-b1.58-2B-4T\n- GPU 推理文档：https://github.com/microsoft/BitNet/blob/main/gpu/README.md\n- 技术报告：https://arxiv.org/abs/2410.16144\n\nFile v0.1.1:_meta.json\n\n{\n  \"ownerId\": \"kn7c5ry95ff7x22mt3fx6j0q3d81p8t3\",\n  \"slug\": \"bitnet\",\n  \"version\": \"0.1.1\",\n  \"publishedAt\": 1781604546774\n}\n\nFile v0.1.1:guides/01-installation.md\n\n# 安装指南\n\n## 适用场景\n\n- 在 Linux/macOS/Windows 上从源码构建 BitNet\n- 配置 conda 环境和编译依赖\n- 下载官方模型并完成量化\n\n---\n\n## 环境要求\n\n| 依赖 | 版本 | 安装方式 |\n|------|------|---------|\n| Python | >= 3.9 | conda 或系统 Python |\n| CMake | >= 3.22 | `conda install cmake` |\n| Clang | >= 18 | 系统包管理器 |\n| conda | 任意 | [Miniconda](https://docs.conda.io/en/latest/miniconda.html) |\n\n---\n\n## macOS 安装\n\n> **AI 可自动执行**\n\n```bash\n# 安装 Homebrew（如未安装）\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n\n# 安装编译依赖\nbrew install llvm cmake\n\n# 配置 Clang 路径（Apple Silicon）\nexport PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\nexport CC=/opt/homebrew/opt/llvm/bin/clang\nexport CXX=/opt/homebrew/opt/llvm/bin/clang++\n\n# 验证版本\nclang --version  # 需要 >= 18\ncmake --version  # 需要 >= 3.22\n```\n\n---\n\n## Linux (Ubuntu/Debian) 安装\n\n```bash\n# 安装 Clang 18\nbash -c \"$(wget -O - https://apt.llvm.org/llvm.sh)\"\n\n# 安装 CMake\nsudo apt-get install -y cmake\n\n# 验证\nclang-18 --version\ncmake --version\n```\n\n---\n\n## Windows 安装\n\n在 Windows 上需要 Visual Studio 2022：\n\n1. 下载 [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)\n2. 在安装程序中勾选：\n   - Desktop-development with C++\n   - C++-CMake Tools for Windows\n   - C++-Clang Compiler for Windows\n   - MS-Build Support for LLVM-Toolset (clang)\n3. 使用 **Developer Command Prompt for VS2022** 运行所有命令\n\n---\n\n## 克隆并安装 Python 依赖\n\n```bash\n# 克隆（必须使用 --recursive 拉取子模块）\ngit clone --recursive https://github.com/microsoft/BitNet.git\ncd BitNet\n\n# 创建 conda 环境\nconda create -n bitnet-cpp python=3.9\nconda activate bitnet-cpp\n\n# 安装 Python 依赖\npip install -r requirements.txt\n```\n\n---\n\n## 下载模型\n\n### 官方推荐模型（BitNet-b1.58-2B-4T）\n\n```bash\n# 使用 huggingface-cli 下载 GGUF 格式\npip install huggingface_hub\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T\n```\n\n### 其他支持的模型\n\n```bash\n# 较小的 700M 模型（测试用）\nhuggingface-cli download 1bitLLM/bitnet_b1_58-large \\\n  --local-dir models/bitnet_b1_58-large\n\n# 3.3B 模型\nhuggingface-cli download 1bitLLM/bitnet_b1_58-3B \\\n  --local-dir models/bitnet_b1_58-3B\n```\n\n---\n\n## 编译量化环境\n\n```bash\n# 使用本地模型路径（x86 推荐 i2_s，ARM 推荐 tl1）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# ARM CPU 使用 TL1 内核\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q tl1\n\n# 使用预调优内核参数（可能更快）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s --use-pretuned\n```\n\n编译成功后，会在模型目录生成 `ggml-model-i2_s.gguf` 文件。\n\n---\n\n## 完成确认检查清单\n\n- [ ] `clang --version` 显示 >= 18\n- [ ] `cmake --version` 显示 >= 3.22\n- [ ] `git clone --recursive` 成功（含子模块）\n- [ ] `pip install -r requirements.txt` 无报错\n- [ ] 模型下载完成（几百 MB 到几 GB）\n- [ ] `setup_env.py` 执行成功，生成 `.gguf` 文件\n\n---\n\n## 下一步\n\n- [快速开始](02-quickstart.md) — 运行推理、对话模式、性能测试\n\nFile v0.1.1:guides/02-quickstart.md\n\n# 快速开始\n\n## 适用场景\n\n- 运行 BitNet 模型进行文本生成和对话\n- 使用对话模式进行交互式聊天\n- 测试模型推理性能\n\n---\n\n## 运行基础推理\n\n完成安装后，运行第一个推理：\n\n```bash\n# 确认 conda 环境已激活\nconda activate bitnet-cpp\n\n# 单次文本生成\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"The future of AI is\" \\\n  -n 128\n```\n\n参数说明：\n- `-m`：模型文件路径（`ggml-model-i2_s.gguf`）\n- `-p`：提示词（prompt）\n- `-n`：生成 token 数量（默认 128）\n\n---\n\n## 对话模式（推荐）\n\n使用 `-cnv` 标志进入交互式对话模式，`-p` 变为系统提示：\n\n```bash\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"You are a helpful AI assistant. Answer concisely and accurately.\" \\\n  -cnv\n```\n\n启动后进入交互式提示符，输入问题即可对话：\n```\n> What is machine learning?\nMachine learning is a subset of artificial intelligence that enables systems to learn...\n\n> Explain it like I'm five\nImagine teaching a dog tricks...\n```\n\n按 `Ctrl+C` 退出对话。\n\n---\n\n## 调整推理参数\n\n```bash\n# 增加并发线程数（提高速度）\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"Explain quantum computing\" \\\n  -t 8 \\          # 使用 8 个线程\n  -n 256 \\        # 生成 256 个 token\n  -c 4096         # 上下文窗口大小\n\n# 调整温度（创意度）\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"Write a poem about the moon\" \\\n  -temp 0.8 \\     # 0.0=确定性，1.0=创意，>1.0=随机\n  -n 200\n```\n\n---\n\n## 性能基准测试\n\n```bash\n# 基础基准（默认：128 token 生成，512 token 提示）\npython e2e_benchmark.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf\n\n# 自定义基准\npython e2e_benchmark.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -n 256 \\        # 生成 256 个 token\n  -p 1024 \\       # 使用 1024 token 的提示\n  -t 4            # 使用 4 个线程\n```\n\n典型输出示例（Apple M2）：\n```\nModel: BitNet-b1.58-2B-4T\nThreads: 4\nPrompt processing: 125 tokens/sec\nToken generation: 18.5 tokens/sec\nTotal time: 8.2s\n```\n\n---\n\n## 不同量化类型对比\n\n```bash\n# 安装 I2_S 量化（x86 推荐）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\npython run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p \"test\" -n 50\n\n# 安装 TL1 量化（ARM 推荐，如 Apple Silicon）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q tl1\npython run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-tl1.gguf -p \"test\" -n 50\n```\n\n---\n\n## 使用 Falcon3 模型（已有指令调优）\n\n```bash\n# 下载 Falcon3 指令模型（支持更好的对话能力）\nhuggingface-cli download tiiuae/Falcon3-3B-Instruct-1.58bit-gguf \\\n  --local-dir models/Falcon3-3B-Instruct\n\npython setup_env.py -md models/Falcon3-3B-Instruct -q i2_s\n\n# 对话模式\npython run_inference.py \\\n  -m models/Falcon3-3B-Instruct/ggml-model-i2_s.gguf \\\n  -p \"You are Falcon, a helpful assistant.\" \\\n  -cnv\n```\n\n---\n\n## 完成确认检查清单\n\n- [ ] `run_inference.py` 成功生成文本（非空输出）\n- [ ] 对话模式（`-cnv`）可以持续多轮对话\n- [ ] `e2e_benchmark.py` 输出 tokens/sec 指标\n- [ ] 生成速度基本达到预期（2B 模型 CPU 上应 > 5 tokens/sec）\n\n---\n\n## 下一步\n\n- [高级用法](03-advanced-usage.md) — GPU 推理、多线程优化、更大模型\n\nFile v0.1.1:guides/03-advanced-usage.md\n\n# 高级用法\n\n## GPU 推理\n\nBitNet 官方 GPU 内核（2025 年 5 月发布），支持 CUDA GPU 加速：\n\n```bash\n# 查看 GPU 推理文档\ncat gpu/README.md\n\n# GPU 版本需要 CUDA 环境\n# 参考: https://github.com/microsoft/BitNet/blob/main/gpu/README.md\n```\n\n---\n\n## 多线程性能优化\n\nCPU 线程数对性能影响显著，建议实验找到最优值：\n\n```bash\n# 测试不同线程数的性能\nfor threads in 1 2 4 8; do\n    echo \"=== Threads: $threads ===\"\n    python e2e_benchmark.py \\\n        -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n        -t $threads \\\n        -n 128 \\\n        -p 256\ndone\n```\n\n**经验规则：**\n- 单用户推理：物理核心数的 50-75%\n- 服务化推理：物理核心数的 100%\n- 超线程（HT）对推理加速有限，优先使用物理核心数\n\n---\n\n## 使用嵌入量化（减少内存）\n\n```bash\n# 启用嵌入量化（进一步降低内存使用）\npython setup_env.py \\\n  -md models/BitNet-b1.58-2B-4T \\\n  -q i2_s \\\n  --quant-embd    # 嵌入量化到 f16\n```\n\n---\n\n## 不同模型大小的性能对比\n\n```bash\n# 对比不同大小模型的速度\n# 700M 模型\npython e2e_benchmark.py -m models/bitnet_b1_58-large/ggml-model-i2_s.gguf -t 4\n\n# 2.4B 官方模型\npython e2e_benchmark.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -t 4\n\n# 3.3B 模型（ARM 专用 TL1 内核）\npython e2e_benchmark.py -m models/bitnet_b1_58-3B/ggml-model-tl1.gguf -t 4\n```\n\n典型速度参考（Apple M2）：\n| 模型 | 速度 | 内存 |\n|------|------|------|\n| bitnet_b1_58-large (700M) | ~45 t/s | ~0.5 GB |\n| BitNet-b1.58-2B-4T (2.4B) | ~18 t/s | ~1.2 GB |\n| bitnet_b1_58-3B (3.3B) | ~12 t/s | ~1.8 GB |\n\n---\n\n## 使用预调优内核\n\n预调优内核为特定硬件配置优化了 tile 大小等参数：\n\n```bash\n# 使用预调优参数（通常比默认快 15-100%）\npython setup_env.py \\\n  -md models/BitNet-b1.58-2B-4T \\\n  -q i2_s \\\n  --use-pretuned\n```\n\n---\n\n## 最新优化内核（2026 年 1 月）\n\n新版并行内核实现，带可配置 tiling 和嵌入量化支持：\n\n```bash\n# 查看优化指南\ncat src/README.md\n\n# 该优化在原实现基础上额外提速 1.15-2.1x\n# 无需额外配置，setup_env.py 自动使用最新内核\n```\n\n---\n\n## 内存估算\n\nBitNet 模型的内存使用公式（约）：\n\n| 参数量 | I2_S 量化内存 |\n|--------|--------------|\n| 700M | ~0.5 GB |\n| 2.4B | ~1.5 GB |\n| 3.3B | ~2.0 GB |\n| 8.0B | ~5.0 GB |\n\nBitNet 1.58-bit 量化比传统 FP16（~2 bytes/param）约低 87%，运行 100B 模型仅需约 20 GB 内存。\n\n---\n\n## 批量文本生成（无对话）\n\n```python\n# 通过 Python 脚本批量生成\nimport subprocess\n\nprompts = [\n    \"Translate to French: Hello world\",\n    \"Summarize in one sentence: Machine learning is...\",\n    \"What is the capital of Japan?\",\n]\n\nfor prompt in prompts:\n    result = subprocess.run(\n        [\n            \"python\", \"run_inference.py\",\n            \"-m\", \"models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf\",\n            \"-p\", prompt,\n            \"-n\", \"100\",\n            \"-t\", \"4\",\n        ],\n        capture_output=True, text=True\n    )\n    print(f\"Prompt: {prompt[:50]}...\")\n    print(f\"Output: {result.stdout[:200]}\")\n    print()\n```\n\n---\n\n## 完成确认检查清单\n\n- [ ] 多线程测试找到最优线程数\n- [ ] 预调优内核性能明显提升（可选）\n- [ ] GPU 推理配置成功（如有 NVIDIA GPU）\n- [ ] 嵌入量化降低内存使用（可选）\n\n---\n\n## 相关链接\n\n- [故障排查](../troubleshooting.md)\n- [GPU 推理文档](https://github.com/microsoft/BitNet/blob/main/gpu/README.md)\n- [优化指南](https://github.com/microsoft/BitNet/blob/main/src/README.md)\n- [技术论文](https://arxiv.org/abs/2410.16144)\n\nFile v0.1.1:skill-card.md\n\n## Description:\n\nBitnet guides agents through setting up Microsoft BitNet/bitnet.cpp for local 1-bit LLM inference, including dependency installation, model download, environment setup, inference, and benchmarking.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[cn-big-cabbage](https://clawhub.ai/user/cn-big-cabbage)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to install dependencies, retrieve BitNet-compatible models, configure quantized inference builds, run local text generation or chat, benchmark performance, and troubleshoot common setup issues.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill includes commands that fetch and execute mutable remote installer scripts or install system packages.\n\nMitigation: Review commands before execution, prefer package-manager-native or pinned verified installers, and avoid privileged execution unless required.\n\nRisk: The skill directs users to clone and run setup scripts from the BitNet repository and to install Python requirements.\n\nMitigation: Review the repository, setup scripts, and dependency files before running them in an isolated environment.\n\nRisk: Hugging Face authentication may be used during model download.\n\nMitigation: Treat Hugging Face tokens as secrets and avoid exposing them in prompts, logs, shell history, or shared outputs.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/cn-big-cabbage/skills/bitnet)\n- [BitNet GitHub Repository](https://github.com/microsoft/BitNet)\n- [BitNet-b1.58-2B-4T Model](https://huggingface.co/microsoft/BitNet-b1.58-2B-4T)\n- [BitNet GPU Inference Documentation](https://github.com/microsoft/BitNet/blob/main/gpu/README.md)\n- [BitNet Optimization Documentation](https://github.com/microsoft/BitNet/blob/main/src/README.md)\n- [BitNet Technical Report](https://arxiv.org/abs/2410.16144)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with inline shell and Python code blocks]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes setup, inference, benchmarking, tuning, and troubleshooting guidance for local BitNet workflows.]\n\n## Skill Version(s):\n\n0.1.1 (source: frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.1.1:troubleshooting.md\n\n# 故障排查\n\n## 安装问题\n\n---\n\n### 问题 1：CMake 版本过低或 Clang 未找到\n\n**难度：** 低\n\n**症状：** `CMake 3.xx < required 3.22` 或 `clang: command not found`\n\n**解决方案：**\n\nmacOS：\n```bash\n# 更新 Homebrew 和 LLVM\nbrew update\nbrew upgrade llvm\nexport PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\nclang --version  # 验证 >= 18\n```\n\nUbuntu/Debian：\n```bash\n# 安装最新 Clang\nbash -c \"$(wget -O - https://apt.llvm.org/llvm.sh)\"\nclang-18 --version\n\n# 安装最新 CMake\nsudo apt-get remove cmake  # 移除旧版\npip install cmake           # 通过 pip 获取最新版\ncmake --version\n```\n\n---\n\n### 问题 2：`git clone --recursive` 子模块失败\n\n**难度：** 低\n\n**症状：** `fatal: No url found for submodule path` 或 `Submodule init failed`\n\n**解决方案：**\n```bash\n# 如果忘记 --recursive，手动初始化子模块\ncd BitNet\ngit submodule update --init --recursive\n\n# 如果网络问题导致失败，重试\ngit submodule update --init --recursive --retry 3\n```\n\n---\n\n### 问题 3：`setup_env.py` 编译失败\n\n**难度：** 高\n\n**症状：** `CMake Error` 或 `clang: error: no such file or directory`\n\n**常见原因：**\n- Clang 路径未正确导出（概率 50%）\n- 子模块未初始化（概率 30%）\n- 磁盘空间不足（概率 20%）\n\n**解决方案：**\n```bash\n# 确保在正确目录\ncd /path/to/BitNet\nconda activate bitnet-cpp\n\n# macOS：导出 Clang 路径\nexport PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\nexport CC=/opt/homebrew/opt/llvm/bin/clang\nexport CXX=/opt/homebrew/opt/llvm/bin/clang++\n\n# 重新运行\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# 检查磁盘空间\ndf -h .  # 需要至少 5GB 可用空间\n```\n\nWindows 用户：必须在 **Developer Command Prompt for VS2022** 中运行，普通 CMD/PowerShell 不行。\n\n---\n\n## 使用问题\n\n---\n\n### 问题 4：模型文件找不到\n\n**难度：** 低\n\n**症状：** `FileNotFoundError: models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf` 不存在\n\n**排查步骤：**\n```bash\n# 检查模型目录\nls -la models/BitNet-b1.58-2B-4T/\n# 期望看到: ggml-model-i2_s.gguf 或 ggml-model-tl1.gguf\n```\n\n**解决方案：**\n```bash\n# 如果文件不存在，setup_env.py 未完成，重新运行\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# 或直接下载 GGUF 格式（跳过量化步骤）\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T\nls models/BitNet-b1.58-2B-4T/*.gguf  # 确认文件存在\n```\n\n---\n\n### 问题 5：推理速度远低于预期\n\n**难度：** 中\n\n**症状：** 速度 < 2 tokens/sec（2B 模型在现代 CPU 上应达 10+ tokens/sec）\n\n**常见原因：**\n- 使用了错误的量化内核（概率 40%）\n- 线程数未优化（概率 35%）\n- 内存不足导致频繁 swap（概率 25%）\n\n**解决方案：**\n```bash\n# 确认使用了正确内核（x86 用 i2_s，ARM 用 tl1）\nuname -m  # x86_64 或 arm64\n\n# x86：\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s --use-pretuned\n\n# ARM（Apple Silicon）：\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q tl1 --use-pretuned\n\n# 测试不同线程数\npython e2e_benchmark.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -t 4\npython e2e_benchmark.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -t 8\n\n# 检查内存使用\nfree -h  # Linux：应有足够空闲物理内存\n```\n\n---\n\n### 问题 6：对话模式（`-cnv`）响应质量差\n\n**难度：** 中\n\n**症状：** 模型回答乱码、重复或无法理解指令\n\n**常见原因：**\n- 使用了非指令调优（Instruct）版本的模型（概率 60%）\n- 系统提示（`-p`）格式不合适（概率 40%）\n\n**解决方案：**\n```bash\n# 使用指令调优版本的模型\nhuggingface-cli download tiiuae/Falcon3-3B-Instruct-1.58bit-gguf \\\n  --local-dir models/Falcon3-3B-Instruct\npython setup_env.py -md models/Falcon3-3B-Instruct -q i2_s\n\npython run_inference.py \\\n  -m models/Falcon3-3B-Instruct/ggml-model-i2_s.gguf \\\n  -p \"You are a helpful assistant. Be concise and accurate.\" \\\n  -cnv \\\n  -temp 0.3   # 降低温度提高稳定性\n```\n\n---\n\n## 网络/环境问题\n\n---\n\n### 问题 7：HuggingFace 模型下载失败\n\n**难度：** 中\n\n**症状：** `huggingface-cli download` 超时或 403 错误\n\n**解决方案：**\n```bash\n# 配置 HuggingFace Token（部分模型需要）\npip install huggingface_hub\nhuggingface-cli login  # 输入 HF Token\n\n# 或直接设置环境变量\nexport HUGGING_FACE_HUB_TOKEN=\"hf_your_token\"\n\n# 如果速度慢，使用国内镜像（如 ModelScope）\nexport HF_ENDPOINT=https://hf-mirror.com\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T\n\n# 断点续传\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T \\\n  --resume-download\n```\n\n---\n\n### 问题 8：Windows 编译失败（Developer Prompt 问题）\n\n**难度：** 高\n\n**症状：** `'cl' is not recognized` 或 `MSBuild: command not found`\n\n**说明：** Windows 必须在 **Developer Command Prompt for VS2022** 中运行，不能用普通 CMD、PowerShell 或 Git Bash。\n\n**解决方案：**\n1. 按 Win 键，搜索 \"Developer Command Prompt for VS 2022\"\n2. 以管理员身份打开\n3. 在该提示符中重新运行所有构建命令\n\n```cmd\nREM 在 Developer Command Prompt 中\ncd C:\\path\\to\\BitNet\nconda activate bitnet-cpp\npython setup_env.py -md models\\BitNet-b1.58-2B-4T -q i2_s\n```\n\n---\n\n## 通用诊断\n\n```bash\n# 系统信息\nuname -m && python --version && cmake --version && clang --version\n\n# 模型文件检查\nls -lh models/BitNet-b1.58-2B-4T/*.gguf\n\n# 快速推理测试（10 个 token）\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"Hello\" \\\n  -n 10\n\n# 基准测试（查看速度）\npython e2e_benchmark.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -t 4 -n 64 -p 128\n```\n\n**GitHub Issues：** https://github.com/microsoft/BitNet/issues\n\n**技术报告：** https://arxiv.org/abs/2410.16144\n\nArchive v0.1.0: 7 files, 11984 bytes\n\nFiles: guides/01-installation.md (3289b), guides/02-quickstart.md (3537b), guides/03-advanced-usage.md (3699b), skill-card.md (2398b), SKILL.md (4332b), troubleshooting.md (6044b), _meta.json (125b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: bitnet\ndescription: 微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度\nversion: 0.1.0\nmetadata:\n  openclaw_requires: \">=1.0.0\"\n  emoji: ⚡\n  homepage: https://github.com/microsoft/BitNet\n---\n\n# BitNet — 1-bit LLM 本地高效推理\n\nbitnet.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 部署的经济性。\n\n## 核心使用场景\n\n- **CPU 本地 LLM 推理**：无需 GPU，在消费级 CPU 上运行数十亿参数模型\n- **边缘设备部署**：极低能耗，适合嵌入式设备、笔记本电脑、服务器 CPU\n- **隐私敏感场景**：完全本地运行，数据不离开设备\n- **大规模批量推理**：多线程优化，节省数据中心能源成本\n- **学术研究**：研究 1-bit LLM 量化技术和推理优化\n\n## AI 辅助使用流程\n\n1. **环境搭建** — AI 创建 conda 环境并安装编译依赖（Python、CMake、Clang）\n2. **克隆仓库** — AI 执行 `git clone --recursive https://github.com/microsoft/BitNet.git`\n3. **下载模型** — AI 使用 `huggingface-cli download` 下载官方 BitNet 模型\n4. **编译环境** — AI 运行 `python setup_env.py` 量化模型并编译推理内核\n5. **运行推理** — AI 执行 `python run_inference.py` 进行对话或文本生成\n6. **性能测试** — AI 运行 `python e2e_benchmark.py` 测量吞吐量和延迟\n\n## 关键章节导航\n\n- [安装指南](guides/01-installation.md) — 依赖安装、conda 环境、模型下载\n- [快速开始](guides/02-quickstart.md) — 编译量化、运行推理、对话模式\n- [高级用法](guides/03-advanced-usage.md) — GPU 推理、性能测试、多线程配置\n- [故障排查](troubleshooting.md) — 编译错误、模型加载失败、性能问题\n\n## AI 助手能力\n\n使用本技能时，AI 可以：\n\n- ✅ 搭建 conda 环境并安装编译依赖（CMake、Clang）\n- ✅ 克隆 BitNet 仓库并安装 Python 依赖\n- ✅ 使用 `huggingface-cli` 下载指定 BitNet 模型\n- ✅ 运行 `setup_env.py` 完成量化和环境配置\n- ✅ 执行 `run_inference.py` 进行对话推理\n- ✅ 运行 `e2e_benchmark.py` 测试推理性能\n- ✅ 配置多线程参数优化吞吐量\n\n## 核心功能\n\n- ✅ **极速 CPU 推理** — x86 CPU 提升 2.4-6.2x，ARM CPU 提升 1.4-5.1x\n- ✅ **超低能耗** — 比传统 INT8 推理节能 55-82%\n- ✅ **大模型单 CPU** — 100B 模型在单 CPU 以 5-7 tokens/秒运行\n- ✅ **官方量化内核** — I2_S、TL1、TL2 三种针对不同硬件优化的内核\n- ✅ **GPU 支持** — 官方 GPU 推理内核（2025 年发布）\n- ✅ **多模型支持** — BitNet-b1.58 2B/3B、Llama3-8B-1.58bit、Falcon3 系列\n- ✅ **对话模式** — `-cnv` 标志启用交互式聊天（系统提示支持）\n- ✅ **性能基准** — 内置 `e2e_benchmark.py` 测量 tokens/秒和能耗\n\n## 快速示例\n\n```bash\n# 克隆并进入项目\ngit clone --recursive https://github.com/microsoft/BitNet.git\ncd BitNet\n\n# 安装依赖\nconda create -n bitnet-cpp python=3.9 && conda activate bitnet-cpp\npip install -r requirements.txt\n\n# 下载官方模型并量化\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# 运行对话推理\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"You are a helpful assistant\" \\\n  -cnv\n```\n\n## 安装要求\n\n| 依赖 | 版本要求 |\n|------|---------|\n| Python | >= 3.9 |\n| CMake | >= 3.22 |\n| Clang | >= 18 |\n| conda | 推荐（环境隔离） |\n| 磁盘空间 | 模型约 1-20 GB |\n\n## 项目链接\n\n- GitHub：https://github.com/microsoft/BitNet\n- 官方模型（HuggingFace）：https://huggingface.co/microsoft/BitNet-b1.58-2B-4T\n- GPU 推理文档：https://github.com/microsoft/BitNet/blob/main/gpu/README.md\n- 技术报告：https://arxiv.org/abs/2410.16144\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7c5ry95ff7x22mt3fx6j0q3d81p8t3\",\n  \"slug\": \"bitnet\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1776818508169\n}\n\nFile v0.1.0:guides/01-installation.md\n\n# 安装指南\n\n## 适用场景\n\n- 在 Linux/macOS/Windows 上从源码构建 BitNet\n- 配置 conda 环境和编译依赖\n- 下载官方模型并完成量化\n\n---\n\n## 环境要求\n\n| 依赖 | 版本 | 安装方式 |\n|------|------|---------|\n| Python | >= 3.9 | conda 或系统 Python |\n| CMake | >= 3.22 | `conda install cmake` |\n| Clang | >= 18 | 系统包管理器 |\n| conda | 任意 | [Miniconda](https://docs.conda.io/en/latest/miniconda.html) |\n\n---\n\n## macOS 安装\n\n> **AI 可自动执行**\n\n```bash\n# 安装 Homebrew（如未安装）\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n\n# 安装编译依赖\nbrew install llvm cmake\n\n# 配置 Clang 路径（Apple Silicon）\nexport PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\nexport CC=/opt/homebrew/opt/llvm/bin/clang\nexport CXX=/opt/homebrew/opt/llvm/bin/clang++\n\n# 验证版本\nclang --version  # 需要 >= 18\ncmake --version  # 需要 >= 3.22\n```\n\n---\n\n## Linux (Ubuntu/Debian) 安装\n\n```bash\n# 安装 Clang 18\nbash -c \"$(wget -O - https://apt.llvm.org/llvm.sh)\"\n\n# 安装 CMake\nsudo apt-get install -y cmake\n\n# 验证\nclang-18 --version\ncmake --version\n```\n\n---\n\n## Windows 安装\n\n在 Windows 上需要 Visual Studio 2022：\n\n1. 下载 [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)\n2. 在安装程序中勾选：\n   - Desktop-development with C++\n   - C++-CMake Tools for Windows\n   - C++-Clang Compiler for Windows\n   - MS-Build Support for LLVM-Toolset (clang)\n3. 使用 **Developer Command Prompt for VS2022** 运行所有命令\n\n---\n\n## 克隆并安装 Python 依赖\n\n```bash\n# 克隆（必须使用 --recursive 拉取子模块）\ngit clone --recursive https://github.com/microsoft/BitNet.git\ncd BitNet\n\n# 创建 conda 环境\nconda create -n bitnet-cpp python=3.9\nconda activate bitnet-cpp\n\n# 安装 Python 依赖\npip install -r requirements.txt\n```\n\n---\n\n## 下载模型\n\n### 官方推荐模型（BitNet-b1.58-2B-4T）\n\n```bash\n# 使用 huggingface-cli 下载 GGUF 格式\npip install huggingface_hub\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T\n```\n\n### 其他支持的模型\n\n```bash\n# 较小的 700M 模型（测试用）\nhuggingface-cli download 1bitLLM/bitnet_b1_58-large \\\n  --local-dir models/bitnet_b1_58-large\n\n# 3.3B 模型\nhuggingface-cli download 1bitLLM/bitnet_b1_58-3B \\\n  --local-dir models/bitnet_b1_58-3B\n```\n\n---\n\n## 编译量化环境\n\n```bash\n# 使用本地模型路径（x86 推荐 i2_s，ARM 推荐 tl1）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# ARM CPU 使用 TL1 内核\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q tl1\n\n# 使用预调优内核参数（可能更快）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s --use-pretuned\n```\n\n编译成功后，会在模型目录生成 `ggml-model-i2_s.gguf` 文件。\n\n---\n\n## 完成确认检查清单\n\n- [ ] `clang --version` 显示 >= 18\n- [ ] `cmake --version` 显示 >= 3.22\n- [ ] `git clone --recursive` 成功（含子模块）\n- [ ] `pip install -r requirements.txt` 无报错\n- [ ] 模型下载完成（几百 MB 到几 GB）\n- [ ] `setup_env.py` 执行成功，生成 `.gguf` 文件\n\n---\n\n## 下一步\n\n- [快速开始](02-quickstart.md) — 运行推理、对话模式、性能测试\n\nFile v0.1.0:guides/02-quickstart.md\n\n# 快速开始\n\n## 适用场景\n\n- 运行 BitNet 模型进行文本生成和对话\n- 使用对话模式进行交互式聊天\n- 测试模型推理性能\n\n---\n\n## 运行基础推理\n\n完成安装后，运行第一个推理：\n\n```bash\n# 确认 conda 环境已激活\nconda activate bitnet-cpp\n\n# 单次文本生成\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"The future of AI is\" \\\n  -n 128\n```\n\n参数说明：\n- `-m`：模型文件路径（`ggml-model-i2_s.gguf`）\n- `-p`：提示词（prompt）\n- `-n`：生成 token 数量（默认 128）\n\n---\n\n## 对话模式（推荐）\n\n使用 `-cnv` 标志进入交互式对话模式，`-p` 变为系统提示：\n\n```bash\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"You are a helpful AI assistant. Answer concisely and accurately.\" \\\n  -cnv\n```\n\n启动后进入交互式提示符，输入问题即可对话：\n```\n> What is machine learning?\nMachine learning is a subset of artificial intelligence that enables systems to learn...\n\n> Explain it like I'm five\nImagine teaching a dog tricks...\n```\n\n按 `Ctrl+C` 退出对话。\n\n---\n\n## 调整推理参数\n\n```bash\n# 增加并发线程数（提高速度）\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"Explain quantum computing\" \\\n  -t 8 \\          # 使用 8 个线程\n  -n 256 \\        # 生成 256 个 token\n  -c 4096         # 上下文窗口大小\n\n# 调整温度（创意度）\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"Write a poem about the moon\" \\\n  -temp 0.8 \\     # 0.0=确定性，1.0=创意，>1.0=随机\n  -n 200\n```\n\n---\n\n## 性能基准测试\n\n```bash\n# 基础基准（默认：128 token 生成，512 token 提示）\npython e2e_benchmark.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf\n\n# 自定义基准\npython e2e_benchmark.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -n 256 \\        # 生成 256 个 token\n  -p 1024 \\       # 使用 1024 token 的提示\n  -t 4            # 使用 4 个线程\n```\n\n典型输出示例（Apple M2）：\n```\nModel: BitNet-b1.58-2B-4T\nThreads: 4\nPrompt processing: 125 tokens/sec\nToken generation: 18.5 tokens/sec\nTotal time: 8.2s\n```\n\n---\n\n## 不同量化类型对比\n\n```bash\n# 安装 I2_S 量化（x86 推荐）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\npython run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p \"test\" -n 50\n\n# 安装 TL1 量化（ARM 推荐，如 Apple Silicon）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q tl1\npython run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-tl1.gguf -p \"test\" -n 50\n```\n\n---\n\n## 使用 Falcon3 模型（已有指令调优）\n\n```bash\n# 下载 Falcon3 指令模型（支持更好的对话能力）\nhuggingface-cli download tiiuae/Falcon3-3B-Instruct-1.58bit-gguf \\\n  --local-dir models/Falcon3-3B-Instruct\n\npython setup_env.py -md models/Falcon3-3B-Instruct -q i2_s\n\n# 对话模式\npython run_inference.py \\\n  -m models/Falcon3-3B-Instruct/ggml-model-i2_s.gguf \\\n  -p \"You are Falcon, a helpful assistant.\" \\\n  -cnv\n```\n\n---\n\n## 完成确认检查清单\n\n- [ ] `run_inference.py` 成功生成文本（非空输出）\n- [ ] 对话模式（`-cnv`）可以持续多轮对话\n- [ ] `e2e_benchmark.py` 输出 tokens/sec 指标\n- [ ] 生成速度基本达到预期（2B 模型 CPU 上应 > 5 tokens/sec）\n\n---\n\n## 下一步\n\n- [高级用法](03-advanced-usage.md) — GPU 推理、多线程优化、更大模型\n\nFile v0.1.0:guides/03-advanced-usage.md\n\n# 高级用法\n\n## GPU 推理\n\nBitNet 官方 GPU 内核（2025 年 5 月发布），支持 CUDA GPU 加速：\n\n```bash\n# 查看 GPU 推理文档\ncat gpu/README.md\n\n# GPU 版本需要 CUDA 环境\n# 参考: https://github.com/microsoft/BitNet/blob/main/gpu/README.md\n```\n\n---\n\n## 多线程性能优化\n\nCPU 线程数对性能影响显著，建议实验找到最优值：\n\n```bash\n# 测试不同线程数的性能\nfor threads in 1 2 4 8; do\n    echo \"=== Threads: $threads ===\"\n    python e2e_benchmark.py \\\n        -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n        -t $threads \\\n        -n 128 \\\n        -p 256\ndone\n```\n\n**经验规则：**\n- 单用户推理：物理核心数的 50-75%\n- 服务化推理：物理核心数的 100%\n- 超线程（HT）对推理加速有限，优先使用物理核心数\n\n---\n\n## 使用嵌入量化（减少内存）\n\n```bash\n# 启用嵌入量化（进一步降低内存使用）\npython setup_env.py \\\n  -md models/BitNet-b1.58-2B-4T \\\n  -q i2_s \\\n  --quant-embd    # 嵌入量化到 f16\n```\n\n---\n\n## 不同模型大小的性能对比\n\n```bash\n# 对比不同大小模型的速度\n# 700M 模型\npython e2e_benchmark.py -m models/bitnet_b1_58-large/ggml-model-i2_s.gguf -t 4\n\n# 2.4B 官方模型\npython e2e_benchmark.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -t 4\n\n# 3.3B 模型（ARM 专用 TL1 内核）\npython e2e_benchmark.py -m models/bitnet_b1_58-3B/ggml-model-tl1.gguf -t 4\n```\n\n典型速度参考（Apple M2）：\n| 模型 | 速度 | 内存 |\n|------|------|------|\n| bitnet_b1_58-large (700M) | ~45 t/s | ~0.5 GB |\n| BitNet-b1.58-2B-4T (2.4B) | ~18 t/s | ~1.2 GB |\n| bitnet_b1_58-3B (3.3B) | ~12 t/s | ~1.8 GB |\n\n---\n\n## 使用预调优内核\n\n预调优内核为特定硬件配置优化了 tile 大小等参数：\n\n```bash\n# 使用预调优参数（通常比默认快 15-100%）\npython setup_env.py \\\n  -md models/BitNet-b1.58-2B-4T \\\n  -q i2_s \\\n  --use-pretuned\n```\n\n---\n\n## 最新优化内核（2026 年 1 月）\n\n新版并行内核实现，带可配置 tiling 和嵌入量化支持：\n\n```bash\n# 查看优化指南\ncat src/README.md\n\n# 该优化在原实现基础上额外提速 1.15-2.1x\n# 无需额外配置，setup_env.py 自动使用最新内核\n```\n\n---\n\n## 内存估算\n\nBitNet 模型的内存使用公式（约）：\n\n| 参数量 | I2_S 量化内存 |\n|--------|--------------|\n| 700M | ~0.5 GB |\n| 2.4B | ~1.5 GB |\n| 3.3B | ~2.0 GB |\n| 8.0B | ~5.0 GB |\n\nBitNet 1.58-bit 量化比传统 FP16（~2 bytes/param）约低 87%，运行 100B 模型仅需约 20 GB 内存。\n\n---\n\n## 批量文本生成（无对话）\n\n```python\n# 通过 Python 脚本批量生成\nimport subprocess\n\nprompts = [\n    \"Translate to French: Hello world\",\n    \"Summarize in one sentence: Machine learning is...\",\n    \"What is the capital of Japan?\",\n]\n\nfor prompt in prompts:\n    result = subprocess.run(\n        [\n            \"python\", \"run_inference.py\",\n            \"-m\", \"models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf\",\n            \"-p\", prompt,\n            \"-n\", \"100\",\n            \"-t\", \"4\",\n        ],\n        capture_output=True, text=True\n    )\n    print(f\"Prompt: {prompt[:50]}...\")\n    print(f\"Output: {result.stdout[:200]}\")\n    print()\n```\n\n---\n\n## 完成确认检查清单\n\n- [ ] 多线程测试找到最优线程数\n- [ ] 预调优内核性能明显提升（可选）\n- [ ] GPU 推理配置成功（如有 NVIDIA GPU）\n- [ ] 嵌入量化降低内存使用（可选）\n\n---\n\n## 相关链接\n\n- [故障排查](../troubleshooting.md)\n- [GPU 推理文档](https://github.com/microsoft/BitNet/blob/main/gpu/README.md)\n- [优化指南](https://github.com/microsoft/BitNet/blob/main/src/README.md)\n- [技术论文](https://arxiv.org/abs/2410.16144)\n\nFile v0.1.0:skill-card.md\n\n## Description: <br>\nGuides agents through installing, configuring, running, and benchmarking BitNet 1.58-bit local LLM inference on CPU-focused environments. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[cn-big-cabbage](https://clawhub.ai/user/cn-big-cabbage) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to set up BitNet, download compatible models, run local inference, tune CPU threading, and collect performance benchmarks. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Remote installer and repository setup commands can execute unreviewed code or change the local environment. <br>\nMitigation: Review each command before execution, inspect remote scripts and cloned code, and run setup in an isolated environment. <br>\nRisk: Model downloads and package installs may leave persistent files and dependencies on the system. <br>\nMitigation: Use a dedicated environment and confirm disk space, dependency scope, and cleanup expectations before installation. <br>\nRisk: Hugging Face token handling can expose credentials if secrets are pasted into commands or logs. <br>\nMitigation: Use scoped tokens through safer login or secret management instead of inline environment exports. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/cn-big-cabbage/bitnet) <br>\n- [BitNet Project Homepage](https://github.com/microsoft/BitNet) <br>\n- [BitNet-b1.58-2B-4T Model](https://huggingface.co/microsoft/BitNet-b1.58-2B-4T) <br>\n- [BitNet Technical Report](https://arxiv.org/abs/2410.16144) <br>\n- [BitNet GPU Documentation](https://github.com/microsoft/BitNet/blob/main/gpu/README.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Markdown, Shell commands, Configuration] <br>\n**Output Format:** [Markdown with inline shell commands and configuration guidance] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [None] <br>\n\n## Skill Version(s): <br>\n0.1.0 (source: frontmatter and server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.1.0:troubleshooting.md\n\n# 故障排查\n\n## 安装问题\n\n---\n\n### 问题 1：CMake 版本过低或 Clang 未找到\n\n**难度：** 低\n\n**症状：** `CMake 3.xx < required 3.22` 或 `clang: command not found`\n\n**解决方案：**\n\nmacOS：\n```bash\n# 更新 Homebrew 和 LLVM\nbrew update\nbrew upgrade llvm\nexport PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\nclang --version  # 验证 >= 18\n```\n\nUbuntu/Debian：\n```bash\n# 安装最新 Clang\nbash -c \"$(wget -O - https://apt.llvm.org/llvm.sh)\"\nclang-18 --version\n\n# 安装最新 CMake\nsudo apt-get remove cmake  # 移除旧版\npip install cmake           # 通过 pip 获取最新版\ncmake --version\n```\n\n---\n\n### 问题 2：`git clone --recursive` 子模块失败\n\n**难度：** 低\n\n**症状：** `fatal: No url found for submodule path` 或 `Submodule init failed`\n\n**解决方案：**\n```bash\n# 如果忘记 --recursive，手动初始化子模块\ncd BitNet\ngit submodule update --init --recursive\n\n# 如果网络问题导致失败，重试\ngit submodule update --init --recursive --retry 3\n```\n\n---\n\n### 问题 3：`setup_env.py` 编译失败\n\n**难度：** 高\n\n**症状：** `CMake Error` 或 `clang: error: no such file or directory`\n\n**常见原因：**\n- Clang 路径未正确导出（概率 50%）\n- 子模块未初始化（概率 30%）\n- 磁盘空间不足（概率 20%）\n\n**解决方案：**\n```bash\n# 确保在正确目录\ncd /path/to/BitNet\nconda activate bitnet-cpp\n\n# macOS：导出 Clang 路径\nexport PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\nexport CC=/opt/homebrew/opt/llvm/bin/clang\nexport CXX=/opt/homebrew/opt/llvm/bin/clang++\n\n# 重新运行\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# 检查磁盘空间\ndf -h .  # 需要至少 5GB 可用空间\n```\n\nWindows 用户：必须在 **Developer Command Prompt for VS2022** 中运行，普通 CMD/PowerShell 不行。\n\n---\n\n## 使用问题\n\n---\n\n### 问题 4：模型文件找不到\n\n**难度：** 低\n\n**症状：** `FileNotFoundError: models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf` 不存在\n\n**排查步骤：**\n```bash\n# 检查模型目录\nls -la models/BitNet-b1.58-2B-4T/\n# 期望看到: ggml-model-i2_s.gguf 或 ggml-model-tl1.gguf\n```\n\n**解决方案：**\n```bash\n# 如果文件不存在，setup_env.py 未完成，重新运行\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# 或直接下载 GGUF 格式（跳过量化步骤）\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T\nls models/BitNet-b1.58-2B-4T/*.gguf  # 确认文件存在\n```\n\n---\n\n### 问题 5：推理速度远低于预期\n\n**难度：** 中\n\n**症状：** 速度 < 2 tokens/sec（2B 模型在现代 CPU 上应达 10+ tokens/sec）\n\n**常见原因：**\n- 使用了错误的量化内核（概率 40%）\n- 线程数未优化（概率 35%）\n- 内存不足导致频繁 swap（概率 25%）\n\n**解决方案：**\n```bash\n# 确认使用了正确内核（x86 用 i2_s，ARM 用 tl1）\nuname -m  # x86_64 或 arm64\n\n# x86：\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s --use-pretuned\n\n# ARM（Apple Silicon）：\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q tl1 --use-pretuned\n\n# 测试不同线程数\npython e2e_benchmark.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -t 4\npython e2e_benchmark.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -t 8\n\n# 检查内存使用\nfree -h  # Linux：应有足够空闲物理内存\n```\n\n---\n\n### 问题 6：对话模式（`-cnv`）响应质量差\n\n**难度：** 中\n\n**症状：** 模型回答乱码、重复或无法理解指令\n\n**常见原因：**\n- 使用了非指令调优（Instruct）版本的模型（概率 60%）\n- 系统提示（`-p`）格式不合适（概率 40%）\n\n**解决方案：**\n```bash\n# 使用指令调优版本的模型\nhuggingface-cli download tiiuae/Falcon3-3B-Instruct-1.58bit-gguf \\\n  --local-dir models/Falcon3-3B-Instruct\npython setup_env.py -md models/Falcon3-3B-Instruct -q i2_s\n\npython run_inference.py \\\n  -m models/Falcon3-3B-Instruct/ggml-model-i2_s.gguf \\\n  -p \"You are a helpful assistant. Be concise and accurate.\" \\\n  -cnv \\\n  -temp 0.3   # 降低温度提高稳定性\n```\n\n---\n\n## 网络/环境问题\n\n---\n\n### 问题 7：HuggingFace 模型下载失败\n\n**难度：** 中\n\n**症状：** `huggingface-cli download` 超时或 403 错误\n\n**解决方案：**\n```bash\n# 配置 HuggingFace Token（部分模型需要）\npip install huggingface_hub\nhuggingface-cli login  # 输入 HF Token\n\n# 或直接设置环境变量\nexport HUGGING_FACE_HUB_TOKEN=\"hf_your_token\"\n\n# 如果速度慢，使用国内镜像（如 ModelScope）\nexport HF_ENDPOINT=https://hf-mirror.com\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T\n\n# 断点续传\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T \\\n  --resume-download\n```\n\n---\n\n### 问题 8：Windows 编译失败（Developer Prompt 问题）\n\n**难度：** 高\n\n**症状：** `'cl' is not recognized` 或 `MSBuild: command not found`\n\n**说明：** Windows 必须在 **Developer Command Prompt for VS2022** 中运行，不能用普通 CMD、PowerShell 或 Git Bash。\n\n**解决方案：**\n1. 按 Win 键，搜索 \"Developer Command Prompt for VS 2022\"\n2. 以管理员身份打开\n3. 在该提示符中重新运行所有构建命令\n\n```cmd\nREM 在 Developer Command Prompt 中\ncd C:\\path\\to\\BitNet\nconda activate bitnet-cpp\npython setup_env.py -md models\\BitNet-b1.58-2B-4T -q i2_s\n```\n\n---\n\n## 通用诊断\n\n```bash\n# 系统信息\nuname -m && python --version && cmake --version && clang --version\n\n# 模型文件检查\nls -lh models/BitNet-b1.58-2B-4T/*.gguf\n\n# 快速推理测试（10 个 token）\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"Hello\" \\\n  -n 10\n\n# 基准测试（查看速度）\npython e2e_benchmark.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -t 4 -n 64 -p 128\n```\n\n**GitHub Issues：** https://github.com/microsoft/BitNet/issues\n\n**技术报告：** https://arxiv.org/abs/2410.16144","readmeExcerpt":"Skill: Bitnet Owner: cn-big-cabbage Summary: 微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度 Tags: latest:0.1.1 Version history: v0.1.1 | 2026-06-16T10:09:06.774Z | auto - Update to version 0.1.1 - Added _meta.json file for enhanced metadata management - Updated SKILL.md: metadata structure improved (now nested under \"openclaw\" and with \"bins\" requirements) - Remove","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# 克隆并进入项目\ngit clone --recursive https://github.com/microsoft/BitNet.git\ncd BitNet\n\n# 安装依赖\nconda create -n bitnet-cpp python=3.9 && conda activate bitnet-cpp\npip install -r requirements.txt\n\n# 下载官方模型并量化\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# 运行对话推理\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"You are a helpful assistant\" \\\n  -cnv"},{"language":"bash","snippet":"# 安装 Homebrew（如未安装）\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n\n# 安装编译依赖\nbrew install llvm cmake\n\n# 配置 Clang 路径（Apple Silicon）\nexport PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\nexport CC=/opt/homebrew/opt/llvm/bin/clang\nexport CXX=/opt/homebrew/opt/llvm/bin/clang++\n\n# 验证版本\nclang --version  # 需要 >= 18\ncmake --version  # 需要 >= 3.22"},{"language":"bash","snippet":"# 安装 Clang 18\nbash -c \"$(wget -O - https://apt.llvm.org/llvm.sh)\"\n\n# 安装 CMake\nsudo apt-get install -y cmake\n\n# 验证\nclang-18 --version\ncmake --version"},{"language":"bash","snippet":"# 克隆（必须使用 --recursive 拉取子模块）\ngit clone --recursive https://github.com/microsoft/BitNet.git\ncd BitNet\n\n# 创建 conda 环境\nconda create -n bitnet-cpp python=3.9\nconda activate bitnet-cpp\n\n# 安装 Python 依赖\npip install -r requirements.txt"},{"language":"bash","snippet":"# 使用 huggingface-cli 下载 GGUF 格式\npip install huggingface_hub\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T"},{"language":"bash","snippet":"# 较小的 700M 模型（测试用）\nhuggingface-cli download 1bitLLM/bitnet_b1_58-large \\\n  --local-dir models/bitnet_b1_58-large\n\n# 3.3B 模型\nhuggingface-cli download 1bitLLM/bitnet_b1_58-3B \\\n  --local-dir models/bitnet_b1_58-3B"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: bitnet\ndescription: 微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度\nversion: 0.1.1\nmetadata:\n  openclaw:\n    requires:\n      bins:\n        - python3\n        - cmake\n    emoji: ⚡\n    homepage: https://github.com/microsoft/BitNet\n---\n\n# BitNet — 1-bit LLM 本地高效推理\n\nbitnet.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 部署的经济性。\n\n## 核心使用场景\n\n- **CPU 本地 LLM 推理**：无需 GPU，在消费级 CPU 上运行数十亿参数模型\n- **边缘设备部署**：极低能耗，适合嵌入式设备、笔记本电脑、服务器 CPU\n- **隐私敏感场景**：完全本地运行，数据不离开设备\n- **大规模批量推理**：多线程优化，节省数据中心能源成本\n- **学术研究**：研究 1-bit LLM 量化技术和推理优化\n\n## AI 辅助使用流程\n\n1. **环境搭建** — AI 创建 conda 环境并安装编译依赖（Python、CMake、Clang）\n2. **克隆仓库** — AI 执行 `git clone --recursive https://github.com/microsoft/BitNet.git`\n3. **下载模型** — AI 使用 `huggingface-cli download` 下载官方 BitNet 模型\n4. **编译环境** — AI 运行 `python setup_env.py` 量化模型并编译推理内核\n5. **运行推理** — AI 执行 `python run_inference.py` 进行对话或文本生成\n6. **性能测试** — AI 运行 `python e2e_benchmark.py` 测量吞吐量和延迟\n\n## 关键章节导航\n\n- [安装指南](guides/01-installation.md) — 依赖安装、conda 环境、模型下载\n- [快速开始](guides/02-quickstart.md) — 编译量化、运行推理、对话模式\n- [高级用法](guides/03-advanced-usage.md) — GPU 推理、性能测试、多线程配置\n- [故障排查](troubleshooting.md) — 编译错误、模型加载失败、性能问题\n\n## AI 助手能力\n\n使用本技能时，AI 可以：\n\n- ✅ 搭建 conda 环境并安装编译依赖（CMake、Clang）\n- ✅ 克隆 BitNet 仓库并安装 Python 依赖\n- ✅ 使用 `huggingface-cli` 下载指定 BitNet 模型\n- ✅ 运行 `setup_env.py` 完成量化和环境配置\n- ✅ 执行 `run_inference.py` 进行对话推理\n- ✅ 运行 `e2e_benchmark.py` 测试推理性能\n- ✅ 配置多线程参数优化吞吐量\n\n## 核心功能\n\n- ✅ **极速 CPU 推理** — x86 CPU 提升 2.4-6.2x，ARM CPU 提升 1.4-5.1x\n- ✅ **超低能耗** — 比传统 INT8 推理节能 55-82%\n- ✅ **大模型单 CPU** — 100B 模型在单 CPU 以 5-7 tokens/秒运行\n- ✅ **官方量化内核** — I2_S、TL1、TL2 三种针对不同硬件优化的内核\n- ✅ **GPU 支持** — 官方 GPU 推理内核（2025 年发布）\n- ✅ **多模型支持** — BitNet-b1.58 2B/3B、Llama3-8B-1.58bit、Falcon3 系列\n- ✅ **对话模式** — `-cnv` 标志启用交互式聊天（系统提示支持）\n- ✅ **性能基准** — 内置 `e2e_benchmark.py` 测量 tokens/秒和能耗\n\n## 快速示例\n\n```bash\n# 克隆并进入项目\ngit clone --recursive https://github.com/microsoft/BitNet.git\ncd BitNet\n\n# 安装依赖\nconda create -n bitnet-cpp python=3.9 && conda activate bitnet-cpp\npip install -r requirements.txt\n\n# 下载官方模型并量化\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# 运行对话推理\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"You are a helpful assistant\" \\\n  -cnv\n```\n\n## 安装要求\n\n| 依赖 | 版本要求 |\n|------|---------|\n| Python | >= 3.9 |\n| CMake | >= 3.22 |\n| Clang | >= 18 |\n| conda | 推荐（环境隔离） |\n| 磁盘空间 | 模型约 1-20 GB |\n\n## 项目链接\n\n- GitHub：https://github.com/microsoft/BitNet\n- 官方模型（HuggingFace）：https://huggingface.co/microsoft/BitNet-b1.58-2B-4T\n- GPU 推理文档：https://github.com/microsoft/BitNet/blob/main/gpu/README.md\n- 技术报告：https://arxiv.org/abs/2410.16144"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7c5ry95ff7x22mt3fx6j0q3d81p8t3\",\n  \"slug\": \"bitnet\",\n  \"version\": \"0.1.1\",\n  \"publishedAt\": 1781604546774\n}"},{"path":"guides/01-installation.md","content":"# 安装指南\n\n## 适用场景\n\n- 在 Linux/macOS/Windows 上从源码构建 BitNet\n- 配置 conda 环境和编译依赖\n- 下载官方模型并完成量化\n\n---\n\n## 环境要求\n\n| 依赖 | 版本 | 安装方式 |\n|------|------|---------|\n| Python | >= 3.9 | conda 或系统 Python |\n| CMake | >= 3.22 | `conda install cmake` |\n| Clang | >= 18 | 系统包管理器 |\n| conda | 任意 | [Miniconda](https://docs.conda.io/en/latest/miniconda.html) |\n\n---\n\n## macOS 安装\n\n> **AI 可自动执行**\n\n```bash\n# 安装 Homebrew（如未安装）\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n\n# 安装编译依赖\nbrew install llvm cmake\n\n# 配置 Clang 路径（Apple Silicon）\nexport PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\nexport CC=/opt/homebrew/opt/llvm/bin/clang\nexport CXX=/opt/homebrew/opt/llvm/bin/clang++\n\n# 验证版本\nclang --version  # 需要 >= 18\ncmake --version  # 需要 >= 3.22\n```\n\n---\n\n## Linux (Ubuntu/Debian) 安装\n\n```bash\n# 安装 Clang 18\nbash -c \"$(wget -O - https://apt.llvm.org/llvm.sh)\"\n\n# 安装 CMake\nsudo apt-get install -y cmake\n\n# 验证\nclang-18 --version\ncmake --version\n```\n\n---\n\n## Windows 安装\n\n在 Windows 上需要 Visual Studio 2022：\n\n1. 下载 [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)\n2. 在安装程序中勾选：\n   - Desktop-development with C++\n   - C++-CMake Tools for Windows\n   - C++-Clang Compiler for Windows\n   - MS-Build Support for LLVM-Toolset (clang)\n3. 使用 **Developer Command Prompt for VS2022** 运行所有命令\n\n---\n\n## 克隆并安装 Python 依赖\n\n```bash\n# 克隆（必须使用 --recursive 拉取子模块）\ngit clone --recursive https://github.com/microsoft/BitNet.git\ncd BitNet\n\n# 创建 conda 环境\nconda create -n bitnet-cpp python=3.9\nconda activate bitnet-cpp\n\n# 安装 Python 依赖\npip install -r requirements.txt\n```\n\n---\n\n## 下载模型\n\n### 官方推荐模型（BitNet-b1.58-2B-4T）\n\n```bash\n# 使用 huggingface-cli 下载 GGUF 格式\npip install huggingface_hub\nhuggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf \\\n  --local-dir models/BitNet-b1.58-2B-4T\n```\n\n### 其他支持的模型\n\n```bash\n# 较小的 700M 模型（测试用）\nhuggingface-cli download 1bitLLM/bitnet_b1_58-large \\\n  --local-dir models/bitnet_b1_58-large\n\n# 3.3B 模型\nhuggingface-cli download 1bitLLM/bitnet_b1_58-3B \\\n  --local-dir models/bitnet_b1_58-3B\n```\n\n---\n\n## 编译量化环境\n\n```bash\n# 使用本地模型路径（x86 推荐 i2_s，ARM 推荐 tl1）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\n\n# ARM CPU 使用 TL1 内核\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q tl1\n\n# 使用预调优内核参数（可能更快）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s --use-pretuned\n```\n\n编译成功后，会在模型目录生成 `ggml-model-i2_s.gguf` 文件。\n\n---\n\n## 完成确认检查清单\n\n- [ ] `clang --version` 显示 >= 18\n- [ ] `cmake --version` 显示 >= 3.22\n- [ ] `git clone --recursive` 成功（含子模块）\n- [ ] `pip install -r requirements.txt` 无报错\n- [ ] 模型下载完成（几百 MB 到几 GB）\n- [ ] `setup_env.py` 执行成功，生成 `.gguf` 文件\n\n---\n\n## 下一步\n\n- [快速开始](02-quickstart.md) — 运行推理、对话模式、性能测试"},{"path":"guides/02-quickstart.md","content":"# 快速开始\n\n## 适用场景\n\n- 运行 BitNet 模型进行文本生成和对话\n- 使用对话模式进行交互式聊天\n- 测试模型推理性能\n\n---\n\n## 运行基础推理\n\n完成安装后，运行第一个推理：\n\n```bash\n# 确认 conda 环境已激活\nconda activate bitnet-cpp\n\n# 单次文本生成\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"The future of AI is\" \\\n  -n 128\n```\n\n参数说明：\n- `-m`：模型文件路径（`ggml-model-i2_s.gguf`）\n- `-p`：提示词（prompt）\n- `-n`：生成 token 数量（默认 128）\n\n---\n\n## 对话模式（推荐）\n\n使用 `-cnv` 标志进入交互式对话模式，`-p` 变为系统提示：\n\n```bash\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"You are a helpful AI assistant. Answer concisely and accurately.\" \\\n  -cnv\n```\n\n启动后进入交互式提示符，输入问题即可对话：\n```\n> What is machine learning?\nMachine learning is a subset of artificial intelligence that enables systems to learn...\n\n> Explain it like I'm five\nImagine teaching a dog tricks...\n```\n\n按 `Ctrl+C` 退出对话。\n\n---\n\n## 调整推理参数\n\n```bash\n# 增加并发线程数（提高速度）\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"Explain quantum computing\" \\\n  -t 8 \\          # 使用 8 个线程\n  -n 256 \\        # 生成 256 个 token\n  -c 4096         # 上下文窗口大小\n\n# 调整温度（创意度）\npython run_inference.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -p \"Write a poem about the moon\" \\\n  -temp 0.8 \\     # 0.0=确定性，1.0=创意，>1.0=随机\n  -n 200\n```\n\n---\n\n## 性能基准测试\n\n```bash\n# 基础基准（默认：128 token 生成，512 token 提示）\npython e2e_benchmark.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf\n\n# 自定义基准\npython e2e_benchmark.py \\\n  -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n  -n 256 \\        # 生成 256 个 token\n  -p 1024 \\       # 使用 1024 token 的提示\n  -t 4            # 使用 4 个线程\n```\n\n典型输出示例（Apple M2）：\n```\nModel: BitNet-b1.58-2B-4T\nThreads: 4\nPrompt processing: 125 tokens/sec\nToken generation: 18.5 tokens/sec\nTotal time: 8.2s\n```\n\n---\n\n## 不同量化类型对比\n\n```bash\n# 安装 I2_S 量化（x86 推荐）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s\npython run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p \"test\" -n 50\n\n# 安装 TL1 量化（ARM 推荐，如 Apple Silicon）\npython setup_env.py -md models/BitNet-b1.58-2B-4T -q tl1\npython run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-tl1.gguf -p \"test\" -n 50\n```\n\n---\n\n## 使用 Falcon3 模型（已有指令调优）\n\n```bash\n# 下载 Falcon3 指令模型（支持更好的对话能力）\nhuggingface-cli download tiiuae/Falcon3-3B-Instruct-1.58bit-gguf \\\n  --local-dir models/Falcon3-3B-Instruct\n\npython setup_env.py -md models/Falcon3-3B-Instruct -q i2_s\n\n# 对话模式\npython run_inference.py \\\n  -m models/Falcon3-3B-Instruct/ggml-model-i2_s.gguf \\\n  -p \"You are Falcon, a helpful assistant.\" \\\n  -cnv\n```\n\n---\n\n## 完成确认检查清单\n\n- [ ] `run_inference.py` 成功生成文本（非空输出）\n- [ ] 对话模式（`-cnv`）可以持续多轮对话\n- [ ] `e2e_benchmark.py` 输出 tokens/sec 指标\n- [ ] 生成速度基本达到预期（2B 模型 CPU 上应 > 5 tokens/sec）\n\n---\n\n## 下一步\n\n- [高级用法](03-advanced-usage.md) — GPU 推理、多线程优化、更大模型"},{"path":"guides/03-advanced-usage.md","content":"# 高级用法\n\n## GPU 推理\n\nBitNet 官方 GPU 内核（2025 年 5 月发布），支持 CUDA GPU 加速：\n\n```bash\n# 查看 GPU 推理文档\ncat gpu/README.md\n\n# GPU 版本需要 CUDA 环境\n# 参考: https://github.com/microsoft/BitNet/blob/main/gpu/README.md\n```\n\n---\n\n## 多线程性能优化\n\nCPU 线程数对性能影响显著，建议实验找到最优值：\n\n```bash\n# 测试不同线程数的性能\nfor threads in 1 2 4 8; do\n    echo \"=== Threads: $threads ===\"\n    python e2e_benchmark.py \\\n        -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \\\n        -t $threads \\\n        -n 128 \\\n        -p 256\ndone\n```\n\n**经验规则：**\n- 单用户推理：物理核心数的 50-75%\n- 服务化推理：物理核心数的 100%\n- 超线程（HT）对推理加速有限，优先使用物理核心数\n\n---\n\n## 使用嵌入量化（减少内存）\n\n```bash\n# 启用嵌入量化（进一步降低内存使用）\npython setup_env.py \\\n  -md models/BitNet-b1.58-2B-4T \\\n  -q i2_s \\\n  --quant-embd    # 嵌入量化到 f16\n```\n\n---\n\n## 不同模型大小的性能对比\n\n```bash\n# 对比不同大小模型的速度\n# 700M 模型\npython e2e_benchmark.py -m models/bitnet_b1_58-large/ggml-model-i2_s.gguf -t 4\n\n# 2.4B 官方模型\npython e2e_benchmark.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -t 4\n\n# 3.3B 模型（ARM 专用 TL1 内核）\npython e2e_benchmark.py -m models/bitnet_b1_58-3B/ggml-model-tl1.gguf -t 4\n```\n\n典型速度参考（Apple M2）：\n| 模型 | 速度 | 内存 |\n|------|------|------|\n| bitnet_b1_58-large (700M) | ~45 t/s | ~0.5 GB |\n| BitNet-b1.58-2B-4T (2.4B) | ~18 t/s | ~1.2 GB |\n| bitnet_b1_58-3B (3.3B) | ~12 t/s | ~1.8 GB |\n\n---\n\n## 使用预调优内核\n\n预调优内核为特定硬件配置优化了 tile 大小等参数：\n\n```bash\n# 使用预调优参数（通常比默认快 15-100%）\npython setup_env.py \\\n  -md models/BitNet-b1.58-2B-4T \\\n  -q i2_s \\\n  --use-pretuned\n```\n\n---\n\n## 最新优化内核（2026 年 1 月）\n\n新版并行内核实现，带可配置 tiling 和嵌入量化支持：\n\n```bash\n# 查看优化指南\ncat src/README.md\n\n# 该优化在原实现基础上额外提速 1.15-2.1x\n# 无需额外配置，setup_env.py 自动使用最新内核\n```\n\n---\n\n## 内存估算\n\nBitNet 模型的内存使用公式（约）：\n\n| 参数量 | I2_S 量化内存 |\n|--------|--------------|\n| 700M | ~0.5 GB |\n| 2.4B | ~1.5 GB |\n| 3.3B | ~2.0 GB |\n| 8.0B | ~5.0 GB |\n\nBitNet 1.58-bit 量化比传统 FP16（~2 bytes/param）约低 87%，运行 100B 模型仅需约 20 GB 内存。\n\n---\n\n## 批量文本生成（无对话）\n\n```python\n# 通过 Python 脚本批量生成\nimport subprocess\n\nprompts = [\n    \"Translate to French: Hello world\",\n    \"Summarize in one sentence: Machine learning is...\",\n    \"What is the capital of Japan?\",\n]\n\nfor prompt in prompts:\n    result = subprocess.run(\n        [\n            \"python\", \"run_inference.py\",\n            \"-m\", \"models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf\",\n            \"-p\", prompt,\n            \"-n\", \"100\",\n            \"-t\", \"4\",\n        ],\n        capture_output=True, text=True\n    )\n    print(f\"Prompt: {prompt[:50]}...\")\n    print(f\"Output: {result.stdout[:200]}\")\n    print()\n```\n\n---\n\n## 完成确认检查清单\n\n- [ ] 多线程测试找到最优线程数\n- [ ] 预调优内核性能明显提升（可选）\n- [ ] GPU 推理配置成功（如有 NVIDIA GPU）\n- [ ] 嵌入量化降低内存使用（可选）\n\n---\n\n## 相关链接\n\n- [故障排查](../troubleshooting.md)\n- [GPU 推理文档](https://github.com/microsoft/BitNet/blob/main/gpu/README.md)\n- [优化指南](https://github.com/microsoft/BitNet/blob/main/src/README.md)\n- [技术论文](https://arxiv.org/abs/2410.16144)"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度 Skill: Bitnet Owner: cn-big-cabbage Summary: 微软官方 1-bit LLM 推理框架，在 CPU 上运行 1.58-bit 量化大语言模型，速度提升 1.4-6x、能耗降低 55-82%，单 CPU 可运行 100B 参数模型，达到人类阅读速度 Tags: latest:0.1.1 Version history: v0.1.1 | 2026-06-16T10:09:06.774Z | auto - Update to version 0.1.1 - Added _meta.json file for enhanced metadata management - Updated SKILL.md: metadata structure improved (now nested under \"openclaw\" and with \"bins\" requirements) - Remove","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":773,"uniquenessScore":53,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T22:46:25.354Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T22:46:25.354Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-12T16:32:19.140Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}