You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I shrank the model by another ~11% down to 765MiB by quantizing the doublestream modulation to q8_0.
866MiB
765MiB
I really wish they would add the 128 block size ternary quant support to ggml though, as the binary model really is skirting the bottom end of possible compression. (ggml ternary quants tq1_0 and tq2_0 use a 256 block size)
Nice this is exciting. Yeah I am trying to add Q2_0 for ternary for llama.cpp they wanted group size 64 so need to make some changes in our side. Probably need to keep the group size 128 version in our fork.
Let me know if can help in any other way too
We have Q2_0 with group 128 in our llama.cpo fork that supports ternary but it's 2 bit I guess.
Activity
kevinlaw91 commentedon May 26, 2026
Green-Sky commentedon May 26, 2026
iirc bonsai's ternary is different to what ggml offers.
However,
q1_0is supported by ggml.https://huggingface.co/prism-ml/bonsai-image-binary-4B-unpacked should be quantizable.
All
*transformer_blocks.*.weightshould beq1_0.Arch looks to be flux klein 4B, so maybe this is just a question of quantizing it.
Green-Sky commentedon May 26, 2026
Hmm.
edit: someone else has to convert this model from diffusers, I'm no expert in model surgery.
diimdeep commentedon May 27, 2026
bonsai so far is just quantized qwen/flux packaged as a branded binary/ternary models and somehow novel, but they are not, not worth imho
Green-Sky commentedon May 27, 2026
Did some model surgery and its mostly there, but not sure where the last issue(s) are.
script
Maybe someone can spot the error.
I tested quantizing some of the layers they used to
q1_0and the result is identical, which means its working.edit: sd.cpp quantization command that should cover all q1_0
result/bin/sd-cli -M convert -m bonsai-image-unpacked.safetensors -o bonsai_image_4b-q1_0.gguf --tensor-type-rules "^single_blocks.[0-9]+.linear1.weight=q1_0,^single_blocks.[0-9]+.linear2.weight=q1_0,^double_blocks.[0-9]+.img_attn.qkv.weight=q1_0,^double_blocks.[0-9]+.img_attn.proj.weight=q1_0,^double_blocks.[0-9]+.txt_attn.qkv.weight=q1_0,^double_blocks.[0-9]+.txt_attn.proj.weight=q1_0,^double_blocks.[0-9]+.img_mlp.[0-9].weight=q1_0,^double_blocks.[0-9]+.txt_mlp.[0-9].weight=q1_0" --convert-nameedit: uploaded the broken files here https://huggingface.co/Green-Sky/bonsai-image-binary-4B-GGUF/tree/main/broken
edit: llm suggested a fix and it now works. uploading to https://huggingface.co/Green-Sky/bonsai-image-binary-4B-GGUF/tree/main/
Green-Sky commentedon May 27, 2026
They did QAT during a finetuning step, since low bit quants are way too rough. But yea, it is "just" flux 2 klein 4b.
sandeshrajbhandari commentedon May 29, 2026
@Green-Sky Can you shrae the command you used to run this?
Green-Sky commentedon May 29, 2026
I posted them above. Also the hf repo contains them too.
The image command is based on the example prompt in the klein 4b sd.cpp docs.
Green-Sky commentedon Jun 1, 2026
I shrank the model by another ~11% down to 765MiB by quantizing the doublestream modulation to q8_0.
I really wish they would add the 128 block size ternary quant support to ggml though, as the binary model really is skirting the bottom end of possible compression. (ggml ternary quants tq1_0 and tq2_0 use a 256 block size)
Green-Sky commentedon Jun 1, 2026
@khosravipasha q1_0 working well. 😉
khosravipasha commentedon Jun 1, 2026
Nice this is exciting. Yeah I am trying to add Q2_0 for ternary for llama.cpp they wanted group size 64 so need to make some changes in our side. Probably need to keep the group size 128 version in our fork.
Let me know if can help in any other way too
We have Q2_0 with group 128 in our llama.cpo fork that supports ternary but it's 2 bit I guess.
Green-Sky commentedon Jul 30, 2026
@leejet ggml just got updated with q2_0 cuda support, plus general q2_0 since last time the sub was updated.