use case · multi-model · Xenova/texify + SmolLM2-135M-Instruct · WASM q8 · ~460 MB total

Equation-to-Plain-English Math Tutor

Chain two specialised on-device WASM models in separate Web Workers — reusing the shared SmolLM2-135M-Instruct worker and cache so zero weights are duplicated. Stage 1 (Xenova/texify, ~320 MB) reads an equation image into exact LaTeX, then Stage 2 (HuggingFaceTB/SmolLM2-135M-Instruct, ~140 MB) streams a plain-English explanation of what the formula means and what each variable stands for.

1 · Two on-device WASM models (isolated Web Workers)

Stage 1 · Xenova/texify (~320 MB)

image-to-text · Donut-Swin + mBART (WASM q8)

Stage 2 · SmolLM2-135M-Instruct (~140 MB)

text-generation · ChatML LLM (WASM q8 · shared worker)

2 · Pick an equation image (Stage 1: Image → LaTeX)

Selected: Quadratic formula

Selected equation image for Stage 1 OCR
Typeset preview appears after Stage 1 OCR.

3 · Plain-English math explanation (Stage 2: LaTeX → Tutor)

Load Stage 1 (Xenova/texify) and Stage 2 (SmolLM2-135M-Instruct) above to run the full tutor pipeline.

Click “Read & Explain Equation” once both models are ready to see Stage 1 extract LaTeX and Stage 2 stream a plain-English explanation here.

Honest calibration: SmolLM2-135M-Instruct is a tiny 135M-parameter model running locally on WebAssembly CPU. It gives quick private intuition for standard formulas, but tiny models can occasionally make algebraic slips — always verify details against the typeset LaTeX above.

Stage 1 OCR: — Stage 2 Tutor: — Stage 2 tokens: — Stage 2 speed: — Total pipeline: —
See inside — exact Stage 1 → Stage 2 prompt passed to SmolLM2-135M
Run Stage 2 to inspect the exact system/user ChatML prompt.

Inspect the Stage 2 prompt builder

Show buildExplainPrompt()