text-generation · 406.08 MB ONNX (408.19 MB total) · WASM q4 · 125M · 12 layers · Non-Commercial Research

Meta OPT-125M — 12-Layer Causal BPE Streaming Workbench

facebook/opt-125m (ONNX export Xenova/opt-125m, OPT-175B Non-Commercial Research License) is Meta AI's 125M-parameter Open Pretrained Transformer (12 Pre-LayerNorm decoder layers, 768 hidden, 12 attention heads, 3,072 ReLU FFN, 50,272 byte-level BPE vocab, max_position_embeddings=2048) — streaming live next-token continuations in CPU WebAssembly via TextStreamer.

Upstream Card facebook/opt-125m
Loaded ONNX ID Xenova/opt-125m
Task & Arch text-generation · OPTForCausalLM
Weights & Quant 406.08 MB ONNX (408.19 MB) · WASM q4
Dimensions 12 layers · 768d · 12 heads · 2048 ctx
Vocab & License 50,272 BPE · Non-Commercial (other)

1. Causal BPE Next-Token Streaming Workbench

Pretrained base completion model + verified WASM q4 path: OPT-125M runs pipeline("text-generation", "Xenova/opt-125m", { device: "wasm", dtype: "q4" }) off the main thread via shared @huggingface/transformers@3.7.5. (Note: the repo's q8/int8 126.66 MB graph fails in ONNX Runtime Web at /decoder/layers.0/fc1/Gemm_MatMul_quant with a MatMul dimension mismatch, so q4 406.08 MB is the verified runnable WASM build.) Special tokens: </s> BOS/EOS/UNK (ID 2), <pad> (ID 1), add_bos_token=true.

Choose an essay, research, code, story, or news prefix:

Upload, drop, or paste a local file (.txt, .md, .csv, .json, .jsonl) File contents stay 100% on your device. Drag-and-drop or press Ctrl/Cmd+V outside text fields.
First-token (TTFT)–
Decode speed–
In + Out / 2048–
Total latency–
NaN check–
Backend / dtypeWASM · q4

Live Streamed Continuation

Idle
Initialise OPT-125M above to stream causal BPE tokens locally on WebAssembly.

2. See Inside: 50,272-Vocab Next-Token Logits & OPT BPE Tokens

OPT-125M tokenizes text with a 50,272-entry byte-level BPE vocabulary (GPT-2 merges plus RoBERTa-style </s> ID 2 prepended as BOS), where spaces become Ġ (U+0120) and newlines become Ċ (U+010A). Inspect live forward-pass logits, Shannon entropy H(P), effective branching perplexity 2H, and token boundaries below.

Next-Token Candidate Probabilities

Entropy –

Full 50,272-vocab Shannon entropy H(P) and branching factor 2^H will appear after a live forward pass.

Run a prompt above to inspect live logits from pipe.model(inputs).

BPE Whitespace (Ġ) & </s> Inspector

Space prefix (Ġ) Subword continuation Newline (Ċ) Special (</s> ID 2)

Tokenization breakdown will appear after running OPT-125M.

Run generation to inspect </s> BOS, Ġ whitespace, and subword splits.

3. Why OPT-125M Matters · Use-Case Ladder & Source

Trained by Meta AI on 180B tokens (800 GB across BookCorpus, CC-Stories, The Pile, Reddit, and CCNewsV2) to enable open reproducible research into causal scaling, decoding traps, and bias/toxicity audits, OPT-125M pairs a 2,048-token context window with 12 Pre-LayerNorm ReLU decoder blocks. Explore all 4 downstream ladder routes:

Show the code — worker.js ensureLoaded() shared Transformers.js pipeline init
Show the code — worker.js runSingleGeneration() TextStreamer + BPE + real nanCount