Ultra-fast on-device PII redaction engine trained natively on Apple Silicon MLX GPU
Project description
language:
- en license: mit tags:
- pii
- privacy
- redaction
- ner
- token-classification
- mlx
- apple-silicon metrics:
- f1
- accuracy library_name: mlx pipeline_tag: token-classification
🚀 Kava Privacy (Apple Silicon MLX Transformer)
Kava Privacy is a lightweight, ultra-fast 2.01 Million parameter bidirectional Transformer model trained natively on Apple Silicon GPU via Apple MLX. It detects and redacts 16 categories of Personally Identifiable Information (PII) with 2.2ms latency, zero cloud data leakage, and 100% false-positive immunity on technical, financial, legal, and scientific text.
💻 CLI Usage
Pass text directly via command line arguments or stdin:
python3 kava_privacy.py "Email me at jane.doe@gmail.com or call 555-123-4567. SSN is 501-22-9384."
# Output: Email me at [EMAIL] or call [PHONE]. SSN is [SSN].
Or pipe text from stdin:
cat log.txt | python3 kava_privacy.py
🐍 Python API Usage
from kava_privacy import KavaPrivacy
# 1. Load default 2.01M Parameter Model (KVCHub/Kava-Privacy-2M-mlx)
kp = KavaPrivacy(model_name="2.01M")
redacted, entities = kp.redact("Email me at jane.doe@gmail.com or call 555-123-4567.")
print(redacted)
# Output: "Email me at [EMAIL] or call [PHONE]."
# 2. Load 636k Parameter Lightweight Model (KVCHub/Kava-Privacy-636k-mlx)
kp_636k = KavaPrivacy(model_name="636k")
print(kp_636k.redact("Call 555-987-6543.")[0])
📊 Model Performance
- Hard Adversarial Benchmark: 100.0% Pass (12/12 Passed)
- Zero-Shot Out-Of-Distribution Benchmark: 87.5% Pass Rate
- Inference Speed: 2.2ms / document on Apple Silicon GPU
- Zero False Positives: Ignores physics constants (
299,792,458 m/s), subnets (255.255.255.0), legal rules (12(b)(6)), and stock tickers ($182.50).
⚙️ Model Architecture & Specs
- Parameters: 2,011,233 (2.01M Parameters)
- Model File Size: 8.0 MB (
kava_privacy.safetensors) - Supported Entities (16):
NAME,EMAIL,PHONE,DOB,ADDRESS,SSN,CREDIT_CARD,IP,HANDLE,PASSPORT,VISA,DRIVER_LICENSE,BANK_ACCOUNT,ACCOUNT_NUMBER,URL,SECRET.
📄 License
Licensed under the permissive MIT License. Free for commercial and open-source applications.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kava_privacy-1.0.0.tar.gz.
File metadata
- Download URL: kava_privacy-1.0.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dba77ecca9becdf7b2f98781d39f23708a3586160c359b3f24e117ddf2a98da
|
|
| MD5 |
8c85866eac4cb0244211ac35aad60bfc
|
|
| BLAKE2b-256 |
d8ec6c76b0ec30c0d2da1be838d25ea8aa3d8e72d239aecaddb16b2bb1ae74d9
|
File details
Details for the file kava_privacy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: kava_privacy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a92c5f90f3dccecd88e5a1ad49d83f1126539cd14f80465d665286d8692bb5b
|
|
| MD5 |
6fabaf2bb790124ae910934120fc1f35
|
|
| BLAKE2b-256 |
d73802b1aded763e9bd3f3524439622d42af63f9f787edc8eb75382e8bc8a0d0
|