Instructions to use ibm-granite/granite-4.1-8b-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ibm-granite/granite-4.1-8b-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ibm-granite/granite-4.1-8b-base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ibm-granite/granite-4.1-8b-base") model = AutoModelForCausalLM.from_pretrained("ibm-granite/granite-4.1-8b-base") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ibm-granite/granite-4.1-8b-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ibm-granite/granite-4.1-8b-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ibm-granite/granite-4.1-8b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ibm-granite/granite-4.1-8b-base
- SGLang
How to use ibm-granite/granite-4.1-8b-base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ibm-granite/granite-4.1-8b-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ibm-granite/granite-4.1-8b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ibm-granite/granite-4.1-8b-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ibm-granite/granite-4.1-8b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ibm-granite/granite-4.1-8b-base with Docker Model Runner:
docker model run hf.co/ibm-granite/granite-4.1-8b-base
Update README.md
#1
by aheching - opened
README.md
CHANGED
|
@@ -11,15 +11,15 @@ tags:
|
|
| 11 |
# Granite-4.1-8B-Base
|
| 12 |
|
| 13 |
**Model Summary:**
|
| 14 |
-
Granite‑4.1‑8B‑Base is a decoder‑only language model with long‑context capabilities, designed to support a broad range of text‑to‑text generation tasks. In addition to standard generation, it supports Fill‑in‑the‑Middle (FIM) code completion through specialized prefix and suffix tokens. The model is trained from scratch on approximately 15 trillion tokens using a five‑phase training strategy: 10 trillion tokens in phase one, 2 trillion tokens each in phases two and three, and 0.5 trillion tokens in phase four. In the final phase, long‑context extension is applied to expand the model’s context window to 512K tokens.
|
| 15 |
|
| 16 |
<!--
|
| 17 |
TO DO: Don't it only applies to the 3B model card?
|
| 18 |
Grante-4.1-3B base is same base model as Granite-4.0-3B-Micro.
|
| 19 |
-->
|
| 20 |
- **Developers:** Granite Team, IBM
|
| 21 |
-
- **HF Collection:** [Granite 4.1 Language Models HF Collection](https://huggingface.co/collections/ibm-granite/granite-41)
|
| 22 |
-
- **Technical Blog:** [Granite-4.1 Blog](https://huggingface.co/blog/ibm-granite/
|
| 23 |
- **GitHub Repository:** [ibm-granite/granite-4.1-language-models](https://github.com/ibm-granite/granite-4.1-language-models)
|
| 24 |
- **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
|
| 25 |
- **Release Date**: April 29th, 2026
|
|
@@ -411,7 +411,7 @@ Granite-4.1-8B-Base is based on a decoder-only dense transformer architecture. C
|
|
| 411 |
</tbody></table>
|
| 412 |
|
| 413 |
|
| 414 |
-
**Training Data:** This model is trained on a mix of open source and proprietary data following a five-phase training strategy. We refer to phase-1
|
| 415 |
|
| 416 |
<table>
|
| 417 |
<thead>
|
|
@@ -466,7 +466,7 @@ Granite-4.1-8B-Base is based on a decoder-only dense transformer architecture. C
|
|
| 466 |
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.
|
| 467 |
|
| 468 |
**Ethical Considerations and Limitations:**
|
| 469 |
-
The use of Large Language Models involves risks and ethical considerations people must be aware of, including but not limited to: bias and fairness, misinformation, and autonomous decision-making. Granite-4.1-8B-Base model is not
|
| 470 |
|
| 471 |
**Resources**
|
| 472 |
- ⭐️ Learn about the latest updates with Granite: https://www.ibm.com/granite
|
|
|
|
| 11 |
# Granite-4.1-8B-Base
|
| 12 |
|
| 13 |
**Model Summary:**
|
| 14 |
+
Granite‑4.1‑8B‑Base is a decoder‑only language model with long‑context capabilities, designed to support a broad range of text‑to‑text generation tasks. In addition to standard generation, it supports Fill‑in‑the‑Middle (FIM) code completion through specialized prefix and suffix tokens. The model is trained from scratch on approximately 15 trillion tokens using a five‑phase training strategy: 10 trillion tokens in phase one, 2 trillion tokens each in phases two and three, and 0.5 trillion tokens in phase four. In the final phase, long‑context extension is applied to expand the model’s context window to 512K tokens.
|
| 15 |
|
| 16 |
<!--
|
| 17 |
TO DO: Don't it only applies to the 3B model card?
|
| 18 |
Grante-4.1-3B base is same base model as Granite-4.0-3B-Micro.
|
| 19 |
-->
|
| 20 |
- **Developers:** Granite Team, IBM
|
| 21 |
+
- **HF Collection:** [Granite 4.1 Language Models HF Collection](https://huggingface.co/collections/ibm-granite/granite-41-language-models)
|
| 22 |
+
- **Technical Blog:** [Granite-4.1 Blog](https://huggingface.co/blog/ibm-granite/granite-4-1)
|
| 23 |
- **GitHub Repository:** [ibm-granite/granite-4.1-language-models](https://github.com/ibm-granite/granite-4.1-language-models)
|
| 24 |
- **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
|
| 25 |
- **Release Date**: April 29th, 2026
|
|
|
|
| 411 |
</tbody></table>
|
| 412 |
|
| 413 |
|
| 414 |
+
**Training Data:** This model is trained on a mix of open source and proprietary data following a five-phase training strategy. We refer to phase-1 and phase-2 as pre-training, and phase-3, phase-4, and phase-5 as mid-training.
|
| 415 |
|
| 416 |
<table>
|
| 417 |
<thead>
|
|
|
|
| 466 |
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.
|
| 467 |
|
| 468 |
**Ethical Considerations and Limitations:**
|
| 469 |
+
The use of Large Language Models involves risks and ethical considerations people must be aware of, including but not limited to: bias and fairness, misinformation, and autonomous decision-making. Granite-4.1-8B-Base model is not an exception in this regard. Even though this model is suited for multiple generative AI tasks, it has not undergone any safety alignment and it may produce problematic outputs. Additionally, it remains uncertain whether smaller models might exhibit increased susceptibility to hallucination in generation scenarios by copying text verbatim from the training dataset due to their reduced sizes and memorization capacities. This aspect is currently an active area of research, and we anticipate more rigorous exploration, comprehension, and mitigations in this domain. Regarding ethics, a latent risk associated with all Large Language Models is their malicious utilization. We urge the community to use Granite-4.1-8B-Base model with ethical intentions and in a responsible way.
|
| 470 |
|
| 471 |
**Resources**
|
| 472 |
- ⭐️ Learn about the latest updates with Granite: https://www.ibm.com/granite
|