fill-mask · 139.32 MB WASM q8 · 6-Layer DistilBertForMaskedLM (134M) · 104 Languages · Apache-2.0

DistilmBERT Cased — 6-Layer 104-Language WordPiece Cloze

distilbert/distilbert-base-multilingual-cased (served via onnx-community/distilbert-base-multilingual-cased-ONNX , Apache-2.0) distills 12-layer mBERT down to 6 layers (n_layers: 6, dim: 768, 134M params — half the encoder depth and ~24% smaller at 136.39 MB q8 ONNX + 2.92 MB tokenizer = 139.32 MB WASM download) while keeping mBERT's exact 119,547-token cased WordPiece vocabulary (do_lower_case: false, [MASK] ID 103) across 104 Wikipedia languages.

Upstream Model distilbert/distilbert-base-multilingual-cased
ONNX Artifact onnx-community/distilbert-base-multilingual-cased-ONNX
Pipeline Task fill-mask (DistilBertForMaskedLM)
Size & Quant 139.32 MB · WASM q8 (136.39 MB ONNX + 2.92 MB tok)
Vocab & Mask 119,547 Cased WordPiece · [MASK] (103)
License & Depth Apache-2.0 · 6 layers (½ mBERT) · 768 dim · 104 langs
Half the Depth, Same 119.5K Cased Vocabulary: DistilmBERT keeps do_lower_case: false, tokenize_chinese_chars: true, and ## continuation subwords over [MASK] (ID 103), but drops from 12 layers to n_layers: 6 (134M vs 179M params) for faster, lighter local inference — while sometimes showing higher entropy or cross-script token leakage on lower-resource prompts.

1. 104-Language [MASK] Cloze Completion Workbench

Pick a preset across 8 languages & 3 scripts (including the model card prompt), drag & drop or paste (Ctrl/Cmd+V) a sentence, or type your own single-[MASK] prompt:

Drop a .txt, .md, .csv, or .json file here, or press Ctrl/Cmd+V outside editable inputs. Use [MASK] exactly once on this workbench (use the Wild Lab tab above for multi-mask sentences).
Initialize the model above to fill [MASK] locally.
Inference latency–
Top-1 prediction–
Full-vocab entropy–
Top-K mass / Share–
WordPiece / ## / UNK–
NaN score check–
Backend / dtypeWASM · q8

Top-K Candidates & Raw Logits (Click to Preview)

Awaiting live inference…

Cased WordPiece ## Subword Chip Breakdown

Solid border = word-initial token; dashed = ## continuation subword; highlighted = [MASK] (103); red = [UNK] (100).

Run inference to inspect cased WordPiece tokens.

2. Why DistilmBERT Cased Matters & How It Runs

distilbert/distilbert-base-multilingual-cased distills 12-layer mBERT with knowledge distillation on cased Wikipedia across 104 languages into a 6-layer DistilBertForMaskedLM encoder (134M params, dim: 768). Cutting depth in half shrinks the quantized ONNX payload from 182.5 MB to 139.32 MB while keeping the same 119,547-piece cased WordPiece tokenizer.

import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";

const unmask = await pipeline(
  "fill-mask",
  "onnx-community/distilbert-base-multilingual-cased-ONNX",
  { device: "wasm", dtype: "q8" },
);
const out = await unmask("Paris is the capital of [MASK].", { top_k: 8 });
Show the code · worker.js — runSingleFill() (139.32 MB q8 WASM worker)
Show the code · distilbert-mbert-core.mjs — computeDistributionMetrics() (entropy & NaN check)

3. References & Model Provenance