alt.freeweights.granite / granite-8b-code-instruct-128k
From: ibm-granite <huggingface.co/ibm-granite>Newsgroups: alt.freeweights.graniteSubject:

granite-8b-code-instruct-128k

Date: 2026-11-15Commit: bed93d8Signed: 2DC28CC7B26A283B ✓

Text generation model with 8.1B parameters. Safetensors weights, 16.1 GB in all. Published by ibm-granite under Apache-2.0.

8.1B params16.1GBgranite-8b-code-instruct-128ksafetensorspermissive
FactsParams8.1BSize16.1 GBFormatssafetensorsTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get ibm-granite/granite-8b-code-instruct-128k
# manifest sha256 928c292079d0… · 16.1 GB · 12 files
$ fw verify ./granite-8b-code-instruct-128k ibm-granite/granite-8b-code-instruct-128k
From sourceHosted (signed)ibm-granite/granite-8b-code-instruct-128kLast check: 2026-11-15 03:32 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Overview

Size
16.1 GB
Weights
16.1 GB (safetensors)
Parameters
8.1B
Formats
safetensors
Task
text generation
License
Apache-2.0 (permissive)
Files
12, each with a sha256
Publisher
ibm-granite
Added
2026-11-15
Section
alt.freeweights.granite
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 03:32 UTCpassed

Model card

From the publisher at commit bed93d8. Shown as plain text with links; images open at the publisher.

⚠️ DEPRECATION WARNING ⚠️#

New applications/projects should use the latest mainline Granite language model family, whose code capabilities supercede this model. This model is being made available strictly for historical/scientific purposes. Please see our Granite Collections for the latest Granite releases.


Image: image/png

Granite-8B-Code-Instruct-128K#

Model Summary#

Granite-8B-Code-Instruct-128K is a 8B parameter long-context instruct model fine tuned from Granite-8B-Code-Base-128K on a combination of permissively licensed data used in training the original Granite code instruct models, in addition to synthetically generated code instruction datasets tailored for solving long context problems. By exposing the model to both short and long context data, we aim to enhance its long-context capability without sacrificing code generation performance at short input context.

Usage#

Intended use#

The model is designed to respond to coding related instructions over long-conext input up to 128K length and can be used to build coding assistants.

Generation#

This is a simple example of how to use Granite-8B-Code-Instruct model.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # or "cpu"
model_path = "ibm-granite/granite-8B-Code-instruct-128k"
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": "Write a code to find the maximum value in a list of numbers." },
]
chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
# tokenize the text
input_tokens = tokenizer(chat, return_tensors="pt")
# transfer tokenized inputs to the device
for i in input_tokens:
    input_tokens[i] = input_tokens[i].to(device)
# generate output tokens
output = model.generate(**input_tokens, max_new_tokens=100)
# decode output tokens into text
output = tokenizer.batch_decode(output)
# loop over the batch to print, in this example the batch size is 1
for i in output:
    print(i)

Training Data#

Granite Code Instruct models are trained on a mix of short and long context data as follows.

Infrastructure#

We train the Granite Code models using two of IBM's super computing clusters, namely Vela and Blue Vela, both outfitted with NVIDIA A100 and H100 GPUs respectively. These clusters provide a scalable and efficient infrastructure for training our models over thousands of GPUs.

Ethical Considerations and Limitations#

Granite code instruct models are primarily finetuned using instruction-response pairs across a specific set of programming languages. Thus, their performance may be limited with out-of-domain programming languages. In this situation, it is beneficial providing few-shot examples to steer the model's output. Moreover, developers should perform safety testing and target-specific tuning before deploying these models on critical applications. The model also inherits ethical considerations and limitations from its base model. For more information, please refer to Granite-8B-Code-Base-128K model card.

Files

12 files · 16.1 GBWeights 16.1 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 12 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
README.md7.79 KBef9b7265bf393c2fbfee800c3b376f4638b75329acc3b0afa6c864e76d76c338
config.json679 B01c0b30272f2e9f5bee19e909f52ca73cb2c153e3170bf9b7c8214c2bba25559
generation_config.json132 B363aabb70f766d10df868a0c690834db0085c6a6ae74897a2c1b8682d8eb3744
model-00001-of-00004.safetensors4.97 GBbb8b26ca6920a0cb729c7ad144944a87fc68d9f600ca7213f5d7349f24ff9332
model-00002-of-00004.safetensors4.92 GB3b441f58aa862ae4d77bd3cdf9f9fa12728cd8581a78068baf4dd58ef8cd00db
model-00003-of-00004.safetensors4.97 GB79626d34612f9e3f9b96f28faa19495922fb0179fd15b0454ef1f8cc003be3ff
model-00004-of-00004.safetensors1.26 GB9063fa814c2fff9020e7a660d1bde795e12ffef8ce1f70f9f91e70f2842b7830
model.safetensors.index.json46.8 KB94ff9338861bb99c97330ea981241c8b9f081d4d9b19d3b1452200ddc92003f4
special_tokens_map.json1.02 KB2f2bba45146f073a7b8a097cb6133a6b4b66d5751e73f2a2aca81083288813e9
tokenizer.json2.06 MBd3b4df07a0ce3940b15c77e2ea17ab5627ca0c4bf982d2eb37966aea0a81c918
tokenizer_config.json4.54 KBf533a8dbb8526be9e8f5b218e6d7be21cb4ce6fd2068286ab7e78d98ecc9a053
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
bed93d8de1 pinned now2026-11-15 03:32 UTC12 files · 16.1 GB

Use it

$ fw get ibm-granite/granite-8b-code-instruct-128k
# manifest sha256 928c292079d0… · 16.1 GB · 12 files
$ fw verify ./granite-8b-code-instruct-128k ibm-granite/granite-8b-code-instruct-128k
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/ibm-granite/granite-8b-code-instruct-128k.json --dir ./granite-8b-code-instruct-128k $ python3 fw.py verify ./granite-8b-code-instruct-128k ./ibm-granite__granite-8b-code-instruct-128k.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download ibm-granite/granite-8b-code-instruct-128k --revision bed93d8de15bb9bb55cb1da10ae860e2883f4254 --local-dir ./granite-8b-code-instruct-128k
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("ibm-granite/granite-8b-code-instruct-128k", revision="bed93d8de15bb9bb55cb1da10ae860e2883f4254") model = AutoModelForCausalLM.from_pretrained("ibm-granite/granite-8b-code-instruct-128k", revision="bed93d8de15bb9bb55cb1da10ae860e2883f4254", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve ibm-granite/granite-8b-code-instruct-128k --revision bed93d8de15bb9bb55cb1da10ae860e2883f4254

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
ef9b7265bf393c2fbfee800c3b376f4638b75329acc3b0afa6c864e76d76c338
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: ibm-granite <huggingface.co/ibm-granite>Newsgroups: alt.freeweights.graniteSubject: granite-8b-code-instruct-128kDate: 2026-11-15Commit: bed93d8Signed: 2DC28CC7B26A283B ✓
Upstream
ibm-granite/granite-8b-code-instruct-128k
Pinned commit
bed93d8de15bb9bb55cb1da10ae860e2883f4254
Manifest
granite-8b-code-instruct-128k.json · .minisig
Manifest sha256
928c292079d0ab7dbc3febf5ee0778638d4e58d5022eaa7a037e751a798f88de
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:32 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/ibm-granite/granite-8b-code-instruct-128k.json $ curl -O https://freeweights.allternit.com/manifests/ibm-granite/granite-8b-code-instruct-128k.json.minisig $ minisign -Vm granite-8b-code-instruct-128k.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download ibm-granite/granite-8b-code-instruct-128k
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. granite-8b-code-instruct-128k.json. Provenance. Takedown history: none.
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed1
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed2
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed3
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.seed1
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.seed2
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.seed3