This is an
FP8 dynamic quantized version of
ibm-granite/granite-4.1-8b, IBM Granite's 8B-parameter long-context instruct model. Granite-4.1-8B was finetuned from
Granite-4.1-8B-Base with supervised fine-tuning and reinforcement-learning alignment for strong tool-calling, instruction-following, and chat — with a native
128K context window.
Quantization was performed using
LLM Compressor v0.11.0 via a post-training
one-shot method (no calibration data required). The checkpoint is saved in the
compressed-tensors format, natively supported by
vLLM and
transformers.
1default_stage:
2 default_modifiers:
3 QuantizationModifier:
4 targets: [Linear]
5 ignore: [lm_head]
6 scheme: FP8_DYNAMIC
7 bypass_divisibility_checks: false
1from llmcompressor import oneshot
2from llmcompressor.modifiers.quantization import QuantizationModifier
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5model = AutoModelForCausalLM.from_pretrained("ibm-granite/granite-4.1-8b", dtype="auto")
6tokenizer = AutoTokenizer.from_pretrained("ibm-granite/granite-4.1-8b")
7
8recipe = QuantizationModifier(targets="Linear", scheme="FP8_DYNAMIC", ignore=["lm_head"])
9oneshot(model=model, recipe=recipe)
10
11model.save_pretrained("./granite-4.1-8b-FP8-DYNAMIC")
12tokenizer.save_pretrained("./granite-4.1-8b-FP8-DYNAMIC")
Granite-4.1-8B is a decoder-only dense transformer with GQA, RoPE, SwiGLU MLP, RMSNorm, and tied input/output embeddings. It also uses Granite's scaled-multiplier scheme (attention_multiplier, embedding_multiplier, logits_scaling, residual_multiplier) baked into the forward pass — these are preserved verbatim by quantization.
1pip install vllm
2vllm serve barryke/granite-4.1-8b-FP8-DYNAMIC
1vllm serve barryke/granite-4.1-8b-FP8-DYNAMIC \
2 --enable-auto-tool-choice \
3 --tool-call-parser granite
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4model_id = "barryke/granite-4.1-8b-FP8-DYNAMIC"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 dtype=torch.bfloat16,
10 device_map="auto",
11)
12
13chat = [
14 {"role": "user", "content": "Please list one IBM Research laboratory located in the United States. You should only output its name and location."},
15]
16input_ids = tokenizer.apply_chat_template(
17 chat,
18 add_generation_prompt=True,
19 return_tensors="pt",
20).to(model.device)
21
22output_ids = model.generate(
23 input_ids,
24 max_new_tokens=100,
25 pad_token_id=tokenizer.eos_token_id,
26)
27
28response = tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=True)
29print(response)
30# IBM Almaden Research Laboratory, San Jose, California, United States.
1tools = [
2 {
3 "type": "function",
4 "function": {
5 "name": "get_current_weather",
6 "description": "Get the current weather for a specified city.",
7 "parameters": {
8 "type": "object",
9 "properties": {"city": {"type": "string", "description": "Name of the city"}},
10 "required": ["city"],
11 },
12 },
13 }
14]
15
16chat = [{"role": "user", "content": "What's the weather like in Boston right now?"}]
17input_ids = tokenizer.apply_chat_template(
18 chat, tools=tools, add_generation_prompt=True, return_tensors="pt",
19).to(model.device)
20out = model.generate(input_ids, max_new_tokens=100, pad_token_id=tokenizer.eos_token_id)
21print(tokenizer.decode(out[0][input_ids.shape[-1]:], skip_special_tokens=False))
22# <tool_call>
23# {"name": "get_current_weather", "arguments": {"city": "Boston"}}
24# </tool_call>
1pip install sglang
2python3 -m sglang.launch_server \
3 --model-path barryke/granite-4.1-8b-FP8-DYNAMIC \
4 --host 0.0.0.0 \
5 --port 30000
1@misc{granite41,
2 title = {Granite 4.1 Language Models},
3 author = {{IBM Granite Team}},
4 year = {2026},
5 url = {https://huggingface.co/ibm-granite/granite-4.1-8b},
6 note = {Apache 2.0 licensed 8B dense instruct model with 128K context}
7}
1@software{llm-compressor,
2 title = {{LLM Compressor: An easy-to-use library for compressing LLMs}},
3 author = {{Neuralmagic, vLLM Project}},
4 url = {https://github.com/vllm-project/llm-compressor},
5 note = {Used v0.11.0 to produce this FP8-DYNAMIC checkpoint}
6}