Instructions to use flintglass/PrismRedact-Small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/PrismRedact-Small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="flintglass/PrismRedact-Small")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("flintglass/PrismRedact-Small") model = AutoModelForTokenClassification.from_pretrained("flintglass/PrismRedact-Small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Flintglass PrismRedact-Small
Flintglass PrismRedact-Small is our #1 overall and fastest compact 140M 8K-context multilingual PII, PHI & developer-secret redaction model (0.9598 Avg 4-Bench Redact F1, 0.8898 Strict 12-Entity Span F1, 0.00% zero-PII false-positive rate on DevSecrets & Nemotron-PII, 95.95% recall at 95% depth in 6.5K-token documents).
Most popular open-source PII models on Hugging Face (iiiorg/piiranha-v1, ai4privacy fine-tunes) are non-commercial (CC-BY-NC / CC-BY-NC-ND), truncated at 512 tokens, and suffer 47%–100% false-positive rates on benign engineering logs. Flintglass PrismRedact solves all three:
- 100% Commercial-Safe Apache 2.0 — trained exclusively on
nvidia/Nemotron-PII(CC-BY-4.0),gretelai/synthetic_pii_finance_multilingual(Apache-2.0), and Flintglass programmaticDevSecrets&LongDoc-8K(flintglass/PrismRedact-Corpus). Zeroai4privacynon-commercial data. - Native 8,192-Token Context Window — detects PII, PHI & leaked credentials buried at 95% depth inside 6,500-token contracts, emails, and MCP/JSON payloads with ~95.5%–96.0% recall (where 512-token models collapse to 3.8%–8.1%).
- 12 Unified Production PII, PHI & Secret Entity Classes:
PERSON,EMAIL,PHONE,ADDRESS,DATE_DOB,GOV_ID,FINANCIAL,CREDENTIAL,IP_NETWORK,MEDICAL_ID,ORG,VEHICLE_ID. - Try it live on CPU:
flintglass/PrismRedact-Demo
Apples-to-Apples 4-Benchmark Evaluation (7,600 Held-Out Documents)
To ensure fair cross-taxonomy comparison against public baselines with different label schemas, Redact Char F1 evaluates binary PII/secret redaction across all non-whitespace characters of the full untruncated document (honestly measuring 512-token truncation loss on LongDoc-8K-PII). Zero-PII FPR measures the fraction of 500 benign zero-PII engineering/CI/UUID logs wrongly flagged. Strict Span F1 requires exact character start/end AND exact 12-class entity match.
| Model | License | Context | Avg 4-Bench Redact F1 | Nemotron-PII (3K) | Gretel 7-Lang (2.1K) | DevSecrets (1.5K, Zero-PII FPR) | LongDoc-8K (1K, Depth 95% Rec) | Strict 12-Class Span F1 |
|---|---|---|---|---|---|---|---|---|
iiiorg/piiranha-v1 (236K dl/mo) |
CC-BY-NC-ND (Non-Comm) | 512 | 0.4350 | 0.6385 | 0.4811 | 0.4211 (47.4% FPR) | 0.1991 (3.8%) | — |
Isotonic/distilbert_ai4privacy_v2 |
CC-BY-NC (Non-Comm) | 512 | 0.4899 | 0.7415 | 0.3517 | 0.6761 (100.0% FPR) | 0.1904 (5.2%) | — |
lakshyakh93/deberta_finetuned_pii |
MIT | 512 | 0.5047 | 0.7098 | 0.2525 | 0.7969 (100.0% FPR) | 0.2596 (8.1%) | — |
flintglass/PrismRedact-Large (395M) |
Apache 2.0 | 8,192 | 0.9540 | 0.9893 | 0.8650 | 0.9994 (0.0% FPR) | 0.9625 (95.5%) | 0.8679 |
flintglass/PrismRedact-Multilingual (307M) |
Apache 2.0 | 8,192 | 0.9584 | 0.9907 | 0.8773 | 0.9994 (0.0% FPR) | 0.9661 (95.6%) | 0.8805 |
flintglass/PrismRedact-Small (140M) |
Apache 2.0 | 8,192 | 0.9598 | 0.9914 | 0.8814 | 0.9994 (0.0% FPR) | 0.9672 (96.0%) | 0.8898 |
Long-Context Needle-in-a-Haystack Recall (LongDoc-8K-PII, 600 -> 6,500 tokens)
| Model | Depth 0% | Depth 25% | Depth 50% | Depth 75% | Depth 95% |
|---|---|---|---|---|---|
iiiorg/piiranha-v1 (512-tok, NC-ND) |
30.9% | 9.7% | 7.2% | 5.5% | 3.8% |
lakshyakh93/deberta_finetuned_pii (512-tok) |
67.1% | 24.0% | 14.8% | 12.2% | 8.1% |
flintglass/PrismRedact-Small (8,192-tok) |
95.6% | 96.1% | 96.9% | 95.3% | 96.0% |
Per-Entity & Per-Language Strict Span F1 (PrismRedact-Small)
| Entity Class | Nemotron-PII Span F1 | DevSecrets Span F1 |
|---|---|---|
ADDRESS |
0.9686 | — |
CREDENTIAL |
0.9264 | 1.0 |
DATE_DOB |
0.9628 | — |
EMAIL |
0.9963 | 1.0 |
FINANCIAL |
0.985 | — |
GOV_ID |
0.9446 | — |
IP_NETWORK |
0.9963 | 1.0 |
MEDICAL_ID |
0.9938 | — |
ORG |
0.9556 | 1.0 |
PERSON |
0.9938 | 1.0 |
PHONE |
0.9931 | 0.4876 |
VEHICLE_ID |
0.9821 | — |
| Language | Gretel-PII Span F1 | LongDoc-8K Span F1 |
|---|---|---|
| Dutch | 0.664 | 0.7496 |
| English | 0.8192 | 0.9271 |
| France | 0.7321 | 0.8262 |
| German | 0.7149 | 0.7889 |
| Italian | 0.6187 | 0.7476 |
| Spanish | 0.6752 | 0.8835 |
| Swedish | 0.7153 | 0.8551 |
Verified ONNX Exports
- ONNX FP32 (
onnx/model.onnx, 538 MB):1.0000exact token agreement (0.000153max logit diff vs. PyTorch) - ONNX Per-Channel QUInt8 (
onnx/model_quantized.onnx, 418 MB):0.9365token agreement, ~89 ms CPU latency (for maximum accuracy useonnx/model.onnx)
Quickstart (transformers Pipeline)
from transformers import pipeline
redactor = pipeline(
"token-classification",
model="flintglass/PrismRedact-Small",
aggregation_strategy="simple",
)
text = (
"Contact Elena Vance (elena.vance@northstar.io, +1-415-555-0192) "
"regarding leaked key AKIAIOSFODNN7EXAMPLE on host 198.51.100.42."
)
entities = redactor(text)
for e in entities:
print(f"{e['entity_group']:12s} | {e['word']!r} ({e['start']}-{e['end']}, score={e['score']:.3f})")
# 1-line redaction
redacted = text
for e in sorted(entities, key=lambda x: x["start"], reverse=True):
redacted = redacted[:e["start"]] + f"[{e['entity_group']}]" + redacted[e["end"]:]
print("\nRedacted:", redacted)
The Complete Flintglass Prism Open-Source Agent & RAG Stack (Apache 2.0)
- Ingest (
PrismParse):PrismParse-9B·PrismParse-4B·PrismParse-2B - Embed (
PrismEmbed, Zero MS MARCO):PrismEmbed-Multilingual·PrismEmbed-Large·PrismEmbed-Small· Demo - Rerank (
PrismRerank, Zero MS MARCO):PrismRerank-Large·PrismRerank-Multilingual·PrismRerank-Small· Demo - Protect — Prompt Injection (
PrismGuard):PrismGuard-9B·PrismGuard-Multilingual·PrismGuard-Large·PrismGuard-Small· Demo - Protect — PII & Secrets (
PrismRedact):PrismRedact-Small·PrismRedact-Multilingual·PrismRedact-Large·PrismRedact-Corpus· Demo - Execute (
PrismAgent, Pure RLVR):Inkling-2-Mini-PrismAgent·PrismAgent-27B·PrismAgent-35B-A3B·PrismAgent-9B·PrismAgent-8B·PrismAgent-4B - Verify (
PrismVerify, 8K RAG Groundedness):PrismVerify-27B·PrismVerify-9B·PrismVerify-4B·PrismVerify-Large· Demo
License
Apache 2.0. Built by Flintglass Labs.
- Downloads last month
- -
Model tree for flintglass/PrismRedact-Small
Base model
jhu-clsp/mmBERT-small