Instructions to use flintglass/PrismRedact-Large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/PrismRedact-Large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="flintglass/PrismRedact-Large")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("flintglass/PrismRedact-Large") model = AutoModelForTokenClassification.from_pretrained("flintglass/PrismRedact-Large", device_map="auto") - Notebooks
- Google Colab
- Kaggle
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("flintglass/PrismRedact-Large")
model = AutoModelForTokenClassification.from_pretrained("flintglass/PrismRedact-Large", device_map="auto")Flintglass PrismRedact-Large
Flintglass PrismRedact-Large is a 395M ModernBERT-large 8K-context PII, PHI & developer-secret redaction model (0.9540 Avg 4-Bench Redact F1, 0.9893 Nemotron-PII Redact F1, 0.9994 DevSecrets F1 with 0.00% zero-PII FPR, 95.46% 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-Large (8,192-tok) |
96.2% | 95.6% | 96.2% | 94.8% | 95.5% |
Per-Entity & Per-Language Strict Span F1 (PrismRedact-Large)
| Entity Class | Nemotron-PII Span F1 | DevSecrets Span F1 |
|---|---|---|
ADDRESS |
0.9617 | — |
CREDENTIAL |
0.9321 | 0.9991 |
DATE_DOB |
0.9552 | — |
EMAIL |
0.9975 | 1.0 |
FINANCIAL |
0.9831 | — |
GOV_ID |
0.9277 | — |
IP_NETWORK |
0.9884 | 1.0 |
MEDICAL_ID |
0.9884 | — |
ORG |
0.9458 | 1.0 |
PERSON |
0.9875 | 1.0 |
PHONE |
0.9873 | 0.4876 |
VEHICLE_ID |
0.982 | — |
| Language | Gretel-PII Span F1 | LongDoc-8K Span F1 |
|---|---|---|
| Dutch | 0.5866 | 0.7098 |
| English | 0.7667 | 0.9117 |
| France | 0.682 | 0.7646 |
| German | 0.6421 | 0.765 |
| Italian | 0.5762 | 0.7538 |
| Spanish | 0.6092 | 0.8308 |
| Swedish | 0.6453 | 0.7862 |
Verified ONNX Exports
- ONNX FP32 (
onnx/model.onnx, 1.58 GB):1.0000exact token agreement (0.000113max logit diff vs. PyTorch). (We intentionally omit dynamic INT8 forModernBERT-largebecause GeGLU quantization degrades token parity; use FP32 ONNX or BF16 PyTorch, or choosePrismRedact-Smallfor fast CPU deployment.)
Quickstart (transformers Pipeline)
from transformers import pipeline
redactor = pipeline(
"token-classification",
model="flintglass/PrismRedact-Large",
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-Large
Base model
answerdotai/ModernBERT-large
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="flintglass/PrismRedact-Large")