PII Redactor — Llama 3.2 3B (LoRA, GGUF)
A fine-tuned, quantized version of Llama 3.2 3B that detects and redacts Personally Identifiable Information (PII) from text, designed to run fully offline on CPU via Ollama.
Part of the Local PII Redactor project — see that repo for the full pipeline (data generation, training code, regex safety net, and web app).
Model details
- Base model: unsloth/Llama-3.2-3B-Instruct
- Fine-tuning method: LoRA (rank 16, alpha 16), via Unsloth
- Training data: 1,172 synthetic examples across 20 PII categories, generated via a large teacher LLM, spanning emails, chat messages, support tickets, resumes, medical records, financial notifications, and more (including negative examples with no PII, to train precision)
- Quantization: Q4_K_M (GGUF), 1.88GB (from 5.99GB f16, ~68% reduction)
- Epochs: 3 | Effective batch size: 8 | Learning rate: 2e-4
PII types detected
NAME EMAIL PHONE ADDRESS DOB SSN CREDIT_CARD BANK_ACCOUNT
PASSPORT DRIVER_LICENSE IP_ADDRESS USERNAME PASSWORD URL ORG
DATE LICENSE_PLATE MEDICAL_ID EMPLOYEE_ID AGE
Usage
With Ollama (recommended)
# Download this repo's files, then:
ollama create pii-redactor -f Modelfile
ollama run pii-redactor "My name is John Smith, email john@test.com, phone 555-123-4567."
Expected output:
My name is [NAME], email [EMAIL], phone [PHONE].
Files in this repo
pii_redactor_q4.gguf— the quantized model weightsModelfile— Ollama configuration (system prompt + inference parameters)
Evaluation
| Metric | Result |
|---|---|
| Leakage rate (held-out validation, 118 examples) | 0.0% (0 leaks) |
| Leakage rate on adversarial stress tests (with regex safety net) | 0.0% |
| Average inference time | ~0.30s per request (CPU) |
This model is designed to be used together with a regex-based safety net for structured PII (emails, phone numbers, SSNs, etc.), since the model alone can occasionally miss PII in long or complex inputs. See the GitHub repo for the full two-layer pipeline implementation.
Known limitations
- Minor text-duplication artifacts can occasionally appear on longer generations (cosmetic only, does not affect redaction accuracy)
- Behavior on random/out-of-distribution input (e.g. gibberish text) is undefined
- Generic/business emails aren't always perfectly distinguished from personal ones
Intended use
This model is intended as a local pre-processing step to sanitize text before it is sent to external services (e.g. cloud LLM APIs), not as a standalone compliance or legal guarantee of PII removal. Always pair with additional review for high-stakes use cases.
License
MIT