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-2609 at revision b90468c1.
  • Builder: onnxruntime-genai 0.15.2 model builder, -p int4 -e webgpu, with exclude_embeds=false prune_lm_head=true. The int4 weights use the builder defaults: symmetric, block size 32, accuracy_level 4.
  • Rotary caches stay fp32. The model has tied embeddings. In that case the builder quantizes every Gather in the graph, which includes the rotary cos/sin caches. The six cache Gather nodes are passed in nodes_to_exclude.
  • Adaptation for Transformers.js 4.3.0:
    1. The position_ids input is removed. The graph derives the positions from attention_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.
    2. The hybrid state tensors are renamed to past_conv.N, past_recurrent.N, present_conv.N and present_recurrent.N.
    3. The nested text_config is moved to the top level of config.json.
    4. generation_config.json is added. Transformers.js reads stop tokens only from the configs, and the source config names only <|endoftext|>.

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 no Scan or Loop.
  • 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
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for RASMUS/FrogNano-4B-2609-ONNX

Quantized
(23)
this model