Downloads · 30 days
221
44% of all-time downloads
TheDrainFlorist/gemma-4-e4b-it-VQ-PLE
gemma-4-e4b-it-VQ-PLE is a image-text-to-text model from TheDrainFlorist. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for mlx. The card lists the license as gemma.
Downloads · 30 days
221
44% of all-time downloads
All-time downloads
507
Public
Parameters
5.7B
8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors7.9 GB · 100%
How the weights are stored.
U325.1B · 90%
From the Hugging Face model README

7.39 GiB — the community 8-bit, with a better embedding table. This is
mlx-community's gemma-4-e4b-it-8bit with exactly one change: the 5.25 GiB
per-layer-embedding table (35% of the model's bytes) is replaced by a
vector-quantized version at 5.75 bits/weight. Everything else — attention,
MLPs, norms, towers — is byte-identical to the artifact you already know.
That one swap makes the model measurably closer to bf16 than the 8-bit it came from, at 1 GiB less disk, ≈1 GB less peak RAM, and decode speed at parity.
The bundled model.py is updated to the current VQ runtime; the weights are unchanged. The run, multi-Mac and vision instructions now use Knurlogic.
Runtime refresh. The bundled model.py is updated so downloaders run
exactly the code that was benchmarked; dense bundles now carry both runtimes.
mtp-head-q6.safetensors, the sidecar works with the exo fork branch
mtp-stage1 (github.com/noahzelezny/exo) — launch each node with
exo --mtp (or set EXO_MTP=1). Note: with MTP enabled, exo serves
requests sequentially (the batch engine has no MTP path), so leave it
off for concurrent / multi-agent workloads.Bundle repair — this model was broken for downloaders until today.
Two stacked defects, both ours, both fixed:
model.py was incomplete (it imported runtime modules
that only existed in our development environment), so on a stock
install the model could not load at all. Repairing that exposed:No published score was ever affected — scoring ran through the correct decode path; only the bundled runtime was broken. The bundle is now self-contained, gated by a load-and-generate check in a verified-clean environment, and generates coherently at length on both M3- and M4-class machines.
Peak memory, measured externally: process RSS sampled at 5 Hz across load + 2048-token prefill + 128-token decode peaks at 7.5 GiB — the on-disk size. Peak ≈ resident.
All numbers on the same instruments, same corpus, same teacher cache; "incumbent" = mlx-community gemma-4-e4b-it-8bit as shipped.
| this artifact | incumbent 8-bit | |
|---|---|---|
| size on disk | 7.39 GiB | 8.38 GiB |
| KL to bf16 (literary corpus) | 7.451 mnats/token | 8.149 mnats/token |
| top-1 agreement with bf16 | 95.70% | 95.70% |
| litbench (cyclic, generative, n=104) | 81.73% | 84.62% |
| — paired McNemar | 7 discordant items, 5–2, p=0.45 — statistically indistinguishable | |
| decode | 89.3 tok/s | 89.3 tok/s |
| prompt processing (2k prompt) | 3570 tok/s | 3499 tok/s |
| peak memory (short chat) | 7.1 GB | 8.0 GB |
Runtime rows measured 2026-09 on an M3 Ultra (mlx 0.32.2, 256-token greedy decode, repeated runs within 0.6%). The 2026-09 bundle's kernel refresh closed what used to be an ≈8% decode deficit against the 8-bit.
Honest summary: closer to the bf16 teacher on the precise instrument (KL), indistinguishable on the noisy one (litbench, n=104 cannot resolve a 3-point gap — SE ±3.7), decode at parity, ≈12% less RAM, 1 GiB less disk. There is no axis left on which the 8-bit is the better download.
Measured 2026-10-01 on this revision.
One Mac Studio M3 Ultra, vqlab speed-pair: a fresh process per run,
alternating with the reference, 3 pairs, 2048-token prompt, 128 generated
tokens, no drafting.
| this model | gemma-4-e4b-it-8bit | |
|---|---|---|
| decode | 83.0 tok/s (1.00×) | 83.4 tok/s |
| prefill | 3633 tok/s (1.05×) | 3562 tok/s |
| peak memory | 7.8 GB | 8.8 GB |
Throughput differs across Apple silicon; compare the ratio, not the absolute numbers.
Requires a Mac with Apple Silicon (macOS, MLX).
With Knurlogic, which works out the settings and checks the model fits before loading it:
pip install knurlogic
hf download TheDrainFlorist/gemma-4-e4b-it-VQ-PLE --local-dir ~/Knurlogic/Models/gemma-4-e4b-it-VQ-PLE
knurlogic serve ~/Knurlogic/Models/gemma-4-e4b-it-VQ-PLE
Chat at http://127.0.0.1:8080/, or point any OpenAI-, Anthropic- or
Ollama-compatible client at it (model local). knurlogic ui opens a page
with a Launch button for every model on disk instead.
Images work through Knurlogic directly; mlx-vlm is not needed.
The VQ runtime ships inside this repo as model.py (declared by
model_file in config.json), and Knurlogic runs the file the model ships.
Without Knurlogic:
pip install 'mlx-lm>=0.31.3'
mlx_lm.chat --model TheDrainFlorist/gemma-4-e4b-it-VQ-PLE
We first vector-quantized everything (MLPs + embeddings) and LOST to the 8-bit decisively (20.8 vs 8.1 mnats): e4b's MLP weights do not tolerate 5.75-bit VQ even though their reconstruction error looks excellent — fit error and output damage are different quantities. An ablation split the damage: the MLP contributed essentially all of it, and the VQ embedding table alone was better than its 8-bit affine counterpart. So this artifact keeps the 8-bit MLPs and ships only the swap that wins.
Embeddings are the friendly case for VQ at runtime too: a lookup decodes only the rows a batch touches — no matmul kernel, no full-table materialization, which is where the RAM saving comes from.
The VQ fit is pure weight-space k-means against the bf16 tensors: no calibration corpus, no forward passes, no distillation. 154 seconds of codebook fitting on an M3 Ultra. Every number above was measured after, not optimized for.
Fitted data-free from the bf16 checkpoint — k-means / Lloyd over weight subvectors, seed 1234, no Hessian, no activation statistics, no calibration corpus. Recipes are in the VQLab repo.
Only the per-layer-embedding table is replaced; every other tensor is carried over from the 8-bit conversion unchanged. See Why the embedding table above for why that is the high-leverage target.
The method, the full model ladder, the negative results, and the measurement rules behind every number here: Data-Free Vector Quantization Beats Affine Quantization at Matched Bytes Below 6 Bits (CC BY 4.0) · code: VQLab · web version: Space
VQLab and these artifacts are built and released independently — the fits, the measurement harness and the published rungs are one person's compute and time. If they are useful to you:
Base model: google/gemma-4-e4b-it — governed by the Gemma Terms of Use. This is a quantized derivative and inherits that license; using it means accepting the base model's terms. Quantization: TheDrainFlorist, 2026.
This build starts from mlx-community/gemma-4-e4b-it-8bit and replaces its per-layer-embedding table; that conversion's authors are credited accordingly.
Built with MLX and VQLab.