Skip to content

vllm.model_executor.models.shieldgemma2

ShieldGemma 2 (google/shieldgemma-2-*) served natively as a classifier.

The original checkpoint is a Gemma3 VLM whose answer is the logits of the "Yes" and "No" tokens at the last position. A two-way softmax over those two logits equals sigmoid((lm_head[Yes] - lm_head[No]) . h), so the model is a Gemma3 converted with as_seq_cls_model and the output is P(Yes) of that two-way softmax. ShieldGemma2ForImageClassificationConfig selects the conversion.