Downloads · 30 days
493
4% of all-time downloads
infil00p/shieldgemma-2-4b-it-GGUF
shieldgemma-2-4b-it-GGUF is a image classification model from infil00p. Use it when you need a label for an image. It is set up for gguf. The card lists the license as gemma.
This repository contains GGUF format conversions of google/shieldgemma-2-4b-it for use with llama.cpp and compatible inference engines.
Downloads · 30 days
493
4% of all-time downloads
All-time downloads
12K
Public
Repo size
21 GB
Likes
2
Public
Click a slice to open those files.
.gguf21 GB · 100%
From the Hugging Face model README
This repository contains GGUF format conversions of google/shieldgemma-2-4b-it for use with llama.cpp and compatible inference engines.
ShieldGemma 2 is a 4 billion parameter multimodal model built on Gemma 3 for image safety classification. It evaluates images against safety policies to detect:
This model takes images and text prompts as input and outputs safety classifications.
Both files are required for inference.
# Build llama.cpp with multimodal support
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
cmake -B build
cmake --build build --target llama-mtmd-cli
# Run inference
./build/bin/llama-mtmd-cli \
-m shieldgemma-2-4b-it.gguf \
--mmproj mmproj-shieldgemma-2-4b-it-F16.gguf \
--image <your_image.jpg> \
-p "You are a policy expert trying to help determine whether a generated or real image is in violation of the safety policy
below. Your decision must very clearly follow the specific language used in the safety policy and should not include
any interpretation outside of the safety policy.
<BEGIN_SAFETY_POLICY>
No Adult Material
</END_SAFETY_POLICY>
Does the image violate the above policy? Your Answer must start with with 'Yes' or 'No'." \
-n 50 \
--temp 0.1
The model will output "Yes" or "No" based on whether the image violates the specified policy.
These are F16 (16-bit floating point) conversions of the original model:
ShieldGemma 2 is intended to be used as a safety content moderator for:
Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms
This model is a derivative work (GGUF format conversion) of the original ShieldGemma 2 model and is subject to:
When using or redistributing this model:
This model must not be used for:
See the full Prohibited Use Policy for details.
Original Model:
@misc{zeng2025shieldgemma2robusttractable,
title={ShieldGemma 2: Robust and Tractable Image Content Moderation},
author={Wenjun Zeng and Dana Kurniawan and Ryan Mullins and Yuchi Liu and Tamoghna Saha and Dirichi Ike-Njoku and Jindong Gu and Yiwen Song and Cai Xu and Jingjing Zhou and Aparna Joshi and Shravan Dheep and Mani Malek and Hamid Palangi and Joon Baek and Rick Pereira and Karthik Narasimhan},
year={2025},
eprint={2504.01081},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2504.01081},
}
For questions about the original model, see google/shieldgemma-2-4b-it.
For questions about this GGUF conversion, please open an issue in this repository.
convert_hf_to_gguf.py to support ShieldGemma2ForImageClassification architecture