Views
No views yet
google/gemma-3-4b-it (bf16, multimodal, 8.1 GB)
│
├─ 1. STRIP VISION ── vision_tower + multi_modal_projector removed;
│ language model extracted into a standalone
│ Gemma3ForCausalLM checkpoint
▼
text-only bf16
│
├─ 2. QUANTIZE ───── GPTQ W4A16, group size 128, symmetric,
│ 512 calibration samples, lm_head left in bf16
▼
text-only INT4 (2.8 GB)Gemma3ForCausalLM and not a Gemma3ForConditionalGeneration:
smaller download, smaller resident footprint, and no multimodal code paths at load time. It also
sidesteps a practical problem — the SigLIP vision encoder has layers whose dimensions are not
divisible by the quantization group size, so quantizers either error out or have to special-case
them.Note on the base model. This is built from the standardgemma-3-4b-itbf16 weights (obtained via the unsloth mirror). It is not derived from Google's QAT (quantization-aware training) release. If you need QAT-grade INT4 quality, start fromgoogle/gemma-3-4b-it-qat-int4-unquantizedinstead.
| Size on disk | 2.8 GB (from 8.1 GB bf16) |
| Weights in GPU | ~3.4 GB |
| Architecture | Gemma3ForCausalLM (text-only) |
| Quantization | GPTQ, W4A16, group size 128, symmetric |
| Not quantized | lm_head |
| Verified on | vLLM 0.26.0, torch 2.11.0+cu130, driver 580, RTX A4000 |
gemma-3-4b-it checkpoints were awkward to serve on current vLLM:<pad> tokens for Gemma 3 in our testing."Paris, it is the the is is the is is is...") on vLLM 0.26.0 in our testing, i.e. the
AWQ + Gemma 3 path was not usable for us.compressed-tensors / GPTQ instead and produced coherent output in every
check we ran. Your mileage on other engines may differ — see Scope of testing below.1vllm serve <this-repo> \
2 --served-model-name gemma-3-4b-it \
3 --max-model-len 4096 \
4 --gpu-memory-utilization 0.901from vllm import LLM, SamplingParams
2
3llm = LLM(model="<this-repo>", max_model_len=4096)
4out = llm.chat(
5 [{"role": "user", "content": "Explain gravity in two sentences."}],
6 SamplingParams(max_tokens=256, temperature=0.3),
7)
8print(out[0].outputs[0].text)--max-model-len 4096,
--gpu-memory-utilization 0.90, chat endpoint, short prompts, 128 output tokens per request,
measured client-side on localhost:| Concurrent requests | Aggregate throughput |
|---|---|
| 8 | ~276 tok/s |
| 1024 | ~3000 tok/s |
| 2048 | ~3432 tok/s |
| 3072 | ~3559 tok/s |
gemma-3-4b-it in bf16 and extracted the language model into a standalone
Gemma3ForCausalLM, dropping vision_tower and multi_modal_projector.1from llmcompressor import oneshot
2from llmcompressor.modifiers.quantization import GPTQModifier
3
4recipe = GPTQModifier(targets="Linear", scheme="W4A16", ignore=["lm_head"])
5oneshot(
6 model=model, processor=tokenizer, dataset=ds,
7 recipe=recipe, max_seq_length=2048, num_calibration_samples=512,
8)HuggingFaceH4/ultrachat_200k (train_sft), chat template applied,
max sequence length 2048. Group size 128, symmetric, static activation ordering,
dampening fraction 0.01.