text-generation Β· chat LLM Β· WebLLM (MLC) Β· WebGPU Β· ~4 GB
The strongest model in this showcase, running entirely in your browser. Mistral 7B Instruct v0.3 (7.2B parameters) is compiled to WebGPU by MLC's WebLLM engine β you get streaming tokens, sampling controls, a system prompt and full conversation history, with nothing uploaded and no API bill. Seven billion parameters is a lot to move: it's a ~4 GB download and needs a capable GPU, with no WASM fallback. In return you get noticeably stronger reasoning and instruction-following than the smaller chat models here.
| Model | mistralai/Mistral-7B-Instruct-v0.3 |
|---|---|
| MLC build | Mistral-7B-Instruct-v0.3-q4f16_1-MLC |
| Runtime | WebLLM / MLC β not Transformers.js. Weights are precompiled to WebGPU shaders. |
| Task | text-generation (instruction-tuned chat) |
| Params / dtype | 7.2B Β· q4f16_1 (4-bit weights, fp16 compute) |
| Chat template | [INST] β¦ [/INST] β no system role (folded into the first instruction) |
| Backend | WebGPU only β no WASM fallback. Gated on a real GPU adapter. ~4.5 GB GPU memory. |
| Download | ~4 GB, cached after first load β the heaviest model in the catalogue |
| Context window | 4096 tokens (MLC build cap; the base model supports more) |
| License | Apache 2.0 |
| Web APIs | WebGPU, Web Workers, ES module imports |
How it differs from the other chat pages: it's the largest and most capable model in the catalogue and a Mistral architecture (Apache-2.0), distinct from the Llama-family (Llama 3.2 1B), Gemma-family (Gemma 2 2B) and StableLM (StableLM 2 Zephyr 1.6B) models. The trade-off is weight: at ~4 GB it asks for a real GPU and a serious download, where the smaller models reach more devices.
Heads up: loading transfers ~4 GB the first time (then it's cached). Only start the download on a fast connection and a GPU with β₯5 GB of memory.
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. A 7B model decodes fewer tokens per second than the smaller ones here β the readout makes that trade-off concrete. WebLLM reuses a KV cache across turns, so later replies reprocess less of the history.
Send a message to see the messages array that WebLLM receives.
A 7B model was, until recently, firmly server-side: an API key, a GPU instance, and a per-token bill. Mistral 7B Instruct on WebLLM puts a genuinely capable reasoning model on the client β private by construction, free to run, and available offline once the weights are cached. The cost is honest: a ~4 GB download and a real GPU. When your users have that, you get server-grade quality with no server.
A clean streaming chat β the fundamental "talk to the model" loop.
Reasoning & tool-style prompting: step-by-step plans and a mock function call.
Persona & reasoning role-play β a character that thinks out loud in voice.
RAG: MiniLM retrieves from a pasted doc, Mistral answers grounded in it.
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.
Because Mistral's [INST] template has no system role, we fold the system prompt into
the first instruction:
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: "Mistral-7B-Instruct-v0.3-q4f16_1-MLC",
onProgress: (p) => setProgress(p.text, p.progress), // ~4 GB, cached after first load
});
// Mistral Instruct has no system role β fold it into the first user message.
const messages = [
{ role: "user", content: "You are a concise assistant.\n\nExplain WebGPU in one sentence." },
];
const full = await streamChat(
engine,
{ messages, temperature: 0.7, top_p: 0.95, max_tokens: 256 },
(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.