alt.freeweights.granite / granite-embedding-small-english-r2-ONNX
From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.graniteSubject:

granite-embedding-small-english-r2-ONNX

Date: 2026-11-14Commit: 1dc7835Signed: 2DC28CC7B26A283B ✓

Sentence similarity model. Onnx weights, 504 MB in all. Published by onnx-community under Apache-2.0.

granite504MBgranite-embedding-small-english-r2-ONNXonnxpermissive
FactsParamsnot statedSize504 MBFormatsonnxTasksentence similarityLicenseApache-2.0From sourcepermissive
$ fw get onnx-community/granite-embedding-small-english-r2-ONNX
# manifest sha256 dff65c9ce068… · 504 MB · 16 files
$ fw verify ./granite-embedding-small-english-r2-ONNX onnx-community/granite-embedding-small-english-r2-ONNX
From sourceHosted (signed)onnx-community/granite-embedding-small-english-r2-ONNXLast check: 2026-11-14 21:31 UTC

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

Quantized of granite-embedding-small-english-r2.

Works with

Runs with

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

Convert with

Evaluate with

Scan with

Overview

Size
504 MB
Weights
52.5 MB (smallest of 5 ONNX variants)
Parameters
not stated
Formats
onnx
Task
sentence similarity
License
Apache-2.0 (permissive)
Files
16, each with a sha256
Publisher
onnx-community
Added
2026-11-14
Section
alt.freeweights.granite
Lineage

Original release from the publisher.

Base model: ibm-granite/granite-embedding-small-english-r2

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-14 21:31 UTCpassed

Model card

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

Granite-Embedding-Small-English-R2#

Model Summary: Granite-embedding-small-english-r2 is a 47M parameter dense biencoder embedding model from the Granite Embeddings collection that can be used to generate high quality text embeddings. This model produces embedding vectors of size 384 based on context length of upto 8192 tokens. Compared to most other open-source models, this model was only trained using open-source relevance-pair datasets with permissive, enterprise-friendly license, plus IBM collected and generated datasets.

The r2 models show strong performance across standard and IBM-built information retrieval benchmarks (BEIR, ClapNQ), code retrieval (COIR), long-document search benchmarks (MLDR, LongEmbed), conversational multi-turn (MTRAG), table retrieval (NQTables, OTT-QA, AIT-QA, MultiHierTT, OpenWikiTables), and on many enterprise use cases.

These models use a bi-encoder architecture to generate high-quality embeddings from text inputs such as queries, passages, and documents, enabling seamless comparison through cosine similarity. Built using retrieval oriented pretraining, contrastive finetuning, knowledge distillation, and model merging, granite-embedding-small-english-r2 is optimized to ensure strong alignment between query and passage embeddings.

The latest granite embedding r2 release introduces two English embedding models, both based on the ModernBERT architecture:

  • granite-embedding-english-r2 (149M parameters): with an output embedding size of 768, replacing granite-embedding-125m-english.
  • granite-embedding-small-english-r2 (47M parameters): A first-of-its-kind reduced-size model, with 8192 context length support, fewer layers and a smaller output embedding size (384), replacing granite-embedding-30m-english.

Model Details#

Usage#

Intended Use: The model is designed to produce fixed length vector representations for a given text, which can be used for text similarity, retrieval, and search applications.

Usage with Transformers.js:

This is a simple example of how to use the granite-embedding-small-english-r2 model with the Transformers.js library.

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

The model can then be used to encode pairs of text

import { AutoModel, AutoTokenizer, matmul } from "@huggingface/transformers";

// Download from the 🤗 Hub
const model_id = "onnx-community/granite-embedding-small-english-r2-ONNX";
const tokenizer = await AutoTokenizer.from_pretrained(model_id);
const model = await AutoModel.from_pretrained(model_id, {
  dtype: "fp32", // Options: "fp32" | "fp16" | "q8" | "q4" | "q4f16"
});

// Prepare queries and documents
const input_queries = [
  " Who made the song My achy breaky heart? ",
  "summit define",
];
const input_passages = [
  "Achy Breaky Heart is a country song written by Don Von Tress. Originally titled Don't Tell My Heart and performed by The Marcy Brothers in 1991. ",
  "Definition of summit for English Language Learners. : 1 the highest point of a mountain : the top of a mountain. : 2 the highest level. : 3 a meeting or series of meetings between the leaders of two or more governments.",
];
const inputs = await tokenizer([...input_queries, ...input_passages], {
  padding: true,
});

// Generate embeddings
const { sentence_embedding } = await model(inputs);
const normalized_sentence_embedding = sentence_embedding.normalize();

// Compute similarities
const scores = await matmul(
  normalized_sentence_embedding.slice([0, input_queries.length]),
  normalized_sentence_embedding
    .slice([input_queries.length, null])
    .transpose(1, 0),
);
const scores_list = scores.tolist();
console.log(scores_list);
// [
//  [ 0.8931542634963989, 0.6678562164306641 ],
//  [ 0.712432324886322, 0.8434768915176392 ]
// ]

Evaluation Results#

Granite embedding r2 models show a strong performance across tasks diverse tasks.

Performance of the granite models on MTEB Retrieval (i.e., BEIR), MTEB-v2, code retrieval (CoIR), long-document search benchmarks (MLDR, LongEmbed), conversational multi-turn (MTRAG), table retrieval (NQTables, OTT-QA, AIT-QA, MultiHierTT, OpenWikiTables), benchmarks is reported in the below tables.

The average speed to encode documents on a single H100 GPU using a sliding window with 512 context length chunks is also reported. Nearing encoding speed of 200 documents per second granite-embedding-small-english-r2 demonstrates speed and efficiency, while mainintaining competitive performance.

ModelParameters (M)Embedding SizeBEIR Retrieval (15)MTEB-v2 (41)CoIR (10)MLDR (En)MTRAG (4)Encoding Speed (dosc/sec)
granite-embedding-125m-english12576852.362.150.335.049.4149
granite-embedding-30m-english3038449.160.247.032.648.6198
granite-embedding-english-r214976853.162.855.340.756.7144
granite-embedding-small-english-r24738450.961.153.839.848.1199
ModelParameters (M)Embedding SizeAVERAGEMTEB-v2 Retrieval (10)CoIR (10)MLDR (En)LongEmbed (6)Table IR (5)MTRAG (4)Encoding Speed (docs/sec)
e5-small-v23338445.3948.547.129.940.772.3133.8138
bge-small-en-v1.53338445.2253.945.831.432.169.9138.2138
granite-embedding-english-r214976859.556.454.841.667.878.5357.6144
granite-embedding-small-english-r24738455.653.953.440.161.975.5148.9199
Model Architecture and Key Features#

The latest granite embedding r2 release introduces two English embedding models, both based on the ModernBERT architecture:

  • granite-embedding-english-r2 (149M parameters): with an output embedding size of 768, replacing granite-embedding-125m-english.
  • granite-embedding-small-english-r2 (47M parameters): A first-of-its-kind reduced-size model, with fewer layers and a smaller output embedding size (384), replacing granite-embedding-30m-english.

The following table shows the structure of the two models:

Modelgranite-embedding-small-english-r2granite-embedding-english-r2
Embedding size384768
Number of layers1222
Number of attention heads1212
Intermediate size15361152
Activation FunctionGeGLUGeGLU
Vocabulary Size5036850368
Max. Sequence Length81928192
# Parameters47M149M
Training and Optimization#

The granite embedding r2 models incorporate key enhancements from the ModernBERT architecture, including:

  • Alternating attention lengths to accelerate processing
  • Rotary position embeddings for extended sequence length
  • A newly trained tokenizer optimized with code and text data
  • Flash Attention 2.0 for improved efficiency
  • Streamlined parameters, eliminating unnecessary bias terms

Data Collection#

Granite embedding r2 models are trained using data from four key sources:

  1. Unsupervised title-body paired data scraped from the web
  2. Publicly available paired with permissive, enterprise-friendly license
  3. IBM-internal paired data targetting specific technical domains
  4. IBM-generated synthetic data

Notably, we do not use the popular MS-MARCO retrieval dataset in our training corpus due to its non-commercial license (many open-source models use this dataset due to its high quality).

The underlying encoder models using GneissWeb, an IBM-curated dataset composed exclusively of open, commercial-friendly sources.

For governance, all our data undergoes a data clearance process subject to technical, business, and governance review. This comprehensive process captures critical information about the data, including but not limited to their content description ownership, intended use, data classification, licensing information, usage restrictions, how the data will be acquired, as well as an assessment of sensitive information (i.e, personal information).

Infrastructure#

We trained the granite embedding english r2 models using IBM's computing cluster, BlueVela Cluster, which is outfitted with NVIDIA H100 80GB GPUs. This cluster provides a scalable and efficient infrastructure for training our models over multiple GPUs.

Ethical Considerations and Limitations#

Granite-embedding-small-english-r2 leverages both permissively licensed open-source and select proprietary data for enhanced performance. The training data for the base language model was filtered to remove text containing hate, abuse, and profanity. Granite-embedding-small-english-r2 is trained only for English texts, and has a context length of 8192 tokens (longer texts will be truncated to this size).

Citation#

@misc{awasthy2025graniteembeddingr2models,
      title={Granite Embedding R2 Models}, 
      author={Parul Awasthy and Aashka Trivedi and Yulong Li and Meet Doshi and Riyaz Bhat and Vignesh P and Vishwajeet Kumar and Yushu Yang and Bhavani Iyer and Abraham Daniels and Rudra Murthy and Ken Barker and Martin Franz and Madison Lee and Todd Ward and Salim Roukos and David Cox and Luis Lastras and Jaydeep Sen and Radu Florian},
      year={2025},
      eprint={2508.21085},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2508.21085}, 
}

Files

16 files · 504 MBWeights 52.5 MB (smallest of 5 ONNX variants). Sizes and sha256 from the signed manifest.
Hide all 16 files with their sha256
FileSizesha256
.gitattributes1.83 KBba44193cf00eb237e2824cbfa212775d626f48f7c4caa3e630deda0908552db2
README.md11.5 KB99162b472dbdbbda16424dadb484be941bcb7df1b0077808e961386e53485c55
config.json1.53 KB1a1710c20911da8c96179716bf44058e54cca6fa7952cce77be83ef05edae3ee
onnx/model.onnx183 KBcddb145cd1147ec24a3908b2ca2602b98b20a3d198365cff270b7cb26c98179e
onnx/model.onnx_data195 MB86a3a705d4598615894d89540ea71a3d9bbdb17a315e79edcd5dfc737222834b
onnx/model_fp16.onnx201 KBee200de55cb2f94e858aabca54be7697a9c0805a14c858ee26ad0922b05f57d7
onnx/model_fp16.onnx_data97.4 MB28d16e29cd623f25cc6fa0968700c5bc31036466091a5fa06d1353c1777f050e
onnx/model_q4.onnx213 KB3a27c53213858379e4938858d8c72711f3792dd2c00cf1bd08cd65d23b8b36ae
onnx/model_q4.onnx_data99.3 MBac9b1830d3204072803f706581573752f3b80bf4e08e7ff323a7091636cbeaaa
onnx/model_q4f16.onnx231 KB891c487fb1980069dc50d9d554d19cab95e25635b7c868b98beefd7c8c5f8e41
onnx/model_q4f16.onnx_data56.7 MBc4491d4a168f9e92dc7e4a99144bfba8a1d29ff628a4ae8a88bf0a3f439a8cf0
onnx/model_quantized.onnx599 KBa3fad524afc3f060216a8ddbb1ac89c9b6498fba8995b5718bde879076a2e9ba
onnx/model_quantized.onnx_data51.9 MB1f4cf47e4adec7f7ae09db03d071ba8667e07f9a4203142c7efa8d37fe453597
special_tokens_map.json694 Bea97ecdbcc73713039d8d64dbb05e3689495c96657fbd9a18f5bed381be81049
tokenizer.json2.13 MBfeeb83348dcb033bc6b9d2e1f7906ca9eb2d122845000c9416d894d7c2927149
tokenizer_config.json20.8 KBce06781b38bb393db68c9e0709bddd31ef5d88f2c6fbb3fd9f369778fb85e451
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
1dc7835ba0 pinned now manifest updated, same commit2026-11-14 21:31 UTC16 files · 504 MB
1dc7835ba02026-11-14 21:31 UTC16 files · 504 MB

Use it

$ fw get onnx-community/granite-embedding-small-english-r2-ONNX
# manifest sha256 dff65c9ce068… · 504 MB · 16 files
$ fw verify ./granite-embedding-small-english-r2-ONNX onnx-community/granite-embedding-small-english-r2-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-embedding-small-english-r2-ONNX.json --dir ./granite-embedding-small-english-r2-ONNX $ python3 fw.py verify ./granite-embedding-small-english-r2-ONNX ./onnx-community__granite-embedding-small-english-r2-ONNX.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/granite-embedding-small-english-r2-ONNX --revision 1dc7835ba0cb9c76a3618d0bf0c427c97671b3c8 --local-dir ./granite-embedding-small-english-r2-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-14
Text in
README.md
Text sha256
99162b472dbdbbda16424dadb484be941bcb7df1b0077808e961386e53485c55
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-embedding-small-english-r2-ONNXDate: 2026-11-14Commit: 1dc7835Signed: 2DC28CC7B26A283B ✓
Upstream
onnx-community/granite-embedding-small-english-r2-ONNX
Pinned commit
1dc7835ba0cb9c76a3618d0bf0c427c97671b3c8
Manifest
granite-embedding-small-english-r2-ONNX.json · .minisig
Manifest sha256
dff65c9ce06856aea6421e0f59a197333cdb8a4c581c30a3027cc84a4043d9a0
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:31 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/onnx-community/granite-embedding-small-english-r2-ONNX.json $ curl -O https://freeweights.allternit.com/manifests/onnx-community/granite-embedding-small-english-r2-ONNX.json.minisig $ minisign -Vm granite-embedding-small-english-r2-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-embedding-small-english-r2 · 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-embedding-small-english-r2-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-embedding-small-english-r2-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