text-generation · text · WASM · ~350 MB
BLOOMZ is BigScience's multitask-finetuned BLOOM: a distinct decoder family (ALiBi positions, a 250k-token vocab spanning 46 human and 13 programming languages) trained to follow instructions zero-shot — you just write the instruction, in any of its languages, and it completes it. It's a different architecture from every other LLM here (SmolLM, Llama, Qwen, Gemma, Phi…). At 560M it streams a real completion on the universal WebAssembly/CPU path — no GPU, no key, no server. It's small, so facts can be wrong; the point is the multilingual instruction behaviour, run entirely on your device.
| Model | Xenova/bloomz-560m — ONNX export of bigscience/bloomz-560m |
|---|---|
| Task | text-generation — plain prompt → completion (no chat template) |
| Architecture | BLOOM decoder — ALiBi positional bias, 250 680-token multilingual BPE vocab, ~560M params |
| Finetuning | xP3 multitask prompts → follows instructions across 46 languages, zero-shot |
| Quantization | q8 (8-bit) — legacy ONNX layout (onnx/decoder_model_merged_quantized.onnx) |
| Runtime / backend | Transformers.js · WebAssembly (runs anywhere; WebGPU used as an optional accelerator) |
| Download | ~350 MB, cached after first load |
| License | BigScience RAIL v1.0 (open, with use-based restrictions) |
| Web APIs | WebAssembly, Web Workers, (optional WebGPU) — all Baseline widely available |
Write an instruction in any language and BLOOMZ completes it, token by token. Try one of the multilingual examples, or your own.
A language model doesn't "know" its next word — it computes a probability for every token in its 250k vocabulary. This is the real top-12 distribution for the token right after your prompt, from one forward pass on your device. The greedy decoder just takes the top row each step.
BLOOMZ makes multilingual instruction-following a local function call. Because it was tuned on prompts in dozens of languages, it responds to non-English instructions that English-only tiny models struggle with — private, offline, and free of per-token API costs.
Prompt in any language and watch BLOOMZ complete it, token by token.
A zero-shot multilingual toolbox: translate, summarise, and classify from templated prompts.
Greedy vs. sampled: run the same prompt both ways and watch the branches diverge.
MiniLM → BLOOMZ: retrieve the most relevant note with embeddings, then let BLOOMZ answer from it (RAG).
BLOOMZ has no chat template — you instruct it in the prompt itself. This repo ships the legacy split-decoder ONNX, so we name the file explicitly:
import { pipeline, TextStreamer } from "@huggingface/transformers";
const generate = await pipeline("text-generation", "Xenova/bloomz-560m", {
dtype: "q8",
model_file_name: "decoder_model_merged", // legacy layout → decoder_model_merged_quantized.onnx
}); // ~350 MB, cached once
const prompt = "Translate to French: The weather is nice today.";
const streamer = new TextStreamer(generate.tokenizer, { skip_prompt: true });
const out = await generate(prompt, {
max_new_tokens: 64, do_sample: false, repetition_penalty: 1.3, streamer,
});
// out[0].generated_text → "…Aujourd'hui, le temps s'améliore bien."
This page runs exactly that in a Web Worker so token streaming never blocks the UI, and does one extra forward pass for the real next-token probabilities in "See inside".