Instructions to use RASMUS/FrogNano-4B-2609-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use RASMUS/FrogNano-4B-2609-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'RASMUS/FrogNano-4B-2609-ONNX');
FrogNano-4B-2609 — ONNX (q4f16, WebGPU)
This is an ONNX export of microsoft/FrogNano-4B-2609
for Transformers.js 4.3.0 on WebGPU.
It is text-only. The export does not include the vision components of the upstream checkpoint.
This is not an official Microsoft release. The model weights and behaviour come from the original model. Read the original model card for the intended use, the limitations, and the responsible-AI guidance.
Files
| File | Size | Content |
|---|---|---|
onnx/model_q4f16.onnx |
0.6 MB | Graph |
onnx/model_q4f16.onnx_data |
1,990,742,016 B | Weights, chunk 1 |
onnx/model_q4f16.onnx_data_1 |
444,579,840 B | Weights, chunk 2 |
config.json |
Text config (qwen3_5_text) and transformers.js_config |
|
generation_config.json |
Stop tokens: `< | |
tokenizer.json, tokenizer_config.json, chat_template.jinja |
From the source, unchanged except that the template is also inlined in tokenizer_config.json |
The weights are in two chunks because Chrome cannot allocate one ArrayBuffer above about 2.145 GB. Each chunk is below 2,000,000,000 bytes.
Usage (Transformers.js)
import { pipeline } from "@huggingface/transformers";
const generator = await pipeline("text-generation", "RASMUS/FrogNano-4B-2609-ONNX", {
dtype: "q4f16",
device: "webgpu",
});
The GPU must support shader-f16.
How the export was made
- Source:
microsoft/FrogNano-4B-2609at revisionb90468c1. - Builder:
onnxruntime-genai0.15.2 model builder,-p int4 -e webgpu, withexclude_embeds=false prune_lm_head=true. The int4 weights use the builder defaults: symmetric, block size 32,accuracy_level4. - Rotary caches stay fp32. The model has tied embeddings. In that case the builder
quantizes every
Gatherin the graph, which includes the rotary cos/sin caches. The six cacheGathernodes are passed innodes_to_exclude. - Adaptation for Transformers.js 4.3.0:
- The
position_idsinput is removed. The graph derives the positions fromattention_mask(Hugging Face convention: cumulative sum minus one, padding set to 1). When the input is declared, Transformers.js 4.3.0 fills it through a Qwen2-VL helper that fails without a vision config. - The hybrid state tensors are renamed to
past_conv.N,past_recurrent.N,present_conv.Nandpresent_recurrent.N. - The nested
text_configis moved to the top level ofconfig.json. generation_config.jsonis added. Transformers.js reads stop tokens only from the configs, and the source config names only<|endoftext|>.
- The
The scripts are in
ONNX_CONVERSION/tools/
(adapt_qwen35_genai_for_tjs.py, repackage_for_tjs.py).
Checks
All checks ran offline with ONNX Runtime on CPU, on the packaged files.
- The graph has the same op profile as a known-good Qwen3.5-4B WebGPU export:
24 linear-attention layers, 8 GQA layers, 249
MatMulNBits, and noScanorLoop. - Cache check, 400-token prompt. A cached one-token decode matches a fresh prefill: KL divergence 0.00041, top-5 overlap 5/5. Three broken controls (wrong positions, positions restarted at 0, no cache) give KL 1.68 or more.
Not measured yet: speed and quality on a real GPU in a browser. This card will receive those numbers after the test.
Licence
The source repository declares license: mit in its Hub metadata, so this export uses MIT.
The table in the source model card says "Apache License 2.0". Read the
source repository for the terms that
apply. FrogNano is derived from Qwen/Qwen3.5-4B.
The upstream copyright and attribution notices apply.
- Downloads last month
- 382
Model tree for RASMUS/FrogNano-4B-2609-ONNX
Base model
microsoft/FrogNano-4B-2609