alt.freeweights.granite / granite-4.0-h-350m-ONNX
From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.graniteSubject:

granite-4.0-h-350m-ONNX

Date: 2026-11-15Commit: 0665381Signed: 2DC28CC7B26A283B ✓

Text generation model. Onnx weights, 3.03 GB in all. Published by onnx-community under Apache-2.0.

granite3.03GBgranite-4.0-h-350m-ONNXonnxpermissive
FactsParamsnot statedSize3.03 GBFormatsonnxTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get onnx-community/granite-4.0-h-350m-ONNX
# manifest sha256 b1932547797e… · 3.03 GB · 20 files
$ fw verify ./granite-4.0-h-350m-ONNX onnx-community/granite-4.0-h-350m-ONNX
From sourceHosted (signed)onnx-community/granite-4.0-h-350m-ONNXLast check: 2026-11-15 05:20 UTC

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

Quantized of granite-4.0-h-350m.

Works with

Runs with

Ranked by fit to this model (onnx), then by GitHub stars.

Convert with

Overview

Size
3.03 GB
Weights
238 MB (smallest of 5 ONNX variants)
Parameters
not stated
Formats
onnx
Task
text generation
License
Apache-2.0 (permissive)
Files
20, each with a sha256
Publisher
onnx-community
Added
2026-11-15
Section
alt.freeweights.granite
Lineage

Original release from the publisher.

Base model: ibm-granite/granite-4.0-h-350m

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 05:20 UTCpassed

Model card

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

Usage#

ONNXRuntime#
from transformers import AutoConfig, AutoTokenizer
import onnxruntime
import numpy as np
from huggingface_hub import hf_hub_download

# 1. Setup
## Load config and tokenizer
model_id = "onnx-community/granite-4.0-h-350m-ONNX"
config = AutoConfig.from_pretrained(model_id) 
tokenizer = AutoTokenizer.from_pretrained(model_id)

## Load model
filename = "model" # Options: "model", "model_q4", "model_fp16", "model_q4f16"
dtype = np.float32 # or np.float16 if using fp16/q4f16
model_path = hf_hub_download(model_id, subfolder="onnx", filename=f"{filename}.onnx") # Download Graph
hf_hub_download(model_id, subfolder="onnx", filename=f"{filename}.onnx_data") # Download Weights
decoder_session = onnxruntime.InferenceSession(model_path)
output_names = [o.name for o in decoder_session.get_outputs()]

## Initialize config values
num_key_value_heads = config.num_key_value_heads
head_dim = config.hidden_size // config.num_attention_heads
eos_token_id = config.eos_token_id
d_conv = config.mamba_d_conv
mamba_n_heads = config.mamba_n_heads
mamba_d_head = config.mamba_d_head
mamba_d_state = config.mamba_d_state
mamba_n_groups = config.mamba_n_groups
mamba_expand = config.mamba_expand
hidden_size = config.hidden_size
conv_d_inner = (mamba_expand * hidden_size) + (2 * mamba_n_groups * mamba_d_state)

# 2. Prepare inputs
## Define messages
messages = [
  { "role": "user", "content": "What is the capital of France?" },
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="np")
input_ids = inputs['input_ids']
attention_mask = inputs['attention_mask']
batch_size = input_ids.shape[0]
num_logits_to_keep = np.array(1, dtype=np.int64)

## Initialize cache
cache = {}
for i, layer_type in enumerate(config.layer_types):
  if layer_type == "attention":
    for kv in ('key', 'value'):
      cache[f'past_key_values.{i}.{kv}'] = np.zeros([batch_size, num_key_value_heads, 0, head_dim], dtype=dtype)
  elif layer_type == "mamba":
    cache[f'past_conv.{i}'] = np.zeros([batch_size, conv_d_inner, d_conv], dtype=dtype)
    cache[f'past_ssm.{i}'] = np.zeros([batch_size, mamba_n_heads, mamba_d_head, mamba_d_state], dtype=dtype)

# 3. Generation loop
max_new_tokens = 1024
generated_tokens = np.array([[]], dtype=np.int64)
for i in range(max_new_tokens):
  feed_dict = dict(
    input_ids=input_ids,
    attention_mask=attention_mask,
    num_logits_to_keep=num_logits_to_keep,
  )
  outputs = decoder_session.run(None, feed_dict | cache)
  named_outputs = dict(zip(output_names, outputs))

  ## Update values for next generation loop
  input_ids = outputs[0][:, -1].argmax(-1, keepdims=True)
  attention_mask = np.concatenate([attention_mask, np.ones_like(input_ids, dtype=np.int64)], axis=-1)
  
  for name in cache:
    new_name = name.replace('past_key_values', 'present').replace('past_', 'present_')
    cache[name] = named_outputs[new_name]

  generated_tokens = np.concatenate([generated_tokens, input_ids], axis=-1)
  if (input_ids == eos_token_id).all():
    break

  ## (Optional) Streaming
  print(tokenizer.decode(input_ids[0]), end='', flush=True)
print()

# 4. Output result
print(tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)[0])

Files

20 files · 3.03 GBWeights 238 MB (smallest of 5 ONNX variants). Sizes and sha256 from the signed manifest.
Hide all 20 files with their sha256
FileSizesha256
.gitattributes1.83 KBba44193cf00eb237e2824cbfa212775d626f48f7c4caa3e630deda0908552db2
README.md3.37 KB6efc5d36382b84020b44dcdd0b3ce50e1915d3331f45d39b637c3b45dd56e308
chat_template.jinja6.42 KB9524df67b77a7b25a2dfee898f75b316a157eb9d855b51e32aeac79d7c8a83ce
config.json2.02 KB54cb65f281d8adcf884af5966b2ff621948da4472c41bf6097737c5041ebeb30
generation_config.json146 B5b2e6464e8e8765cee1a5e00dba0577b6e26eb1f424173e2c83d5ecb126e6446
merges.txt917 KBb6fe424e334903f7fb84d3a106d9730455f4744b9fe3c21ee136d97a00e72502
onnx/model.onnx1.77 MBdf4529081daa60f7f68c8daa2bd27d008dbf6ff81f9928d40dc2370a8e044145
onnx/model.onnx_data1.36 GB7b200c73269763519219e943e00f1d3016b9601d113c4901eee91bac859dee9f
onnx/model_fp16.onnx1.82 MBefc28cb23926258a47a2271ad4511d5e0670d5fc1ed38da3081f1b9a1b043490
onnx/model_fp16.onnx_data681 MBfa69e8924dbb271b3bb79b0060ec84d9a40907e9d55e4d5967faf6476a541381
onnx/model_q4.onnx1.85 MBf2c517b2515a33b4338f7e197cf7836d5b39221a6cd48487d304293aec0812e4
onnx/model_q4.onnx_data259 MB7b9064672bff5ff08019768d681db04be19059ec758b4bf2852a4fc7da137ac4
onnx/model_q4f16.onnx1.91 MBbaf8301ba9f1beb41b947d20527356c607f225ff00c2012b55e6503639b3dfbf
onnx/model_q4f16.onnx_data236 MB5f135b0e0832b21b9a2e2d2f9e5e157797679a2989071debea7b74dd634c7a20
onnx/model_quantized.onnx1.86 MBa46853c60ac3981b962254542ddb6bd54e90bcdbe50c477c659515e4cca89c74
onnx/model_quantized.onnx_data473 MBd59f676096f618487ff675abf0ca8fcf929ca17ebadfc8a52ffe87c9c0ecd992
special_tokens_map.json579 Bc08676c49fd7969a3130f72be6d4bf34da66aa484a6e21dffe359893a1bd5f2e
tokenizer.json4.13 MB7fb9ae9d95bdfc384ca52a54c918f78975c4082684fd510f54dcc9718ad1d026
tokenizer_config.json7.47 KBf395459029b54b0e623898c7b0817c7224d1e483b6a163a2cd2b2ac75a03015e
vocab.json1.61 MB8af71076de8b0b626eed0f4c984faf0a7c062479164b2a31308a948524d4f69c
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
06653818eb pinned now2026-11-15 05:20 UTC20 files · 3.03 GB

Use it

$ fw get onnx-community/granite-4.0-h-350m-ONNX
# manifest sha256 b1932547797e… · 3.03 GB · 20 files
$ fw verify ./granite-4.0-h-350m-ONNX onnx-community/granite-4.0-h-350m-ONNX
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/onnx-community/granite-4.0-h-350m-ONNX.json --dir ./granite-4.0-h-350m-ONNX $ python3 fw.py verify ./granite-4.0-h-350m-ONNX ./onnx-community__granite-4.0-h-350m-ONNX.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/granite-4.0-h-350m-ONNX --revision 06653818ebf090337d196df49a805d83ec0d211b --local-dir ./granite-4.0-h-350m-ONNX

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
6efc5d36382b84020b44dcdd0b3ce50e1915d3331f45d39b637c3b45dd56e308
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: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.graniteSubject: granite-4.0-h-350m-ONNXDate: 2026-11-15Commit: 0665381Signed: 2DC28CC7B26A283B ✓
Upstream
onnx-community/granite-4.0-h-350m-ONNX
Pinned commit
06653818ebf090337d196df49a805d83ec0d211b
Manifest
granite-4.0-h-350m-ONNX.json · .minisig
Manifest sha256
b1932547797e7f1aefaa7383d1041f563ff7968de4eee5103fe9b7a941376176
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 05:20 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/onnx-community/granite-4.0-h-350m-ONNX.json $ curl -O https://freeweights.allternit.com/manifests/onnx-community/granite-4.0-h-350m-ONNX.json.minisig $ minisign -Vm granite-4.0-h-350m-ONNX.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-4.0-h-350m · this model is a quantization of it

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

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/granite-4.0-h-350m-ONNX
Open in Freeweights Studio

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

Signed manifest
minisign, key 2DC28CC7B26A283B. granite-4.0-h-350m-ONNX.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