--- title: Rampart emoji: 🛡️ colorFrom: gray colorTo: gray sdk: static app_file: index.html short_description: On-device PII redaction by National Design Studio --- # Rampart — Client-Side PII Redaction Demo A live demo of the [Rampart](https://huggingface.co/nationaldesignstudio/rampart) model — a 14.7 MB ONNX token-classification model that detects and redacts personally identifiable information (PII) before it leaves your device. ## What this demo does - **Live redaction** — type or paste text and watch PII get replaced with stable placeholders in real time - **17 entity types** — color-coded legend showing all detected PII classes - **7 languages** — English, Spanish, French, German, Italian, Portuguese, Dutch - **Chat simulation** — see how Rampart protects you before sending text to an AI assistant - **Placeholder mapping** — view the reversible placeholder ↔ real value table - **100% client-side** — the model runs in your browser via transformers.js / ONNX Runtime Web (WASM). No data is sent to any server. ## How it works The demo loads the `@nationaldesignstudio/rampart` npm package from jsdelivr CDN, which bundles transformers.js and the ONNX Runtime Web. The model weights are fetched from the Hugging Face Hub and cached in IndexedDB. All inference happens in the browser — no server compute required. ## Model details | Property | Value | |---|---| | Model | `nationaldesignstudio/rampart` | | Architecture | MiniLM-L6-H384 with 35-label BIO head (17 entity types) | | Size | 14.7 MB (4-bit quantized ONNX) | | Runtime | ONNX Runtime Web (WASM) | | Languages | English, Spanish, French, German, Italian, Portuguese, Dutch | | Recall | 98.42% private-term recall across all 7 languages | | Latency | ~4ms p50 (WebGPU), ~12ms p50 (WASM) | ## Known limitations - **Phone numbers must not start with `555`.** The `555-01XX` exchange is reserved for fiction and is effectively absent from the model's real-world training data, so Rampart does **not** recognize `555-…` numbers as phones. Use a realistic exchange (e.g. `212-867-5309`) to see `PHONE` detection fire. Non-US / international formats (`+44 …`, `0151 …`) are also well supported. - **Credit cards that fail the Luhn checksum pass through unredacted.** `CREDIT_CARD` is handled by the deterministic layer, which validates the Luhn check digit. A made-up number that does not satisfy Luhn is treated as ordinary digits and is **not** redacted — there is no leak warning. Use a Luhn-valid test number (e.g. `4532 1234 5678 9014`) to see it caught. ## License CC BY 4.0 — National Design Studio