localai-org/privacy-filter.cpp
OpenAI's privacy filter NER model architecture implemented in a minimal C++/GGML runtime
What it solves
This tool identifies and extracts sensitive information (PII) from text documents with high performance. It is designed to replace slower, memory-intensive standard AI frameworks, allowing for real-time privacy filtering even on constrained hardware like a Raspberry Pi.
How it works
It uses a specialized, minimal inference engine built on GGML to run privacy-filter models. By using banded, near-linear attention instead of the standard full self-attention, it avoids the memory "wall" that causes other tools to crash on long documents. It processes text by identifying entity spans and providing their exact UTF-8 byte offsets, and it includes a C API for easy integration into other programming languages.
Who it’s for
Developers and engineers who need to perform fast, local, and efficient PII detection and redaction on large documents without relying on heavy cloud-based AI frameworks or GPUs.
Highlights
- Significantly faster than standard Transformers (up to 7.7x faster on CPU).
- Handles extremely long documents (131k+ tokens) where standard tools run out of memory.
- Runs efficiently on consumer hardware, including Raspberry Pi 5, without requiring a GPU.
- Provides exact UTF-8 byte offsets for identified sensitive data.
- Includes a clean, flat C API for integration with other languages like Go or Python.
Related
- Project
- Project
- Project
- Project