← All models

text-generation Β· chat LLM Β· WebLLM (MLC) Β· WebGPU Β· ~1.9 GB

Llama 3.2 3B β€” the bigger chat model, still on your GPU

This is Meta's Llama 3.2 3B β€” the larger sibling of the 1B chat page β€” running entirely in your browser. MLC's WebLLM engine compiles it to WebGPU shaders; you get streaming tokens, sampling controls, a real system role and full conversation history, with nothing uploaded and no API bill. Roughly triple the parameters buys noticeably steadier instruction-following, tool-routing and structured output β€” at a ~1.9 GB download and a real GPU requirement (no WASM fallback).

At a glance

Modelmeta-llama/Llama-3.2-3B-Instruct
MLC buildLlama-3.2-3B-Instruct-q4f16_1-MLC
RuntimeWebLLM / MLC β€” not Transformers.js. Weights are precompiled to WebGPU shaders.
Tasktext-generation (instruction-tuned chat)
Params / dtype3.21B Β· q4f16_1 (4-bit weights, fp16 compute)
BackendWebGPU only β€” no WASM fallback. Gated on a real GPU adapter.
Download~1.9 GB, cached after first load Β· needs β‰ˆ2.3 GB GPU memory
Context window4096 tokens (MLC prebuilt config)
LicenseLlama 3.2 Community License
Web APIsWebGPU, Web Workers, ES module imports

Heavier than the 1B build: on a GPU with under ~3 GB free it may fail to allocate. If your device can't run it, the page shows an honest needs-WebGPU / needs-more-memory state β€” and the lighter Llama 3.2 1B page is the fallback.

Run it β€” chat

The conversation will appear here. The model auto-loads if it's already cached; otherwise use Download above, then say hello.
History is kept in-tab only β€” reloading forgets it.

See inside

An LLM does two very different jobs per turn: it prefills your whole prompt (fast, parallel) and then decodes the answer one token at a time (the part you watch stream). The split below is measured live β€” time-to-first-token is essentially the prefill cost; everything after is decode. WebLLM reuses a KV cache across turns, so later replies in the same conversation reprocess less of the history. A 3B model decodes fewer tokens/second than the 1B, but each token is drawn from a stronger distribution β€” the numbers here are the real trade.

decode speed
–
time to first token
–
decode time
–
generated
–
context used (est.)
–
total time
–

Exact chat messages sent to the model (last turn)

Send a message to see the messages array that WebLLM receives.

Why it matters

The 1B model is a great "instant, everywhere" chat brain; the 3B is what you reach for when the task needs to be right more often β€” following a multi-step instruction, emitting a clean tool call, staying in character. Both run client-side: private by construction, free to run, and available offline once the weights are cached. Picking the size is a real product decision, and this page lets you feel the difference on your own hardware.

Use cases

Basics

A clean streaming chat β€” the fundamental "talk to the model" loop, now with 3B headroom.

Practical

Tool router: the model reads a request and emits a strict JSON function call β€” the core of a local agent.

Wild

Text-adventure game master β€” a persona that tracks an evolving world and reacts to your choices.

Multi-model

RAG: MiniLM retrieves from a pasted doc, Llama 3.2 3B answers grounded in it.

How the API works

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. This page uses the shared helpers in lib/webllm.js, running inside a Web Worker so the UI stays responsive:

import { webGPUAdapterAvailable, createEngine, streamChat }
  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: "Llama-3.2-3B-Instruct-q4f16_1-MLC",
    onProgress: (p) => setProgress(p.text, p.progress),   // ~1.9 GB, cached after first load
  });

  const messages = [
    { role: "system", content: "You are a concise, helpful assistant." },
    { role: "user",   content: "Explain WebGPU in one sentence." },
  ];

  const full = await streamChat(
    engine,
    { messages, temperature: 0.7, top_p: 0.95, max_tokens: 320 },
    (delta) => appendToken(delta),          // streams token-by-token on your GPU
  );
  // 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. The 3B build id (Llama-3.2-3B-Instruct-q4f16_1-MLC) is verified present in WebLLM's prebuiltAppConfig.

References