Granite Guardian 4.1 8B

GRANITE_GUARDIAN_4_1_8B

IBM Granite Guardian 4.1 8B checks prompts and replies for harm, jailbreaks, bias and profanity, RAG answers for groundedness and relevance, function calls for errors, or your own rule, and returns a yes/no verdict.

Text Generationguardrailssafetymoderationragjudgegraniteibmapache-2.0Fine-tunable
Granite Guardian 4.1 8B: Text Generation model on Kainguru

About Granite Guardian 4.1 8B

Capabilities

  • Built-in risks — harm, social bias, jailbreak, violence, profanity, sexual content, unethical behavior
  • RAG checks — groundedness, context relevance and answer relevance
  • Your own rule — custom_criteria in plain English, e.g. a length or format requirement

Good to know

  • It judges and does not chat. English only.
  • yes means the text meets the criterion; for the built-in risks, that the risk is present.
  • groundedness needs response and context; context_relevance prompt and context; answer_relevance prompt and response; function_call prompt, response and tools.
  • enable_thinking adds the reasoning behind the verdict (up to 2,048 tokens, billed as output tokens).
  • A fine-tune learns verdicts without reasoning. IBM validated the model in its own scoring mode only, so check a fine-tuned version on held-out data.
  • The text to judge may not contain <guardian>, <think>, </think> or the model's control tokens.

Granite Guardian 4.1 8B inputs and output

NameTypeRequiredDefaultDetails
contexttextWhen criteria in context_relevance, groundedness—The retrieved text the response should rest on. groundedness and context_relevance need it.
Max 131072 characters
responsetextOne of: prompt, response—The assistant's reply to judge.
Max 131072 characters
toolstextWhen criteria in function_call—JSON array of up to 32 tool definitions that the response's function calls must follow. function_call needs it.
Max 32768 characters
criteriatextNoharmWhat to check: a built-in risk, or custom for your own rule in custom_criteria.
Allowed: harm, social_bias, jailbreak, violence, profanity, sexual_content, unethical_behavior, groundedness, context_relevance, answer_relevance, function_call, custom · Max 32 characters
enable_thinkingbooleanNofalseReason step by step before the verdict and return that reasoning; slower, and its tokens are billed.
prompttextOne of: prompt, response—The user's message. Judged itself when there is no response; otherwise the request the response answers.
Max 131072 characters
custom_criteriatextWhen criteria = custom—Your own rule in plain English when criteria is custom, e.g. "The response is at most three sentences."
Max 4096 characters

Output. JSON: {"verdict": "yes" or "no", "criteria", token counts}. yes means the text meets the criteria: a built-in risk is present, or your own rule holds. With enable_thinking, "reasoning" explains it.

Run Granite Guardian 4.1 8B with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=GRANITE_GUARDIAN_4_1_8B" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "criteria": "harm",
    "enable_thinking": false
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "GRANITE_GUARDIAN_4_1_8B",
        {
          "criteria": "harm",
          "enable_thinking": False
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune Granite Guardian 4.1 8B

You can fine-tune Granite Guardian 4.1 8B on your own data and run the tuned model through the same API. Dataset: JSONL files (an example per line) or JSON arrays of examples: the fields of a request (prompt, response, context, tools, criteria, custom_criteria) and "label": "yes" or "no". 4 to 50,000 examples, 256 MiB in all.

The steps are in the docs.

Granite Guardian 4.1 8B pricing

Price per 1M tokens: 23.7 credits ($0.237). The price is shown again before every run; all prices are on the pricing page.

Licence and source

Granite 3.3 8B Instruct: Text Generation model on Kainguru
Text Generation

Granite 3.3 8B Instruct

IBM Granite 3.3 8B Instruct, a general-purpose assistant that answers questions, writes, summarises and codes in…

Fine-tunable
Gemma 4 12B IT: Text Generation model on Kainguru
Text Generation

Gemma 4 12B IT

Google Gemma 4 12B, a multilingual assistant for chat, writing, code and maths in over 140 languages, that can reason…

Fine-tunable
Gemma 4 31B IT: Text Generation model on Kainguru
Text Generation

Gemma 4 31B IT

Gemma 4 31B, Google's open assistant for chat, reasoning, writing and code in over 35 languages, that thinks step by…

Fine-tunable
MiniCPM5 2B: Text Generation model on Kainguru
Text Generation

MiniCPM5 2B

MiniCPM5 2B, a small English and Chinese assistant for chat, code, maths and long documents, that can reason step by…

Fine-tunable
Qwen3.5 2B: Text Generation model on Kainguru
Text Generation

Qwen3.5 2B

Qwen3.5 2B, a small assistant for chat, writing, summaries and code in about 200 languages, Azerbaijani included, that…

Fine-tunable
Qwen3.5 9B: Text Generation model on Kainguru
Text Generation

Qwen3.5 9B

Qwen3.5 9B, a strong assistant for chat, reasoning, writing and code in about 200 languages, Azerbaijani included…

Fine-tunable