Find personal information in text without sending the text anywhere.
A 3.9MB model, trained from scratch, runs on WebGPU inside your browser and marks names, contact details, identifiers, and card numbers as you type. There is no inference server, no analytics, and no CPU fallback. It is an experiment: it can miss sensitive text and mark ordinary text, so treat unmarked text as unverified.
- Weights
- 3.92MB float32
- Held-out F1
- 98.51%
- Unfamiliar F1
- 84.51%
- Runtime
- WebGPUon device
…loading model…
Scores
API
The build writes a 23KB ES module to dist/lib/gpu-pii.js with TypeScript declarations. createDetector fetches and verifies model.json and the sibling model.bin, then returns a detector or an explicit error. detect returns spans or an error; a device or inference failure is never an empty result. Call dispose to release GPU resources.
import { createDetector } from 'gpu-pii'
const loaded = await createDetector({ modelUrl: '/model.json' })
if (!loaded.ok) throw new Error(loaded.error.message)
const result = await loaded.value.detect(text)
// { ok: true, value: Span[] } | { ok: false, error: { code, message } }
// Span = { label, start, end } UTF-16 offsets, end exclusive
// label: PERSON | EMAIL | PHONE | ADDRESS | DATE_OF_BIRTH | US_SSN | PAYMENT_CARD | IP_ADDRESS