Instructions to use inflaton/gemma4-31b-qat-text-only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use inflaton/gemma4-31b-qat-text-only with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf inflaton/gemma4-31b-qat-text-only # Run inference directly in the terminal: llama cli -hf inflaton/gemma4-31b-qat-text-only
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf inflaton/gemma4-31b-qat-text-only # Run inference directly in the terminal: llama cli -hf inflaton/gemma4-31b-qat-text-only
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf inflaton/gemma4-31b-qat-text-only # Run inference directly in the terminal: ./llama-cli -hf inflaton/gemma4-31b-qat-text-only
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf inflaton/gemma4-31b-qat-text-only # Run inference directly in the terminal: ./build/bin/llama-cli -hf inflaton/gemma4-31b-qat-text-only
Use Docker
docker model run hf.co/inflaton/gemma4-31b-qat-text-only
- LM Studio
- Jan
- vLLM
How to use inflaton/gemma4-31b-qat-text-only with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inflaton/gemma4-31b-qat-text-only" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inflaton/gemma4-31b-qat-text-only", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inflaton/gemma4-31b-qat-text-only
- Ollama
How to use inflaton/gemma4-31b-qat-text-only with Ollama:
ollama run hf.co/inflaton/gemma4-31b-qat-text-only
- Unsloth Desktop
- Pi
How to use inflaton/gemma4-31b-qat-text-only with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf inflaton/gemma4-31b-qat-text-only
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "inflaton/gemma4-31b-qat-text-only" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use inflaton/gemma4-31b-qat-text-only with Docker Model Runner:
docker model run hf.co/inflaton/gemma4-31b-qat-text-only
- Lemonade
How to use inflaton/gemma4-31b-qat-text-only with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull inflaton/gemma4-31b-qat-text-only
Run and chat with the model
lemonade run user.gemma4-31b-qat-text-only-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use inflaton/gemma4-31b-qat-text-only with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf inflaton/gemma4-31b-qat-text-only
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default inflaton/gemma4-31b-qat-text-only
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use inflaton/gemma4-31b-qat-text-only with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf inflaton/gemma4-31b-qat-text-only
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "inflaton/gemma4-31b-qat-text-only" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Gemma 4 31B IT QAT — text-only bf16 GGUF
A single-file bf16 GGUF of the language model only from Google's Gemma 4 31B
instruction-tuned quantization-aware-trained (QAT) checkpoint. The vision and audio
towers are removed and the tensors are laid out as a standalone 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 |
Why this exists
The Gemma 4 omni releases ship as a 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.
How it was made
Source checkpoint:
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.Text-only extraction with
extract_gemma4_text.py, included in this repo (uses Apple-silicon MLX): keeps onlylanguage_model.*tensors, renameslanguage_model.model.X → model.X, rewritesconfig.jsonfromtext_configwitharchitectures = ["Gemma4ForCausalLM"](carrying overeos_token_idandtransformers_version), copiestokenizer.json,tokenizer_config.json,generation_config.json, andchat_template.jinja, and rebuildsmodel.safetensors.index.jsonfor the surviving tensors.GGUF conversion with a current llama.cpp checkout (older packaged builds may lack the converter or Gemma 4 support):
python convert_hf_to_gguf.py <text_only_dir> \ --outfile gemma4-31b-qat-text-only.gguf --outtype bf16
Usage
The main intended use is q4_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:
printf 'FROM ./gemma4-31b-qat-text-only.gguf\n' > Modelfile
ollama create gemma4:31b-it-qat-text-only -f Modelfile --quantize q4_K_M
ollama run gemma4:31b-it-qat-text-only
Or run directly with llama.cpp (bf16 needs ~62 GB of memory; quantize first for less):
llama-cli -m gemma4-31b-qat-text-only.gguf -p "Hello"
Caveats
- Text in, text out only. The vision and audio towers are not included; multimodal prompts will not work. Use the official omni releases for that.
- Not bit-identical to the official QAT GGUF. This file is converted from the
bf16 QAT weights along a different path than Google's official
it-qatGGUF 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. - Gemma 4 is released under Apache 2.0; this derivative carries the same license.
- Downloads last month
- 281
We're not able to determine the quantization variants.
Model tree for inflaton/gemma4-31b-qat-text-only
Base model
mlx-community/gemma-4-31B-it-qat-bf16