Skip to content

text-generation · text · Qwen3ForCausalLM · Transformers.js 3.7.5 CPU WASM · int8 · 368.5 MB · Apache-2.0

MNN-Pocket 0.3B — a pocket-sized Qwen3 LLM on plain CPU WASM

Alibaba's compact on-device instruct model, onnx-community/MNN-Pocket-0.3B-ONNX (text-generation, 28 layers × 896d, GQA 14:2, 40k context, Apache-2.0), streams tokens entirely in this tab on the shared Transformers.js 3.7.5 runtime using the 368.5 MB int8 ONNX on CPU WASM — no GPU, no server, no upload.

onnx-community/MNN-Pocket-0.3B-ONNX text-generation WASM · int8 · 368.5 MB Apache-2.0

Run it — streaming edge assistant

preset text
96
0.0 (greedy)
1.10

Choose a preset — the model initialises above.

Live token stream

Output streams here token by token.

At a glance

Repository
onnx-community/MNN-Pocket-0.3B-ONNX (base taobao-mnn/MNN-Pocket-0.3B)
Task / API
text-generation · AutoTokenizer + AutoModelForCausalLM.generate()
Architecture
Qwen3ForCausalLM · 28 layers · 896 hidden · 14 heads / 2 KV heads · head_dim 64 · FFN 2560 · tied embeddings
Context / vocab
40,960 positions (32K deployed) · 65,536 tokens
Weights loaded
onnx/model_int8.onnx 363,746,041 B + tokenizer/config 4,773,412 B = 368.5 MB
Revision
e16a91daf9a044ed57a28692837d20cd2a75a08f
License
Apache-2.0
Runtime
Shared Transformers.js 3.7.5 (lib/webai.js) — zero local override
Backend / dtype
CPU WASM · int8 (dedicated module Web Worker)
Special tokens
<|im_start|> 65511 · <|im_end|> 65512 (EOS) · <|endoftext|> 65510 (EOS/pad) · <think> 65534
Stage 0 speed
~57.1 decode tok/s, TTFT ~139 ms (CPU WASM int8, 3.7.5)
Why not WebGPU
WebGPU int8 decodes ~9.1 tok/s — ~5.8× slower than CPU WASM int8 on the same 4.3.2 runtime; the q4f16 export overflows fp16 into repeated backticks
Baseline APIs
WebAssembly (SIMD), Web Workers, Cache Storage, File API

Why a 0.3B edge model matters

How the API works

Show the code — worker.js generateCompletion(): ChatML → generate() with TextStreamer + InterruptableStoppingCriteria
Show the code — mnn-core.mjs buildChatMlPrompt(): the chat_template.jinja ChatML rendering

Use-case ladder

References