Instructions to use darthcrawl/granite-guardian-4.1-8b-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use darthcrawl/granite-guardian-4.1-8b-mlx-4bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir granite-guardian-4.1-8b-mlx-4bit darthcrawl/granite-guardian-4.1-8b-mlx-4bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
granite-guardian-4.1-8b-mlx-4bit
MLX 4-bit quant of ibm-granite/granite-guardian-4.1-8b. IBM's safety classifier; flags harmful content across categories (harm, social bias, jailbreak, violence, profanity, sexual content, unethical behavior).
Disk: ~4.4 GB. Active memory while serving: ~5 GB plus KV cache.
Quantization
mlx_lm.convert --hf-path ibm-granite/granite-guardian-4.1-8b \
--mlx-path ./granite-guardian-4.1-8b-mlx-4bit -q --q-bits 4
Usage
Granite Guardian uses a structured prompt to classify a piece of input/output text. The model returns "Yes" or "No" plus a confidence score. See the base model card for the prompt template (it's risk-category-specific).
For a quick check via mlx_lm.server's chat completions endpoint, send the structured prompt as the user message and read the assistant token.
Recommended sampling
Classification, not creative output:
temperature: 0.0
max_tokens: 16
Greedy decoding is appropriate. Bail early since the response is short.
License
Apache-2.0 from base.
- Downloads last month
- 37
4-bit
Model tree for darthcrawl/granite-guardian-4.1-8b-mlx-4bit
Base model
ibm-granite/granite-4.1-8b