How to build scalable web apps with OpenAI's Privacy Filter

Learn how to leverage OpenAI's 1.5B-parameter Privacy Filter model and gradio.Server to build robust applications for PII masking, including document explorers and image anonymizers.
Document Privacy Explorer: drop in a PDF or DOCX, read the document back with every PII span highlighted in place.Image Anonymizer: upload an image, get it back with redacted black bars over names, emails, and account numbers. The image is also editable on a canvas so you can make your own annotations before downloading.SmartRedact Paste: paste sensitive text, share a public URL that serves the redacted version, keep a private reveal link for yourself.
All three are built on gradio.Server, which lets you pair custom HTML/JS frontends with Gradio's queueing, ZeroGPU allocation, and gradio_client SDK. In all these apps, gradio.Server plays the same backend role, and that consistency is exactly what makes it really powerful.
Privacy Filter is a 1.5B-parameter model with 50M active parameters, permissively licensed under Apache 2.0. PII categories are private_person, private_address, private_email, private_phone, private_url, private_date, account_number, secret. Context is 128,000 tokens. Achieves state-of-the-art performance on the PII-Masking-300k benchmark.
User problem. You want to read a PII-heavy document with every detected span highlighted by category. The reading experience should feel like a normal document, not a form.
What Privacy Filter does here. The whole file goes through in a single 128k-context forward pass, so there's no chunking, no stitching, and span offsets line up directly with the rendered text. BIOES decoding keeps span boundaries clean through long ambiguous runs.
What gr.Server does here. gr.Server lets us serve the reader view as a single HTML file and expose the model behind one queued endpoint using the @server.api decorator. This plugs the handler into Gradio's queue, so concurrent uploads are serialized and @spaces.GPU composes correctly on ZeroGPU.
Source: Hugging Face Blog
















