text-generation Β· instruction-tuned LLM Β· WASM Β· ~140 MB
LaMini-Neo-125M is a tiny GPT-Neo that MBZUAI fine-tuned on 2.6 million instruction-response pairs. It follows simple instructions β explain, summarize, rewrite, draft β with a fraction of the weights of a modern chat model, and it runs on a plain CPU in your browser.
| Model | Xenova/LaMini-Neo-125M (ONNX) Β· original MBZUAI/LaMini-Neo-125M |
|---|---|
| Task | text-generation (instruction following via the LaMini prompt format) |
| Architecture | GPT-Neo β EleutherAI's 125M decoder, instruction-tuned on ~2.6M pairs (GPT4All/Alpaca-style) |
| Params / dtype | 125M Β· int8 (8-bit quantized ONNX) |
| Backend | WebAssembly (CPU) β no GPU required |
| Download | ~140 MB, cached after first load |
| License | CC-BY-NC-4.0 β non-commercial weights (see note below) |
| Web APIs | Web Workers, Cache Storage (via Transformers.js), WebAssembly |
Generated token IDs include special tokens and exclude the prompt; average tok/s includes prefill.
Instruction-tuned models don't chat β they complete a template. LaMini's format is
### Instruction: β¦ followed by ### Response:, and the model continues from
there. The panel below shows the exact template built for your last instruction.
the decoded text stream
Most instruction models need billions of parameters. LaMini shows that 125M parameters tuned on good instruction data can follow simple requests β which makes private, offline instruction following feasible on phones and low-end devices.
The friendly one-liner is the text-generation pipeline:
import { pipeline } from "@huggingface/transformers";
const gen = await pipeline("text-generation", "Xenova/LaMini-Neo-125M", { dtype: "int8" });
const prompt = "### Instruction:\\nExplain photosynthesis simply.\\n\\n### Response:\\n";
const out = await gen(prompt, { max_new_tokens: 96, do_sample: true, temperature: 0.7 });
// out[0].generated_text β the response after the ### Response: marker
The demo streams tokens through a TextStreamer inside a Web Worker, so the page never
blocks β the chips above show decoded text chunks as words become available; the readout counts generated token IDs.