microsoft/BitNet让大模型在普通电脑上跑得更快、更省电的官方推理工具
BitNet 是微软开源的一套工具,专门用来运行一种叫「1-bit 大模型」的特殊 AI 模型。这类模型把原本又大又重的参数压缩得很小,好处是跑起来更快、更省电,普通电脑的处理器就能带动。它解决的麻烦是:以前想在自己电脑上跑大模型,往往需要昂贵的显卡,又慢又费电。
用法上,它提供针对 CPU 和 GPU 的优化版本(NPU 支持还在路上),官方还放出了 2.4B 参数的大模型和两个更小的嵌入模型,也支持一些社区模型。官方称在 x86 处理器上能比普通精度快 2 到 6 倍多,能耗最多降八成左右,甚至能在单个 CPU 上跑 100B 的大模型,速度接近人阅读的水平。
手头只有普通CPU电脑、没有独立显卡的人,可以用它跑官方2.4B对话模型,进行本地聊天对话。
在意耗电和成本的场景,用它跑1-bit模型,官方称比普通精度模型省电七成以上。
资源有限的设备上,用270M或0.6B的1-bit嵌入模型做文本向量化,速度快、占用内存小。
还没决定要不要自己部署的人,可以先打开官方在线演示,直接体验1-bit模型的推理效果。
案例来自项目官方说明里举的例子和演示,不是本站编的。
用之前要准备:需要自己准备模型文件,并在电脑上编译运行;具体安装方法见官网说明
复制下面的命令,粘进终端(命令行)回车就装好了:
pip install -r requirements.txt 命令原样摘自项目官方说明,本站没有改动。
随便用、随便改,也能用在公司产品里,只要保留原作者的版权声明。
以上是对许可证的通俗解释,不是法律意见;正式商用以官方仓库的 LICENSE 文件为准。
免费。项目采用MIT开源许可,可以自由使用,商用也可以。
不一定。它主打在CPU上跑,普通电脑的CPU就行;想要更快也可以用官方GPU内核。
说明里没有明确列出支持哪些操作系统,只提到x86和ARM两类CPU,建议先看官方文档确认。
说明里没有提到语言支持情况,官方模型主要展示的是英文对话能力,中文效果需要自己试。
在自己电脑上本地运行时,模型和数据都在本机,不会上传;只有用官方在线演示时才走网络。
下面是海外开发者在 Hacker News(国外程序员常去的技术论坛)上讨论这个项目的真实评论,按讨论热度挑选,中文由 AI 翻译,点「看原文」可以对照英文。
The title is misleading — there's no trained 100B model, just an inference framework that claims to handle one. But the engineering is worth paying attention to. I run quantized 70B models locally (M2 Max 96GB, llama.cpp + LiteLLM), and memory bandwidth is always the bottleneck. The 1.58-bit approach is interesting because ternary weights turn matmuls into additions — a fundamentally different compute profile on commodity CPUs. If 5-7 tok/s on a single CPU for 100B-class models is reproducible, that's a real milestone for on-device inference. Framework is ready. Now we need someone to actually train the model.
> bitnet.cpp is 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 will coming next). One bit or one trit? I am confused!
I'm curious if 1-bit params can be compared to 4- or 8-bit params. I imagine that 100B is equivalent to something like a 30B model? I guess only evals can say. Still, being able to run a 30B model at good speed on a CPU would be amazing.
Can anyone help me understand how this works without special bitnet precision-specific hardware? Is special hardware unnecessary? Maybe it just doesn't reach the full bitnet potential without it? Or maybe it does, with some fancy tricks? Thanks!
So Microsoft is actually using 2 bits instead of 1.58. In this case they could represent -1, 0, 1, 2. As inhibitory synapses account for 20%-30%, this could map well to how biological brains are structured. Does that make sense?
数据来自 GitHub,本站每周核对一次,最近核对于 2026-11-22。