Instructions to use mattbucci/gemma-4-12B-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- vLLM
How to use mattbucci/gemma-4-12B-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mattbucci/gemma-4-12B-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mattbucci/gemma-4-12B-AWQ", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/mattbucci/gemma-4-12B-AWQ
- SGLang
How to use mattbucci/gemma-4-12B-AWQ with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mattbucci/gemma-4-12B-AWQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mattbucci/gemma-4-12B-AWQ", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mattbucci/gemma-4-12B-AWQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mattbucci/gemma-4-12B-AWQ", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use mattbucci/gemma-4-12B-AWQ with Docker Model Runner:
docker model run hf.co/mattbucci/gemma-4-12B-AWQ
gemma-4-12B-it AWQ (int4, W4A16)
In-house AWQ-Marlin (4-bit) quantization of google/gemma-4-12B-it — the encoder-free omni Gemma 4 (Gemma4UnifiedForConditionalGeneration): text + reasoning + tool-use + vision + audio, global-MQA attention, 5:1 sliding:full, ~262K native context.
How it was built
Packed data-free from the QAT base google/gemma-4-12B-it-qat-q4_0-unquantized (Gemma's quantization-aware-trained release). Because QAT already conditions the weights onto a 4-bit grid, a plain RTN re-quantization to AWQ group-128 is near-lossless — no calibration corpus needed:
- Text-decoder linears (q/k/v/o_proj, mlp gate/up/down_proj) → AWQ int4, group_size 128.
- Vision/audio embedders + all norms + tied
lm_headkept BF16 (modality preservation). - Quantization fidelity vs the QAT base: MLP layers cosine 1.0000, attention projections 0.993–0.996.
Quality (2x RTX 3090, SGLang v0.5.12, TP=2)
| MMLU | HumanEval | Needle@long-ctx | 256K tool-use | Vision | Thinking |
|---|---|---|---|---|---|
| 80% | 95% | 100% | 100% (→95K) | ✓ | clean |
Weights are 5.4 GB/rank at int4. Identical text quality to the BF16 base at matched context length.
Serving (SGLang)
This is the encoder-free unified Gemma 4 arch (gemma4_unified, a transformers-5.10.dev architecture). Serving on SGLang needs the back-port patches 042–048 from 2x-3090-GA102-300-A1-sglang-inference (loader + vendored config/processor + the hybrid-SWA TP>1 KV-pool routing fix + the processor __call__ image-token expansion). On Ampere (sm_86), use --attention-backend triton (FlashInfer rejects the 512-dim global head) and --disable-cuda-graph.
License
Governed by the Gemma Terms of Use. Derived from google/gemma-4-12B-it.
- Downloads last month
- 27,369