OpenAI Privacy Filter
OpenAI's open-source text privacy filter training code.
Working when we checked on .
What is OpenAI Privacy Filter?
OpenAI Privacy Filter detects and masks personally identifiable information (PII) in text using a bidirectional token-classification model with constrained span decoding. It targets teams needing fast, context-aware, on-premises data sanitization in high-throughput workflows. The model has 1.5B total parameters (50M active), a 128,000-token context window, and runs on a laptop or in a web browser. The repository provides a CLI with redact, eval, and finetune modes, plus fine-tuning on labeled datasets.
OpenAI Privacy Filter pricing
Pricing model: Free
Open source under Apache 2.0 license (free)
OpenAI Privacy Filter pros
- Apache 2.0 license permits commercial deployment and customization
- Small footprint: 1.5B total parameters, 50M active, runs on laptop or browser
- 128,000-token context window processes long text without chunking
- CLI supports one-shot redaction, file redaction, piping, and interactive mode
- Fine-tunable on user-provided labeled datasets via opf train
- Runtime control over precision/recall tradeoffs via preset operating points
OpenAI Privacy Filter cons
- Requires local installation and running the model in the user's own environment
- Fine-tuning requires the user to supply labeled training data
- GPU is used by default; CPU runs require an explicit flag
Frequently asked questions about OpenAI Privacy Filter
What does OpenAI Privacy Filter do?
It is a bidirectional token-classification model for detecting and masking personally identifiable information (PII) in text, intended for high-throughput data sanitization workflows that run on-premises.
Who is it for?
Teams that need to sanitize sensitive text data with a fast, context-aware, tunable model they can run on-premises and inspect directly in their own environment.
How large is the model?
It has 1.5B parameters total with 50M active parameters, small enough to run in a web browser or on a laptop.
What is the context window?
The model supports a 128,000-token context window, enabling processing of long text with high throughput and no chunking.
How is the model used?
After installing via pip, the `opf` CLI supports one-shot redaction of strings or files, piped input, interactive mode, evaluation on labeled datasets, and finetuning on custom data.
Can the model be fine-tuned?
Yes. The `opf train` command fine-tunes a checkpoint on a labeled dataset, and the repo includes finetuning demo harnesses under examples/scripts/finetuning.
What license does it use?
It is released under the permissive Apache 2.0 license, which supports experimentation, customization, and commercial deployment.
How does the model detect spans?
It labels an input sequence in a single forward pass, then decodes coherent BIOES spans with a constrained Viterbi procedure over an 8-category privacy label taxonomy.
Does it run on CPU?
Yes. It runs on GPU by default, and CPU execution is supported with the --device cpu flag.
Can precision/recall be adjusted?
Yes. Runtime control allows configuring precision/recall tradeoffs and detected span lengths through preset operating points.