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

granite-20b-code-instruct

Date: 2026-11-15Commit: 03d2f36Signed: 2DC28CC7B26A283B ✓

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

20.1B params40.1GBgranite-20b-code-instructsafetensorspermissive
FactsParams20.1BSize40.1 GBFormatssafetensorsTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get ibm-granite/granite-20b-code-instruct
# manifest sha256 8d33a547d8fe… · 40.1 GB · 17 files
$ fw verify ./granite-20b-code-instruct ibm-granite/granite-20b-code-instruct
From sourceHosted (signed)ibm-granite/granite-20b-code-instructLast check: 2026-11-15 03:32 UTC

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

Fine-tune of granite-20b-code-base-8k.

Works with

Overview

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

Original release from the publisher.

Base model: ibm-granite/granite-20b-code-base-8k

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 03d2f36. 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-20B-Code-Instruct-8K#

Model Summary#

Granite-20B-Code-Instruct-8K is a 20B parameter model fine tuned from Granite-20B-Code-Base-8K on a combination of permissively licensed instruction data to enhance instruction following capabilities including logical reasoning and problem-solving skills.

Usage#

Intended use#

The model is designed to respond to coding related instructions and can be used to build coding assistants.

Generation#

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

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # or "cpu"
model_path = "ibm-granite/granite-20b-code-instruct-8k"
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 the following types of data.

  • Code Commits Datasets: we sourced code commits data from the CommitPackFT dataset, a filtered version of the full CommitPack dataset. From CommitPackFT dataset, we only consider data for 92 programming languages. Our inclusion criteria boils down to selecting programming languages common across CommitPackFT and the 116 languages that we considered to pretrain the code-base model (Granite-20B-Code-Base).
  • Math Datasets: We consider two high-quality math datasets, MathInstruct and MetaMathQA. Due to license issues, we filtered out GSM8K-RFT and Camel-Math from MathInstruct dataset.
  • Code Instruction Datasets: We use Glaive-Code-Assistant-v3, Glaive-Function-Calling-v2, NL2SQL11 and a small collection of synthetic API calling datasets.
  • Language Instruction Datasets: We include high-quality datasets such as HelpSteer and an open license-filtered version of Platypus. We also include a collection of hardcoded prompts to ensure our model generates correct outputs given inquiries about its name or developers.

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-20B-Code-Base-8K model card.

Files

17 files · 40.1 GBWeights 40.1 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 17 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
README.md9.73 KBaea91c5ccf7079da26c7b0e25e21d025c0fb2536d4e98921acb300c71c3082dd
config.json645 B26367b9219093ef1ea48c012dedfa8305748c4bd1d9b4ada3cb95c8023b824e5
generation_config.json132 B363aabb70f766d10df868a0c690834db0085c6a6ae74897a2c1b8682d8eb3744
model-00001-of-00009.safetensors4.95 GB55d1681c37520a4e6009d3b595f9c062aca59fd6df3cd3fa1030837a771a62a2
model-00002-of-00009.safetensors4.93 GB37dea2993966d6a4454c0912c727f54721fbcf180d0fee64a495eb8aefad436a
model-00003-of-00009.safetensors4.93 GBd811f778ac946f8bd6d9b575219567f8f5e16e299517dc750ffda7c0f576a544
model-00004-of-00009.safetensors4.93 GB0013c2cca1844674e87693199bbbcf76d319ac1f4a6240be10468b3030bf2099
model-00005-of-00009.safetensors4.93 GB5838930baf3c8d10fc75d43deb076eff69fef08950eac9a0f07014322a2110cf
model-00006-of-00009.safetensors4.93 GBacbba4bad1fbedb0cafb388c03748a72f3644fdfc7bfcb714e560366a828a78e
model-00007-of-00009.safetensors4.93 GB77c560778bfb84119c7b74cfe755f084ae1734d345c421dd29aae1365fe73d71
model-00008-of-00009.safetensors4.93 GBbfb0611b88a1d48cdbd5e244bd3ea9e4af0dcf63027e43628a62a402a864ca03
model-00009-of-00009.safetensors680 MBf666a85b0d908ac07f85bbe7503c18cab2762374e6edc3517f0b1953584a8c6a
model.safetensors.index.json47.0 KB53d2d77769d80017cf3453f36058d47239e494e3b818672ec66a6a125bb44af5
special_tokens_map.json1.02 KB2f2bba45146f073a7b8a097cb6133a6b4b66d5751e73f2a2aca81083288813e9
tokenizer.json2.06 MBd3b4df07a0ce3940b15c77e2ea17ab5627ca0c4bf982d2eb37966aea0a81c918
tokenizer_config.json4.53 KB3a7083e3681688d6a5169715a59e371747c74b2eb69a7893053487997f3d8e11
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
03d2f3664e pinned now2026-11-15 03:32 UTC17 files · 40.1 GB

Use it

$ fw get ibm-granite/granite-20b-code-instruct
# manifest sha256 8d33a547d8fe… · 40.1 GB · 17 files
$ fw verify ./granite-20b-code-instruct ibm-granite/granite-20b-code-instruct
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-20b-code-instruct.json --dir ./granite-20b-code-instruct $ python3 fw.py verify ./granite-20b-code-instruct ./ibm-granite__granite-20b-code-instruct.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download ibm-granite/granite-20b-code-instruct --revision 03d2f3664ed0059eac4d35797b43fb52d551bb5b --local-dir ./granite-20b-code-instruct
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-20b-code-instruct", revision="03d2f3664ed0059eac4d35797b43fb52d551bb5b") model = AutoModelForCausalLM.from_pretrained("ibm-granite/granite-20b-code-instruct", revision="03d2f3664ed0059eac4d35797b43fb52d551bb5b", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve ibm-granite/granite-20b-code-instruct --revision 03d2f3664ed0059eac4d35797b43fb52d551bb5b

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
aea91c5ccf7079da26c7b0e25e21d025c0fb2536d4e98921acb300c71c3082dd
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-20b-code-instructDate: 2026-11-15Commit: 03d2f36Signed: 2DC28CC7B26A283B ✓
Upstream
ibm-granite/granite-20b-code-instruct
Pinned commit
03d2f3664ed0059eac4d35797b43fb52d551bb5b
Manifest
granite-20b-code-instruct.json · .minisig
Manifest sha256
8d33a547d8fe728074599abab2d1968d18b83b0156c2af5c302703567b791ae9
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-20b-code-instruct.json $ curl -O https://freeweights.allternit.com/manifests/ibm-granite/granite-20b-code-instruct.json.minisig $ minisign -Vm granite-20b-code-instruct.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

Parent

ibm-granite/granite-20b-code-base-8k · this model is a finetune of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download ibm-granite/granite-20b-code-instruct
Open in Freeweights Studio

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

Signed manifest
minisign, key 2DC28CC7B26A283B. granite-20b-code-instruct.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