image-text-to-text · Qwen3_5ForConditionalGeneration · WebGPU q4f16 (666.1 MB) · Apache-2.0

Qwen3.5-0.8B — Hybrid Linear+Gated Attention Multimodal VLM

Alibaba's compact 0.8B-parameter native vision-language model (Qwen/Qwen3.5-0.8B → onnx-community/Qwen3.5-0.8B-ONNX, 666.1 MB WebGPU q4f16, Apache-2.0). Pairs a 12-layer dynamic-resolution ViT (patch 16, 2×2 spatial merge) with a 24-layer hybrid decoder alternating 18 Gated DeltaNet linear-attention layers and 6 full gated-attention GQA layers (248,320 vocab, 262,144 context) running 100% locally in a Web Worker.

At a glance

Verified model card and HF Hub ONNX metadata for Qwen/Qwen3.5-0.8B
Upstream model Qwen/Qwen3.5-0.8B (Alibaba Qwen Team — native multimodal image + text + optional <think> reasoning)
Browser ONNX repo onnx-community/Qwen3.5-0.8B-ONNX (q4f16 total 666,079,025 B / 666.1 MB: vision_encoder_q4f16 62.13 MB + embed_tokens_q4f16 147.01 MB + decoder_model_merged_q4f16 437.70 MB + tokenizer/configs 19.24 MB; auto-falls back to q4 736.9 MB when WebGPU lacks shader-f16)
License Apache-2.0 (commercial & open-source friendly)
Task & architecture image-text-to-text · Qwen3_5ForConditionalGeneration (model_type: qwen3_5) · 24 decoder layers = 18 linear attention (Gated DeltaNet, conv kernel 4, 16 K/V heads × 128-d) + 6 full gated attention (GQA 8:2, head_dim 256, every 4th layer: L4–L24) · 1024-d hidden · 248,320 vocab · 262,144 max context
Vision encoder 12-layer ViT (768-d, 12 heads, patch_size: 16, spatial_merge_size: 2 → 1 merged <|image_pad|> token per 32×32 px block, projected to 1024-d)
Decoding defaults repetition_penalty: 1.15 · greedy (do_sample: false) by default with optional <think> reasoning trace toggle & live token streaming
Runtime & backend WebGPU (Transformers.js 4.3.2, isolated locally in worker.js; shared lib/webai.js untouched) · resumable SHA-256 prefetch into transformers-cache

1. Multimodal Image + Text VLM Workbench

Pick a zero-person starter scene or procedural plate below, drop an image here, or paste from clipboard (Ctrl/⌘+V). All visual encoding and token generation stay strictly on your GPU.

Initialise Qwen3.5-0.8B on WebGPU above to stream multimodal image + text generation locally.

Active Image Input & ViT Patch Grid

Scene: Survey Bar Chart Estimated ViT tokens: –

Live Streamed Output

Model output will stream token-by-token here once Qwen3.5-0.8B runs.
Backend / Dtype–
TTFT–
Decode Speed–
Vision Tokens–
Text / Output Tok–
image_grid_thw–
Repetition Penalty1.15
Tensor NaN Count–

See Inside · 24-Layer Hybrid Attention & Token Prompt Anatomy

Instead of 24 quadratic full-attention KV caches, Qwen3.5-0.8B alternates 3 Gated DeltaNet linear-attention layers (constant recurrent + conv-4 state) with 1 full gated-attention GQA layer (every 4th layer: L4, L8, L12, L16, L20, L24) — cutting full KV-cache layers by 4× (75% linear, 25% full).

Live Token Budget & Latency Breakdown

Raw ChatML Image + Text Prompt Inspector

Run inference to inspect the exact ChatML special tokens (<|im_start|>, <|vision_start|>, <|image_pad|>, <|vision_end|>) fed to the processor.

Why Qwen3.5-0.8B matters in the browser

Packing native vision encoding, 262k-context hybrid attention, optional chain-of-thought <think> reasoning, and structured JSON generation into a 666.1 MB Apache-2.0 WebGPU checkpoint unlocks practical multimodal tools with zero cloud API spend:

Use-case ladder

How the API works

Load AutoProcessor and Qwen3_5ForConditionalGeneration from onnx-community/Qwen3.5-0.8B-ONNX inside a dedicated Web Worker pinned locally to Transformers.js 4.3.2 on WebGPU q4f16 (or q4 without shader-f16), build ChatML messages with { type: "image" }, and stream tokens with repetition_penalty: 1.15.

Show the code — worker.js: runGenerate() (multimodal + text-only streaming with Qwen3_5ForConditionalGeneration)

References