Bonsai-27B-GGUF
lmstudio-community · 工具包
面向 LM Studio 的 27B Bonsai 模型 GGUF 转换版,含 3.80 GB 的 Q1_0 语言文件和 0.93 GB 的 BF16 视觉投影器。已测试文本、视觉和并行工具调用。

微软官方的 1 比特大模型推理框架,基于 llama.cpp。它能在 x86 和 ARM CPU 上运行 BitNet b1.58 这类三值模型,也有 GPU 内核。这份说明涵盖 Windows、Linux、GPU 内核和嵌入模型的安装步骤。
bitnet.cpp 1 比特推理框架 是一款 GitHub 上的开源项目,属于开发类,由 Mindket 上架。可免费获取。当前为第 2 版,最近更新于 。按它的 README 从 GitHub 安装。Mindket 的设置说明可在你的 Mindket 账户获取,以 zip 压缩包下载。
git clone --recursive https://github.com/microsoft/BitNet.git cd BitNet conda create -n bitnet-cpp python=3.10
bitnet.cpp is Microsoft’s official inference framework for 1-bit LLMs such as BitNet b1.58. The README says it offers optimized kernels for fast and lossless inference of 1.58-bit models on CPU and GPU, with NPU support coming next. It is based on llama.cpp, and its kernels build on the lookup table methods of T-MAC. You build it from source, download a model from Hugging Face and run it with Python scripts. The README reports speedups of 1.37x to 5.07x on ARM CPUs and 2.37x to 6.17x on x86 CPUs, against full-precision models.
Developers and researchers who want to run a small 1-bit model on a laptop or server CPU with no GPU. People who study low-bit inference also get the kernels and a benchmark script. It is a C++ project with Python scripts, so expect a compiler and a build step. Skip it if you want a finished chat app. The README says it uses existing 1-bit models to demonstrate the framework, and the largest model in its table is 10B.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Local AI | People with a laptop and no GPU | Run the 2B chat model on the CPU with run_inference.py | A reader with an ARM laptop builds the project and chats with BitNet-b1.58-2B-4T in the terminal. |
| Search and RAG | Engineers who embed text | Run the 0.6B or 270M embedding model on an x86 CPU | A team asks llama-embedding for a 1024-dimensional vector for each search query. |
| Performance engineering | Engineers who tune kernels | Change the tiling in gemm-config.h and compare runs with e2e_benchmark.py | An engineer sets the row and column block sizes to fit a CPU’s cache, then reruns the benchmark. |
| Model research | People who work with low-bit models | Convert a safetensors checkpoint to GGUF and test it on a CPU | A researcher downloads the BF16 checkpoint of BitNet-b1.58-2B-4T and converts it with convert-helper-bitnet.py. |
bitnet.cpp is a framework you build and run yourself, so this is about systems rather than coding agents. The README documents no coding-agent integration.
Get it saves a zip of Minda’s setup notes in your downloads folder, with steps for Windows, Linux, the GPU kernel, the embedding models and tuning. They are taken from Microsoft’s README and docs, with Minda’s own notes marked as Minda’s. The main route is a clone, a conda environment, a model download and one build script.
| Need | Detail |
|---|---|
| Python | 3.10 or newer. The README highly recommends a conda environment |
| CMake | 3.22 or newer |
| clang | 18 or newer. On Windows it comes from Visual Studio 2022 with five options turned on. On Debian or Ubuntu the README gives an installation script |
| A model | Downloaded from Hugging Face. The README’s first example uses BitNet-b1.58-2B-4T-gguf |
| For the GPU kernel | An NVIDIA GPU and the CUDA compiler, since the compile script calls nvcc. Neither page lists them |
git clone --recursive https://github.com/microsoft/BitNet.git cd BitNet conda create -n bitnet-cpp python=3.10 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
The README does not list huggingface-cli as a requirement or say how to install it.
Run the model with run_inference.py. With -cnv it starts a chat, and the text after -p becomes the system prompt.
python run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p "You are a helpful assistant" -cnv
The other flags the README lists are -n for the number of tokens to predict, -t for threads, -c for the prompt context size and -temp for the temperature. To measure speed, the README ships a benchmark script.
python utils/e2e_benchmark.py -m /path/to/model -n 200 -p 256 -t 4
You want a vector for a search query. The embedding guide has you check out a llama.cpp branch, run setup_env.py with the 0.6B model, and then call llama-embedding:
cd 3rdparty/llama.cpp && git checkout release-bitnet-embedding-0.6b-270m && cd ../.. python setup_env.py -hr microsoft/bitnet-embedding-0.6b -md /path/to/save/model ./build/bin/llama-embedding \ -m /path/to/save/model/bitnet-embedding-0.6b/ggml-model-i2_s.gguf \ -p "query: What is BitNet?" \ --embd-normalize 2 \ --embd-output-format array
The guide says the result is a 1024-dimensional, L2-normalized embedding, printed as an array that starts [[0.0239517, 0.6826404. The guide’s FAQ says to add an instruction to the query, a one-sentence instruction that describes the task, because that is how the model is trained. Without it you will see a performance degradation. The document side needs no instruction. The guide’s own example passes “query: What is BitNet?”.
新手:A language model keeps what it learned in numbers called weights. A 1-bit model such as BitNet b1.58 limits each weight to -1, 0 or +1, a ternary value, which is where the 1.58 bits come from. Small weights make the model smaller and the arithmetic cheaper, so a CPU can run it. bitnet.cpp is the program that runs such models. The embedding guide says its I2_S conversion needs natively trained BitNet models with ternary weights. Its F16 conversion does not. Start with BitNet-b1.58-2B-4T, the model the README builds first.
专家:The README’s table marks which of three kernels, I2_S, TL1 and TL2, work for each model on x86 and on ARM. I2_S stores ternary weights in 2 bits. The embedding guide packs every 128 values into 32 bytes, four values to a byte, and appends a float32 scale to the buffer. The README’s 15 January 2026 CPU update adds weight-parallel and activation-parallel kernels, native I2_S GEMM and GEMV in ggml, tiling set in include/gemm-config.h, and Q6_K embedding quantization. The CPU page recommends activation parallel for I2_S, and the current kernel defaults to it.
The usage text offers only i2_s and tl1 as --quant-type values, so the README does not say how to choose TL2. It also says bitnet.cpp can run a 100B BitNet b1.58 model on one CPU at 5 to 7 tokens per second, yet no model that size is in its table. Check what that claim rests on before you plan around it.
Most of it runs on your machine, and a few paths reach out.
这个工具包里只有安装说明,由 Mindket 编写。bitnet.cpp 要从微软的仓库编译和运行,地址是 https://github.com/microsoft/BitNet
这些说明不是微软写的,也没有得到微软的认可。README 称 bitnet.cpp 是“the official inference framework for 1-bit LLMs (e.g., BitNet b1.58)”,意思是:1 比特大模型(比如 BitNet b1.58)的官方推理框架。它“offers a suite of optimized kernels that support fast and lossless inference of 1.58-bit models on CPU and GPU (NPU support coming next).”,意思是:提供一套优化过的内核,支持在 CPU 和 GPU 上快速、无损地推理 1.58 比特模型,NPU 支持即将推出。
许可证:MIT。LICENSE 文件(https://github.com/microsoft/BitNet/blob/main/LICENSE )是 MIT 许可证,写着“Copyright (c) Microsoft Corporation.”。README 说这个项目基于 llama.cpp 框架,它的内核建立在 T-MAC(https://github.com/microsoft/T-MAC/ )的查表方法之上。
--recursive 克隆,会把 llama.cpp 代码一并拉到 3rdparty/llama.cpp 下。仓库的 .gitmodules 文件写明来源是 GitHub 上的一个 llama.cpp 分叉(https://github.com/isHuangXin/llama.cpp.git)。来源见 https://github.com/microsoft/BitNet/blob/main/README.md 和 https://github.com/microsoft/BitNet/blob/main/.gitmodulesrequirements.txt 里的 Python 包,它会把 llama.cpp 自己给转换脚本用的依赖文件一起装上。setup_env.py 做出的一份编译产物,以及你另外下载的模型。README 的例子把模型放在克隆文件夹里的 models/。CPU 优化页面和嵌入模型指南从 build/bin/ 运行编译出的工具。run_inference.py,和测速度的脚本 utils/e2e_benchmark.py。bitnet.cpp 是框架,模型是从 Hugging Face 另外下载的。README 说它用现有的 1 比特模型来展示 bitnet.cpp 能做什么,并希望这次发布能推动更大规模的 1 比特大模型,在模型大小和训练词元数上都更大。
nvcc。见 setup/gpu.md。在能用 clang 的 shell 里运行。每条命令都抄自 README 的 Installation、Build from source 和 Usage 部分:https://github.com/microsoft/BitNet/blob/main/README.md
git clone --recursive https://github.com/microsoft/BitNet.git
cd BitNet
conda create -n bitnet-cpp python=3.10
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
README 没有把 huggingface-cli 列为需求,也没有说怎么安装它。
setup_env.py 和 run_inference.py 的选项README 和文档都没有给出更新或卸载步骤。要移除它(这是 Mindket 的说明,不是微软的),就删掉克隆的文件夹和它的模型文件夹,再用 conda 自己的移除命令删掉 conda 环境。
README 和文档都没有提到遥测或使用数据,也没有说程序在运行模型时会连到服务器。下面这些步骤会连到外面:git clone --recursive、从 Hugging Face 下载、pip 安装,以及在 Debian 或 Ubuntu 上从 apt.llvm.org 下载 clang 脚本。README 里链接的在线演示是一个单独托管的页面,不属于安装的一部分。
README.md 5 KB setup/embeddings.md 4 KB setup/gpu.md 3 KB setup/linux.md 2 KB setup/models-and-kernels.md 5 KB setup/tune-and-benchmark.md 4 KB setup/windows.md 3 KB
Updated by Mindket to the current version of this kit.
Hacker News、Bluesky、X、Reddit、Facebook 和 YouTube 上提到这个项目的帖子和评论,来自每周一次的搜索和 Trendshift。它们不是 Mindket 写的,也未经核实,点开即可在原帖处阅读。
lmstudio-community · 工具包
面向 LM Studio 的 27B Bonsai 模型 GGUF 转换版,含 3.80 GB 的 Q1_0 语言文件和 0.93 GB 的 BF16 视觉投影器。已测试文本、视觉和并行工具调用。
LibertAIDAI · 工具包
以每权重 2.9 位的 EXL3 量化运行 DeepSeek-V4.1-Flash-1017,这是一份 196 GiB 的副本,适合在自己硬件上部署大模型的人。困惑度与原模型相差不大。
facebook · 工具包
根据文字描述或音频提示生成短音乐片段,是 facebook MusicGen 的 small 检查点。适合想在自己电脑上试用文字生成音乐的开发者和音乐爱好者。
alpindale · 工具包
用一个只有约 984 个权重的小型神经网络,为 C 源代码的每个字符打上语法高亮标签,通过一个小小的 C 程序运行。适合对手工设计的网络好奇的开发者和研究者。
prithivMLmods · 工具包
在浏览器或你自己的电脑上,用一个 Gradio 应用试用 FLUX.2 Klein 图像模型的一组 LoRA。适合制作或测试 AI 图片的人。
Sokheng · 工具包
这个模型从文档、收据和路牌照片里读取高棉语和英语文字,用一个检测器找文本行,再用识别器读每一行。适合需要在 Python 里做高棉语 OCR 的开发者。