Views
No views yet
Gemma4ForCausalLM,
so standard GGUF tooling (llama.cpp, Ollama, LM Studio, …) can load it directly — and,
more importantly, re-quantize it (e.g. ollama create --quantize q4_K_M).| File | Contents | Size |
|---|---|---|
gemma4-31b-qat-text-only.gguf | text-only LM, bf16 | ~61 GB |
Gemma4ForConditionalGeneration checkpoint with the
language model nested under a language_model.* prefix beside vision/audio towers.
ollama create --quantize cannot convert that layout — its bundled converter does not
split the language model out the way the official gemma4:31b-it-qat release does
(LM GGUF + separate mmproj GGUF), so conversion fails to find token_embd.weight and the
resulting tag does not load. This repo publishes the working intermediate: a clean,
text-only bf16 GGUF you can quantize to any scheme llama.cpp supports.mlx-community/gemma-4-31B-it-qat-bf16 —
the quantization-aware-trained weights in bf16, as the full omni checkpoint.
No dequantization round trip is involved.extract_gemma4_text.py,
included in this repo (uses Apple-silicon MLX): keeps only language_model.* tensors,
renames language_model.model.X → model.X, rewrites config.json from
text_config with architectures = ["Gemma4ForCausalLM"] (carrying over
eos_token_id and transformers_version), copies tokenizer.json,
tokenizer_config.json, generation_config.json, and chat_template.jinja,
and rebuilds model.safetensors.index.json for the surviving tensors.1python convert_hf_to_gguf.py <text_only_dir> \
2 --outfile gemma4-31b-qat-text-only.gguf --outtype bf16q4_K_M re-quantization, motivated by
Huang & Wang (IJCNN 2025),
LLMs at the Edge: Performance and Efficiency Evaluation with Ollama on Diverse
Hardware, which found q4_K_M builds matching or exceeding bf16 task performance
for open-weight models served through Ollama:1printf 'FROM ./gemma4-31b-qat-text-only.gguf\n' > Modelfile
2ollama create gemma4:31b-it-qat-text-only -f Modelfile --quantize q4_K_M
3ollama run gemma4:31b-it-qat-text-onlyllama-cli -m gemma4-31b-qat-text-only.gguf -p "Hello"it-qat GGUF
artifact. In our evaluations a q4_K_M re-quant of this file scored within noise
of the vendor QAT artifact on our task, but no equivalence is claimed.