Bonsai-27B-GGUF
lmstudio-community · Kit
A GGUF conversion of the 27B Bonsai model for LM Studio, with a 3.80 GB Q1_0 language file and a 0.93 GB BF16 vision projector. Tested for text, vision and par…

Microsoft’s official inference framework for 1-bit LLMs, built on llama.cpp. It runs ternary models such as BitNet b1.58 on x86 and ARM CPUs, and has a GPU kernel too. The setup notes cover Windows, Linux, the GPU kernel and the embedding models.
bitnet.cpp is an open-source project on GitHub in the Developer category, listed by Mindket. It is free. This is version 2, last updated on . Install it from GitHub as its README says. Get Mindket’s setup notes on your Mindket account, as a 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?”.
If you are new. 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.
For experts. 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.
This kit holds setup notes only. Mindket wrote them. bitnet.cpp is built and run from Microsoft's repository: https://github.com/microsoft/BitNet
These notes are not made or endorsed by Microsoft. The README calls bitnet.cpp "the official inference framework for 1-bit LLMs (e.g., BitNet b1.58)". It "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)."
License: MIT. The LICENSE file (https://github.com/microsoft/BitNet/blob/main/LICENSE) is the MIT License and reads "Copyright (c) Microsoft Corporation." The README says the project is based on the llama.cpp framework, and that its kernels build on the Lookup Table methods of T-MAC (https://github.com/microsoft/T-MAC/).
--recursive, which also fetches the llama.cpp code under 3rdparty/llama.cpp. The repository's .gitmodules file names a llama.cpp fork on GitHub as the source (https://github.com/isHuangXin/llama.cpp.git). Sources: https://github.com/microsoft/BitNet/blob/main/README.md and https://github.com/microsoft/BitNet/blob/main/.gitmodulesrequirements.txt, which pulls in llama.cpp's own requirement files for its conversion scripts.setup_env.py, and a model you download separately. The README's examples put the model in models/, inside the clone. The CPU optimization page and the embedding guide run the built tools from build/bin/.run_inference.py, and to measure speed, utils/e2e_benchmark.py.bitnet.cpp is the framework. The models are separate downloads from Hugging Face. The README says it uses existing 1-bit models to show what bitnet.cpp can do, and hopes the release will inspire 1-bit LLMs at larger scale in model size and training tokens.
nvcc. See setup/gpu.md.Run them in a shell where clang works. Every command is copied from the README, Installation, Build from source and 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
The README does not list huggingface-cli as a requirement or say how to install it.
setup_env.py and run_inference.pyThe README and the docs give no update or uninstall steps. To take it out (Mindket's note, not Microsoft's), delete the clone and its model folder, and remove the conda environment with conda's own remove command.
The README and the docs say nothing about telemetry or usage data. Nothing in them says the program connects to a server while it runs a model. These steps do reach out: git clone --recursive, the Hugging Face download, the pip installs, and on Debian or Ubuntu the clang script from apt.llvm.org. The online demo linked from the README is a separate hosted page and is not part of the install.
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.
Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.
lmstudio-community · Kit
A GGUF conversion of the 27B Bonsai model for LM Studio, with a 3.80 GB Q1_0 language file and a 0.93 GB BF16 vision projector. Tested for text, vision and par…
LibertAIDAI · Kit
Runs DeepSeek-V4.1-Flash-1017 as a 2.9 bits-per-weight EXL3 quantization, a 196 GiB copy for people serving large models on their own hardware. Perplexity stay…
facebook · Kit
Generates short music clips from a text description or an audio prompt, in the small checkpoint of facebook's MusicGen. It suits developers and music hobbyists…
alpindale · Kit
Tags every character of C source code for syntax highlighting with a tiny neural network of about 984 weights, run through a small C program. For developers an…
prithivMLmods · Kit
Try a set of LoRAs for the FLUX.2 Klein image model in a Gradio app that runs in your browser or on your own computer. Made for people who make or test AI imag…
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…