Hippius
mainsafetensorsPublicapache-2.0transformers

archive/granite-4.1-3b

sha256:10ea36505b4c4aff605424ec772bfdff92abc30741f6a249d9a1a25af9724e19·Indexed 26d ago

Parameters

—

Total size

6.3 GB

Files

111

Quantization

—

README.md

32.1 KB

Mirror. This is an unmodified copy of ibm-granite/granite-4.1-3b at commit c0650403e44e, mirrored by Hippius on 2026-10-29. Large files were checked against Hugging Face's published SHA-256 before upload (2 verified). License: apache-2.0. All credit to the original authors.

mof-class3-qualified

Granite-4.1-3B

Model Summary: Granite-4.1-3B is a 3B parameter long-context instruct model finetuned from Granite-4.1-3B-Base using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets. Granite 4.1 models have gone through an improved post-training pipeline, including supervised finetuning and reinforcement learning alignment, resulting in enhanced tool calling, instruction following, and chat capabilities.

Supported Languages: English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 4.1 models for languages beyond these languages.

Intended use: The model is designed to follow general instructions and can serve as the foundation for AI assistants across diverse domains, including business applications, as well as for LLM agents equipped with tool-use capabilities.

Capabilities

  • Summarization
  • Text classification
  • Text extraction
  • Question-answering
  • Retrieval Augmented Generation (RAG)
  • Code related tasks
  • Function-calling tasks
  • Multilingual dialog use cases
  • Fill-In-the-Middle (FIM) code completions

Generation: This is a simple example of how to use Granite-4.1-3B model.

Install the following libraries:

pip install torch torchvision torchaudio
pip install accelerate
pip install transformers

Then, copy the snippet from the section that is relevant for your use case.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda"
model_path = "ibm-granite/granite-4.1-3b"
tokenizer = AutoTokenizer.from_pretrained(model_path)
# drop device_map if running on CPU
model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
model.eval()
# change input text as desired
chat = [
    { "role": "user", "content": "Please list one IBM Research laboratory located in the United States. You should only output its name and location." },
]
chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
# tokenize the text
input_tokens = tokenizer(chat, return_tensors="pt").to(device)
# generate output tokens
output = model.generate(**input_tokens, 
                        max_new_tokens=100)
# decode output tokens into text
output = tokenizer.batch_decode(output)
# print output
print(output[0])

Expected output:

<|start_of_role|>user<|end_of_role|>Please list one IBM Research laboratory located in the United States. You should only output its name and location.<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>Almaden Research Center, San Jose, California<|end_of_text|>

Tool-calling: Granite-4.1-3B comes with enhanced tool calling capabilities, enabling seamless integration with external functions and APIs. To define a list of tools please follow OpenAI's function definition schema.

This is an example of how to use Granite-4.1-3B model tool-calling ability:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda"
model_path = "ibm-granite/granite-4.1-3b"
tokenizer = AutoTokenizer.from_pretrained(model_path)
# drop device_map if running on CPU
model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
model.eval()

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_current_weather",
            "description": "Get the current weather for a specified city.",
            "parameters": {
                "type": "object",
                "properties": {
                    "city": {
                        "type": "string",
                        "description": "Name of the city"
                    }
                },
                "required": ["city"]
            }
        }
    }
]

# change input text as desired
chat = [
    { "role": "user", "content": "What's the weather like in Boston right now?" },
]
chat = tokenizer.apply_chat_template(chat, \
                                     tokenize=False, \
                                     tools=tools, \
                                     add_generation_prompt=True)
# tokenize the text
input_tokens = tokenizer(chat, return_tensors="pt").to(device)
# generate output tokens
output = model.generate(**input_tokens, 
                        max_new_tokens=100)
# decode output tokens into text
output = tokenizer.batch_decode(output)
# print output
print(output[0])

Expected output:

<|start_of_role|>system<|end_of_role|>You are a helpful assistant with access to the following tools. You may call one or more tools to assist with the user query.

You are provided with function signatures within <tools></tools> XML tags:
<tools>
{"type": "function", "function": {"name": "get_current_weather", "description": "Get the current weather for a specified city.", "parameters": {"type": "object", "properties": {"city": {"type": "string", "description": "Name of the city"}}, "required": ["city"]}}}
</tools>

For each tool call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request.<|end_of_text|>
<|start_of_role|>user<|end_of_role|>What's the weather like in Boston right now?<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|><tool_call>
{"name": "get_current_weather", "arguments": {"city": "Boston"}}
</tool_call><|end_of_text|>

Evaluation Results:

Benchmarks Metric 3B Dense 8B Dense 30B Dense
General Tasks
MMLU 5-shot 67.02 73.84 80.16
MMLU-Pro 5-shot, CoT 49.83 55.99 64.09
BBH 3-shot, CoT 75.83 80.51 83.74
AGI EVAL 0-shot, CoT 65.16 72.43 77.80
GPQA 0-shot, CoT 31.70 41.96 45.76
SimpleQA 3.68 4.82 6.81
Alignment Tasks
AlpacaEval 2.0 38.57 50.08 56.16
IFEval Avg 82.30 87.06 89.65
ArenaHard 37.80 68.98 71.02
MTBench Avg 7.57 8.61 8.61
Math Tasks
GSM8K 8-shot 86.88 92.49 94.16
GSM Symbolic 8-shot 81.32 83.70 75.70
Minerva Math 0-shot, CoT 67.94 80.10 81.32
DeepMind Math 0-shot, CoT 64.64 80.07 81.93
Code Tasks
HumanEval pass@1 81.71 85.37 88.41
HumanEval+ pass@1 76.83 79.88 85.37
MBPP pass@1 71.16 87.30 85.45
MBPP+ pass@1 62.17 73.81 73.54
CRUXEval-O pass@1 40.75 47.63 55.75
BigCodeBench pass@1 32.19 35.00 38.77
MULTIPLE pass@1 52.54 60.26 62.31
Eval+ Avg pass@1 67.05 80.21 82.66
Tool Calling Tasks
BFCL v3 60.80 68.27 73.68
Multilingual Tasks
MMMLU 5-shot 57.61 64.84 73.71
INCLUDE 5-shot 52.05 58.89 67.26
MGSM 8-shot 70.00 82.32 71.12
Safety
SALAD-Bench 93.95 95.80 96.41
AttaQ 81.88 81.19 85.76
Tulu3 Safety Eval Avg 66.84 75.57 78.19
Multilingual Benchmarks and the included languages:
Benchmarks # Langs Languages
MMMLU 11 ar, de, en, es, fr, ja, ko, pt, zh, bn, hi
INCLUDE 14 hi, bn, ta, te, ar, de, es, fr, it, ja, ko, nl, pt, zh
MGSM 5 en, es, fr, ja, zh

Model Architecture:

Granite-4.1-3B baseline is built on a decoder-only dense transformer architecture. Core components of this architecture are: GQA, RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings.

Model 3B Dense 8B Dense 30B Dense
Embedding size 2560 4096 4096
Number of layers 40 40 64
Attention head size 64 128 128
Number of attention heads 40 32 32
Number of KV heads 8 8 8
MLP / Shared expert hidden size 8192 12800 32768
MLP activation SwiGLU SwiGLU SwiGLU
Sequence length 131072 131072 131072
Position embedding RoPE RoPE RoPE
# Parameters 3B 8B 30B

Training Data: Overall, our SFT data is largely comprised of three key sources: (1) publicly available datasets with permissive license, (2) internal synthetic data targeting specific capabilities, and (3) a select set of human-curated data.

Supervised Fine-Tuning and Reinforcement Learning: Instruct model has been fine tuned with significantly improved SFT-pipeline and Reinforcement learning pipelines with high quality mix of various datasets as mentioned above. With rigorous SFT-RL cycles we have improved Granite-4.1 model's tool calling, instruction following and chat capabilities. For further details please check our Granite-4.1 Blog.

Infrastructure: We trained the Granite 4.1 Language Models utilizing an NVIDIA GB200 NVL72 cluster hosted in CoreWeave. Intra-rack communication occurs via the 72-GPU NVLink domain, and a non-blocking, full Fat-Tree NDR 400 Gb/s InfiniBand network provides inter-rack communication. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs.

Ethical Considerations and Limitations: Granite 4.1 Instruction Models are primarily finetuned using instruction-response pairs mostly in English, but also multilingual data covering multiple languages. Although this model can handle multilingual dialog use cases, its performance might not be similar to English tasks. In such cases, introducing a small number of examples (few-shot) can help the model in generating more accurate outputs. While this model has been aligned by keeping safety in consideration, the model may in some cases produce inaccurate, biased, or unsafe responses to user prompts. We urge the community to use this model with proper safety testing and tuning tailored for their specific tasks. To enhance safety in enterprise deployments, we recommend using Granite 4.1 Language models alongside Granite Guardian, a model designed to detect and flag risks in inputs and outputs across key dimensions outlined in the IBM AI Risk Atlas.

Resources

Model architecture

config.json
Architecture
GraniteForCausalLM
Model type
granite
Hidden size
2,560
Layers
40
Attention heads
40 (8 kv)
FFN size
8,192
Vocab size
100,352
Context window
128K
Dtype
bfloat16

Files

111 items
  • f4e526ce773c

    74.3 MB

  • 833ab64f7420

    73.3 MB

  • 5c648efd85a0

    73.0 MB

  • 8922082a8543

    72.7 MB

  • dbf7d30c8048

    72.3 MB

  • c21bb6661f08

    71.7 MB

  • 4228ce196506

    71.6 MB

  • 6825697588f6

    71.5 MB

  • fd38da482ca4

    71.4 MB

  • c6a27c8c8c27

    71.2 MB

  • 5b9173faf0ae

    71.0 MB

  • f6d53e296083

    71.0 MB

  • 4bb66075177a

    70.9 MB

  • c7303fa85446

    70.6 MB

  • fc6bd180a7e9

    70.6 MB

  • 1c2f0be136b6

    70.6 MB

  • 981bc4f04a64

    70.0 MB

  • cab73d03462c

    69.8 MB

  • 821bacea577d

    69.8 MB

  • 3fa5c5f15465

    69.7 MB

  • 5a678dd77735

    69.3 MB

  • c0a058f181dc

    69.3 MB

  • d827e1a5751a

    68.9 MB

  • 1077e092ca9a

    68.9 MB

  • e8bd10017590

    68.8 MB

  • 50f8804d6746

    68.8 MB

  • e087c127713e

    68.8 MB

  • 676b1622b897

    68.3 MB

  • 8b1029bdeef2

    68.1 MB

  • 65fea3b5e198

    68.1 MB

  • bc952b381b9d

    68.0 MB

  • 258ec9e91d5f

    67.9 MB

  • 1a7fa575ba29

    67.9 MB

  • d6948f70f092

    67.9 MB

  • 3e16d0ae1ef3

    67.9 MB

  • ed816059a92b

    67.9 MB

  • 634a61cc1dea

    67.8 MB

  • 9935c047ab96

    67.7 MB

  • 63789167398b

    67.7 MB

  • 6e6daf9b2b1e

    67.6 MB

  • 6e9014d5178f

    67.6 MB

  • e8fa3b3198e8

    67.5 MB

  • 9279de52a0a8

    67.5 MB

  • 9f8d65ab017e

    67.5 MB

  • 4142888f3c7c

    67.3 MB

  • bd19209693a2

    67.3 MB

  • 402939afd2a5

    67.2 MB

  • 34e0b9934388

    67.1 MB

  • 4fda3fb52c95

    67.1 MB

  • 42fb16eb8a40

    67.0 MB

  • 334f8d71138f

    66.8 MB

  • 7cb9564b944d

    66.8 MB

  • 6b04af4e69cf

    66.7 MB

  • 84a4e6553488

    66.4 MB

  • 0d4f5e82f3ce

    66.4 MB

  • 01dfa96fa2d7

    66.3 MB

  • 0165a8ef4d05

    66.3 MB

  • 9121d0afd4b4

    66.2 MB

  • 4619c42cd9f8

    66.2 MB

  • ad25f681e670

    66.1 MB

  • d1310555595f

    66.0 MB

  • a4e9bba7fbb1

    66.0 MB

  • d4cf73d5cefc

    66.0 MB

  • ea786143449b

    66.0 MB

  • 43124e74bcc9

    65.9 MB

  • 973330b051ca

    65.9 MB

  • 7a72639b5d59

    65.7 MB

  • e766e9528946

    65.6 MB

  • 7026195d74ff

    65.6 MB

  • e5a830ffd1de

    65.6 MB

  • 2e5ee290812e

    65.2 MB

  • f1703e6815d8

    65.1 MB

  • 407c1ec75630

    65.1 MB

  • cfaf92d66b4f

    65.1 MB

  • 69058c0381f6

    65.1 MB

  • 8d3fd76dbbca

    65.0 MB

  • 6d912c3b5fe0

    65.0 MB

  • f2388c4af25f

    64.9 MB

  • c5470881729f

    64.8 MB

  • 01bf820b9fc2

    64.8 MB

  • 68ce257634d3

    64.6 MB

  • a907f24e9318

    64.5 MB

  • ac3dfe1eea8c

    64.5 MB

  • 205c7bb7a176

    64.5 MB

  • 5bc77f5c99fa

    64.4 MB

  • 37288433e518

    64.4 MB

  • 0abe0e0d19e0

    64.3 MB

  • 90006bdc2c2f

    64.3 MB

  • 5f880b1bc522

    64.3 MB

  • 85c8587d32b7

    64.3 MB

  • 13eaf211fbce

    64.2 MB

  • 7bae31810030

    64.2 MB

  • 9180c509253d

    64.2 MB

  • 4bc0fbb566eb

    64.2 MB

  • 5a04b66228d2

    64.1 MB

  • 812b4eb2eea9

    55.7 MB

  • 63166fbaefcf

    31.1 MB

  • tokenizer.json

    e2bad6643953

    6.8 MB

  • vocab.json

    8af71076de8b

    1.5 MB

  • merges.txt

    b6fe424e3349

    895.2 KB

  • model-00001-of-00002.safetensors

    30445d5428dd

    189.9 KB

    safetensors

  • model-00002-of-00002.safetensors

    2291460148c1

    69.5 KB

    safetensors

  • README.md

    d3fb7be05fea

    32.1 KB

  • model.safetensors.index.json

    b6b019b5aa30

    29.2 KB

  • tokenizer_config.json

    a5ec5daab12b

    17.2 KB

  • model.sig

    101351a28364

    10.4 KB

  • chat_template.jinja

    fed2756d2d24

    6.0 KB

  • hippius-provenance.json

    410e049d57aa

    1.6 KB

  • config.json

    9a0e589b69e7

    801 B

  • special_tokens_map.json

    c08676c49fd7

    579 B

  • generation_config.json

    9117fb03fed7

    147 B