Bonsai-8B — AWQ 4-bit
Summary
This repo provides an AWQ 4-bit checkpoint so you can run Bonsai-8B on sglang (or vLLM) until native 1-bit support lands in those engines. The repack from 1-bit to AWQ 4-bit is lossless. Both formats use group size 128, and Bonsai's binary weights (±d) fit exactly inside AWQ INT4 by an exact conversion formula.
For the best Bonsai experience on edge or consumer-grade hardware, use the native 1-bit releases. The 1-bit format is where Bonsai's memory and energy wins come from.
How It Works
Bonsai weights are ±d (binary) with a shared scale across a group size of 128. INT4 can represent these values exactly. Embedding and lm_head stay FP16 due to sglang limitations.
AWQ INT4 dequantization: weight = scale × (int4 − zero).
Serve
Use
Multi-GPU (8× H100)
Appendix
Launch time
With pre-built sgl-kernel wheels: 15 s. First launch on an arch without pre-built wheels (e.g. L40S / sm_89) takes 3–5 min while sglang JIT-compiles Marlin GEMM + FlashInfer kernels; artifacts cache to ~/.cache/tvm-ffi/ and ~/.cache/flashinfer/, so subsequent launches drop back to 15 s.
Known-good environment
Example of successful end-to-end serving environment:
sglang[all] == 0.5.9
torch == 2.9.1, transformers == 4.57.1, triton == 3.5.1
ninja == 1.13 on PATH
nvcc from CUDA 12.8 first on PATH (sglang's JIT Marlin needs -std=c++20; CUDA 11.x will fail)
- Python 3.12