← All models

text-generation · text · WASM · ~350 MB

BLOOMZ-560m — a multilingual instruction model

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.

At a glance

ModelXenova/bloomz-560m — ONNX export of bigscience/bloomz-560m
Tasktext-generation — plain prompt → completion (no chat template)
ArchitectureBLOOM decoder — ALiBi positional bias, 250 680-token multilingual BPE vocab, ~560M params
FinetuningxP3 multitask prompts → follows instructions across 46 languages, zero-shot
Quantizationq8 (8-bit) — legacy ONNX layout (onnx/decoder_model_merged_quantized.onnx)
Runtime / backendTransformers.js · WebAssembly (runs anywhere; WebGPU used as an optional accelerator)
Download~350 MB, cached after first load
LicenseBigScience RAIL v1.0 (open, with use-based restrictions)
Web APIsWebAssembly, Web Workers, (optional WebGPU) — all Baseline widely available

Run it

Write an instruction in any language and BLOOMZ completes it, token by token. Try one of the multilingual examples, or your own.

The completion will stream here.

See inside — next-token probabilities

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.

Why it matters

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.

Use cases

Basics

Prompt in any language and watch BLOOMZ complete it, token by token.

Practical

A zero-shot multilingual toolbox: translate, summarise, and classify from templated prompts.

Wild

Greedy vs. sampled: run the same prompt both ways and watch the branches diverge.

Multi-model

MiniLM → BLOOMZ: retrieve the most relevant note with embeddings, then let BLOOMZ answer from it (RAG).

How the API works

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".

References