token-classification Β· 14.69 MB WASM q4 Β· 7 Languages Β· 35 BIO Labels Β· CC-BY-4.0

Rampart PII β€” On-Device 7-Language Privacy Shield

nationaldesignstudio/rampart is a 14.69 MB 4-bit quantized MiniLM-L6-H384 encoder (~18.5M params, released by National Design Studio under CC-BY-4.0) that detects 17 PII entity categories (35 BIO labels) across English, Spanish, French, German, Italian, Portuguese, and Dutch in ~23 ms β€” entirely inside a local Web Worker before a single byte leaves your browser.

Model ID nationaldesignstudio/rampart
Pipeline task token-classification
Artifact & Quant 14.69 MB Β· WASM q4
Label Space 35 BIO tags (17 types)
Languages EN ES FR DE IT PT NL
License CC-BY-4.0

1. Live 7-Language PII Detector & Redactor

Client-side privacy guarantee: Rampart loads onnx/model_q4.onnx (14,693,379 B, CC-BY-4.0) via shared Transformers.js into a dedicated Web Worker. Nothing you type or upload is transmitted to any server.

Pick a 7-language sample preset, type your own text, or load a local .txt / .csv / .json file:

Press Scan & Redact (or switch presets) to run live WASM q4 token classification.
Redaction mode:
Inference latency–
Entities detected–
WordPiece tokens–
NaN logit check–
Backend / dtypeWASM Β· q4
Risk posture–
Identity (Name / Surname) Contact (Email / Phone / URL) Financial & Gov ID (Tax / Bank / Passport / ID) Location (Street / City / State / ZIP)

Detected PII Highlights

Download or initialize Rampart above to run live PII detection.

Redacted Output ([TYPE] Tags)

Redacted text will appear here after scanning.

2. Merged Entity Spans & Replacement Map

On Transformers.js 3.7.5, Rampart emits raw per-token B-/I-/O predictions. Our deterministic BIO span merger joins WordPiece subwords, Unicode-normalized offsets, and punctuation bridges into clean structured entities below.

Detected PII entities with category, source text, replacement token, confidence score, and character span
# Entity Type Group Detected Text Replacement Confidence Char Span
Run a scan above to inspect detected PII spans.

3. How Rampart Works & Source Code

Fine-tuned from nreimers/MiniLM-L6-H384-uncased on ai4privacy/pii-masking-openpii-1.5m (CC-BY-4.0), Rampart trims the WordPiece vocabulary from 30,522 to 19,730 entries and applies 4-bit MatMul + INT8 embedding quantization to fit in 14.69 MB.

Show the code Β· worker.js β€” runSingleAnalysis() & analyze() (WASM q4 pipeline)
Show the code Β· rampart-core.mjs β€” mergeBioSpans() (Unicode offset alignment + BIO merger)