text-generation Β· hybrid-reasoning chat LLM Β· WebLLM (MLC) Β· WebGPU Β· ~1.1 GB
Qwen3 is the first model in this catalogue that can think out loud on demand. It's
a single 1.7B model with two modes: flip thinking on and it emits a
<think>β¦</think> chain of reasoning before answering β you watch the trace
stream live β or flip it off for a fast, direct reply. One model, two behaviours,
toggled with Qwen3's /think and /no_think switches. It runs entirely in
your browser on MLC's WebLLM engine: streaming tokens, sampling controls, a real
system prompt, nothing uploaded and no API bill. WebGPU only β a ~1.1 GB download, cached after
first load.
| Model | Qwen/Qwen3-1.7B |
|---|---|
| MLC build | Qwen3-1.7B-q4f16_1-MLC |
| Runtime | WebLLM / MLC β not Transformers.js. Weights are precompiled to WebGPU shaders. |
| Task | text-generation (instruction-tuned, hybrid reasoning) |
| Params / dtype | 1.7B Β· q4f16_1 (4-bit weights, fp16 compute) |
| Thinking control | /think Β· /no_think soft switch appended to the last user turn β one model, two modes |
| Chat template | Qwen ChatML β real system role (no folding needed), plus a <think> reasoning segment in thinking mode |
| Backend | WebGPU only β no WASM fallback. Gated on a real GPU adapter. ~2 GB GPU memory. |
| Download | ~1.1 GB, cached after first load |
| Context window | 4096 tokens (MLC build cap) |
| License | Apache 2.0 |
| Web APIs | WebGPU, Web Workers, ES module imports |
How it differs from the other chat pages: Qwen3 is a hybrid reasoning model β the only one here that exposes an explicit, toggleable chain-of-thought β and a distinct Qwen architecture (Apache-2.0) from Alibaba, separate from the Gemma-family (Gemma 3 1B), Mistral (Mistral 7B) and Llama-family models. It's also newer than the Qwen2.5 0.5B WASM page: a bigger, reasoning-capable successor that runs on the GPU.
Heads up: loading transfers ~1.1 GB the first time (then it's cached). Best on a GPU with β₯2 GB of memory.
<think> trace before answering (/think).
A reasoning model spends tokens in two places: the <think> trace (private reasoning you'd normally never see) and the answer. The split below is measured live. Turn thinking off and the reasoning count drops to zero and the reply comes faster β thinking trades latency and tokens for better answers on hard prompts. Time-to-first-token is the prefill cost; everything after is decode. WebLLM reuses a KV cache across turns.
Send a message to see the messages array that WebLLM receives.
Reasoning models were, until recently, a server-side, premium-API affair. Qwen3 on WebLLM puts a genuinely capable hybrid reasoner on the client: for easy prompts you turn thinking off and get a fast reply; for hard ones β multi-step maths, planning, careful extraction β you turn it on and the model works through the problem in a visible trace before committing to an answer. All of it private by construction, free to run, and available offline once cached.
A clean streaming chat with the thinking toggle β the fundamental loop.
Reasoned extraction: strict JSON and step-by-step problem solving with the trace on.
Thinking on vs off β the SAME hard prompt run both ways, side by side, to see what reasoning buys.
RAG: MiniLM retrieves from a pasted doc, Qwen3 reasons over the passages and answers grounded.
WebLLM gives you an OpenAI-shaped chat API backed by a WebGPU engine. You create the engine
(which downloads and compiles the weights), then stream a completion. Qwen3 has a real
system role, so no folding is needed; the hybrid mode is selected by appending
/think or /no_think to the last user turn. In thinking mode the model
streams a <think>β¦</think> segment (or, on some builds, a separate
reasoning_content delta) before the answer β this page separates the two streams in
worker.js:
import { webGPUAdapterAvailable, createEngine }
from "/lib/webllm.js";
// WebLLM is WebGPU-only β gate before doing anything (headless requestAdapter() β null).
if (!(await webGPUAdapterAvailable())) {
showNeedsWebGPU(); // never a faked reply
} else {
const engine = await createEngine({
model: "Qwen3-1.7B-q4f16_1-MLC",
onProgress: (p) => setProgress(p.text, p.progress), // ~1.1 GB, cached after first load
});
const thinking = true; // per-request toggle
const messages = [
{ role: "system", content: "You are a concise assistant." },
{ role: "user", content: "Is 97 prime? " + (thinking ? "/think" : "/no_think") },
];
const stream = await engine.chat.completions.create({
messages, temperature: 0.7, top_p: 0.8, max_tokens: 512, stream: true,
});
for await (const chunk of stream) {
const d = chunk.choices[0].delta;
if (d.reasoning_content) appendReasoning(d.reasoning_content); // the <think> trace
if (d.content) appendAnswer(d.content); // the final answer
}
// engine.interruptGenerate() stops decoding early; engine.runtimeStatsText() reports tok/s.
}
Everything here runs exactly that path in worker.js, and gates on a real WebGPU
adapter first. No adapter β a labelled needs-WebGPU state, never a canned answer.