Shieldstral 1.0 3B
Shieldstral is a compact 3B-parameter, policy-adaptive multimodal safety classifier. Instead of predicting a fixed set of moderation categories, Shieldstral evaluates content against a safety policy expressed in natural language and returns a single continuous safety score. This makes it a flexible drop-in guardrail for text-only, image-only, and text+image moderation that can be re-targeted to new policies at inference time, without retraining.
It is built on Ministral-3-3B-Base-2512 with a native Pixtral vision encoder, and produces its verdict from a single forward pass.
Learn more in our blog post and technical report.
Key Features
- Policy-adaptive: Moderation criteria are supplied as free-form natural-language queries at inference time, so a single checkpoint handles novel safety policies without retraining.
- Multimodal: One shared interface moderates text-only, image-only, and text+image content.
- Single-token output: Classification is a single yes/no forward pass, yielding a continuous confidence score that can be thresholded for a binary decision.
- Compact: A 3B checkpoint that runs on a single GPU.
- Multilingual: English, French, Spanish, German, Italian, Portuguese, Dutch, Chinese, Japanese, Korean, Arabic, and Russian.
- Context Window: We trained this model on sequences of up to 32k tokens. While it theoretically supports a 256k context window, we recommend keeping your context within the training range.
- Apache 2.0 License: Open weights for both commercial and non-commercial use.
Use Cases
Ideal for lightweight, real-time moderation applications on edge or low-resource devices, such as:
- User prompt moderation.
- Model response moderation.
- Model refusal classification.
- And more…
Benchmark Results
Best per row in bold.
Safety classification — F1 (%)
Prompt classification
Response classification
Multilingual
† Multilingual dataset. ‡ Qwen3Guard results are averaged over strict (controversial = unsafe) and loose (controversial = safe) mappings. § ShieldGemma and Shieldstral use a threshold of 0.5. ¶ GPT-OSS-Safeguard-20B uses reasoning_effort=high. ◊ Nemotron-3.5-Content-Safety-4B uses reasoning_effort=none for default categories.
Refusal detection — F1 (%)
† Multilingual dataset. ‡ Qwen3Guard results are averaged over strict / loose mappings. § Shieldstral uses a threshold of 0.5. ¶ GPT-OSS-Safeguard-20B uses reasoning_effort=high.
Multimodal safety — F1 (%)
§ ShieldGemma-2 and Shieldstral use a threshold of 0.5. ¶ Nemotron-3.5-Safety uses reasoning_effort=none for default categories. ★ Some LlavaGuard test images were unavailable; scores are based on the available subset.
How It Works
Shieldstral reduces content moderation to a binary question-answering task. Each input is a system message plus a user message:
-
System message (fixed):
-
User message (adaptive):
<Instruct>: high-level task framing (evaluation context and strictness level). Typically constant across a task or product surface.
<Query>: a single yes/no question about the document (e.g. "Does this content promote violence?").
<Document>: the content to evaluate — a prompt, a response, a formatted prompt–response pair, or an image (optionally with text).
Prompt-engineering tips:
- One policy per query. Shieldstral answers a single yes/no question per call. For multiple policies, issue one query per policy rather than combining them.
- Use
<Instruct> for context, strictness, and candidate classes. Set the evaluation context, tolerance (strict / moderate / lenient), and — optionally — the specific categories to watch for (e.g. "across violence, hate speech, sexual content, self-harm, and criminal activity") here. Keep it constant across a product surface.
- Frame the policy as a yes/no question. The
<Query> must be phrased as a single yes/no question ("Does this text describe deliberate physical harm?"), not a statement, keyword, or abstract label.
- Screen against many policies at once. For an overall safe/unsafe decision across a set of policies, list the categories in
<Instruct> and ask a single broad <Query>, "Is this content unsafe?", "Is this prompt unsafe?", or "Is this response unsafe?".
- Format prompt–response documents clearly. Any consistent delimiter works (e.g.
[User] ... [Assistant] ...); the model was trained on diverse formats.
Full example — a complete user message combining the three fields:
Usage
The model can be used for inference with the following frameworks:
You can also fine-tune the model with:
vLLM (recommended)
We recommend using this model with vLLM.
Installation
Make sure to install vllm >= 0.26.0:
Doing so should automatically install mistral_common >= 1.11.5. To check:
Serve
Shieldstral can be deployed locally, as it fits in 16GB of VRAM in BF16:
Examples
Here we assume that the model mistralai/Shieldstral-1.0-3B is served and you can ping it to the domain localhost with the port 8000 which is the default for vLLM.
Helper
Shieldstral emits a single yes/no token. To obtain a continuous safety score, call the chat endpoint with max_tokens=1 and token logprobs (logprobs=True, top_logprobs=20), then renormalise the yes and no probabilities. The helper below mirrors the reference evaluation code.
Text moderation
The policy lives in <Instruct> / <Query>; the content goes in <Document>.
Multimodal moderation (image + text)
For images, the user content is a [text, image, text] sandwich: the <Instruct>/<Query>/<Document>: prefix, then the image, then any trailing text (e.g. an accompanying caption or question).
llama.cpp
You can also run mistralai/Shieldstral-1.0-3B locally with llama.cpp.
Installation
Clone and build llama.cpp:
To build with CUDA acceleration, pass -DGGML_CUDA=ON to the first cmake command. See the build documentation for other backends (Metal, Vulkan, ROCm, SYCL).
Install the conversion dependencies. Shieldstral is converted from the Mistral format, so mistral-common is required:
Convert to GGUF
Download the checkpoint. Only the Mistral-format weights are needed, so you can skip model.safetensors:
Convert the language model:
Convert the vision encoder into a separate multimodal projector (mmproj) file:
This writes mmproj-Shieldstral-1.0-3b-BF16.gguf. Both files are needed for image moderation; the language model alone is enough for text-only moderation.
Optionally, quantize the language model to reduce its size. The mmproj file should be left as is:
Try out different quantization schemes with trade-offs between size and performance: Q8_0, Q5_K_M, Q4_K_M`.
Serve
llama-server exposes an OpenAI-compatible chat endpoint, so the vLLM examples apply unchanged.
SGLang
You can also serve mistralai/Shieldstral-1.0-3B with SGLang.
Installation
Make sure to install a version that includes this fix in order to load Shieldstral.
Here is a snippet to build from the main branch; see alternatives for installation here:
Serve
SGLang exposes an OpenAI-compatible chat endpoint, so the vLLM examples apply unchanged.
Transformers
You can also use mistralai/Shieldstral-1.0-3B with Transformers.
Installation
Install Transformers and to make the best use of our model prefer to install mistral-common >= 1.11.5 to use our tokenizer.
Examples
Helper
Load the model and tokenizer once. Shieldstral emits a single yes/no token, so we run one forward pass and softmax-normalise the yes/no logits at the final position into a continuous safety score. The same helper works for text-only and image+text inputs.
Text moderation
The policy lives in <Instruct> / <Query>; the content goes in <Document>.
Multimodal moderation (image + text)
For images, the user content is a [text, image, text] sandwich: the <Instruct>/<Query>/<Document>: prefix, then the image, then any trailing text (e.g. an accompanying caption or question).
Limitations & Ethical Considerations
- Uneven coverage. Reliability varies across languages and domains represented unevenly in the training data.
- Residual label noise. Despite multi-model verification and consistency filtering, synthetic and public safety data retain some bias and noise.
- Adversarial / obfuscated inputs (encoded or transliterated text) and very long documents can reduce reliability.
License
This model is licensed under the Apache 2.0 License.
You must not use this model in a manner that infringes, misappropriates, or otherwise violates any third party's rights, including intellectual property rights.