At a glance
| 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
Live Streamed Output
Thinking trace (<think>)
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
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:
- Zero-egress document & chart triage: read receipts, invoices, dashboards, and field photos locally into validated JSON or CSV ledgers.
- 4× leaner KV-cache architecture: 18 of 24 decoder layers run constant-state linear attention, leaving GPU VRAM headroom for dynamic ViT vision patches.
- Unified multimodal + text engine: switch between image-grounded VQA and pure text reasoning inside a single cached model.
- Deterministic OCR + VLM verification: chain lightweight 21.5 MB CPU WASM OCR (
PP-OCRv5 Mobile) into Qwen3.5-0.8B to ground numbers and catch vision hallucinations.
Use-case ladder
1. Basics · Visual Q&A + Text vs Multimodal Chat
Compare Text-Only vs Image+Text chat in one unified Qwen3.5-0.8B session with warm-cache auto-init and streaming metrics.
2. Practical · Batch Receipt / Chart / Scene Triage
Pause, Resume, or Cancel a multi-scene extraction queue and export OWASP formula-safe .csv, .json, and .md reports.
3. Wild · Hallucination & Decoding Sensitivity Lab
Stress-test full vs low-res vs cropped vs occluded images, plus repetition-penalty and greedy-vs-sampled determinism checks.
4. Multi-model · PP-OCRv5 Mobile → Qwen3.5-0.8B
Chain 21.5 MB deterministic CPU WASM OCR bounding boxes directly into 666.1 MB Qwen3.5-0.8B to compare raw vs OCR-grounded JSON.
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.