Qwen3-0.6B ONNX — instrumented for LLM Visualizer
This repository contains the browser-ready ONNX files for LLM Visualizer, an interactive tool for exploring how tokens contribute to attention in a language model.
It is based on onnx-community/Qwen3-0.6B-ONNX, which is an ONNX conversion of Qwen/Qwen3-0.6B. The tokenizer, configuration, and standard ONNX variants are retained from that repository.
What is instrumented?
The additional file onnx/instrumented_int8.onnx
is derived from onnx/model_int8.onnx. It exposes each transformer layer's
post-rotary-embedding query tensor as an additional graph output:
/model/layers.<layer>/attn/q_rotary/RotaryEmbedding/output_0
Qwen3-0.6B has 28 transformer layers, so the instrumented graph adds 28 of these outputs. The model's operators, weights, connections, and normal outputs are otherwise unchanged. LLM Visualizer combines the exposed queries with the model's key/value cache to calculate and display token-contribution data.
The instrumented model is about 618 MB. It is intended for analysis and
visualization; use one of the standard model_*.onnx files when the extra
intermediate outputs are not needed.
Application setup, generation, validation, and deployment are documented in the LLM Visualizer repository.
Direct Transformers.js loading
The instrumented graph can also be loaded directly by selecting
instrumented as the model filename and int8 as the dtype:
import { AutoModelForCausalLM, AutoTokenizer } from '@huggingface/transformers';
const modelId = 'ishamf/Qwen3-0.6B-ONNX-Instrumented';
const tokenizer = await AutoTokenizer.from_pretrained(modelId);
const model = await AutoModelForCausalLM.from_pretrained(modelId, {
dtype: 'int8',
model_file_name: 'instrumented',
});
Model inputs and ordinary generation outputs follow Qwen3's Transformers.js interface. Each forward pass additionally returns the 28 query tensors listed above.
Credits and license
This repository contains a modified ONNX artifact derived from the ONNX Community conversion of Qwen3-0.6B. Refer to those upstream repositories for the model's license, terms, and original documentation.