JOSE-Redact v2: An ultra-lightweight model for personal data redaction
2 min readupdated
The new compact language model JOSE-Redact v2 (12L INT8) is built on multilingual-e5-small for secure detection and masking of personally identifiable information (PII) in Russian, English, and source code. Weighing only 38.6 MB and running on the onnxruntime engine without heavy dependencies like PyTorch, it delivers inference speeds from 6 to 26 ms on a CPU. The model is designed as a second layer of defense after regular expressions and is ideal for processing JSON requests and working within programming agents without damaging code structure.
Key features
- Compactness and speed: weighs only 38.6 MB in ONNX INT8 format and consumes less than 100 MB of RAM.
- Code and JSON protection: scans only text values within JSON documents without breaking keys or syntactic brackets, and demonstrates 0% false positives on code.
- Bilingual support: effectively recognizes personal data, contacts, addresses, and secret keys in Russian and English.
- Reversibility: replaces data with deterministic pseudonyms via HMAC-SHA256, allowing the original to be restored if necessary.
What you can do
- Integrate local masking of confidential data into LLM request processing pipelines.
- Launch a local web service for quick document and contract checks for personal data leaks.
- Configure filtering for logs or JSON payloads before sending them to cloud language models.
Example
import sys; sys.path.insert(0, "jose-redact")
from src.redact_runtime import JoseRedactOnnxEngine
from src.redact_rules import DeterministicRedactVault
engine = JoseRedactOnnxEngine(
onnx_path="jose-redact/models/jose_redact_v2_12L_int8.onnx",
remapper_path="jose-redact/models/jose_redact_v2_12L_remapper.json",
tokenizer_json_path="jose-redact/models/tokenizer.json",
use_layer1_rules=True,
)
vault = DeterministicRedactVault()
redacted, spans, _ = engine.redact_text("Контракт № 2026-0815,經办人 Алексей.", mode="doc", vault=vault)
print(redacted)
Read more
Details• Architecture: 12 layers, hidden dimension 384, seamless vocabulary optimization from 250k to 45k tokens.
• Metrics: ranks #1 on an external test set of 9 benchmarks with a macro-average score of 0.880.
• Limitations: requires the mandatory use of an accompanying token remapper file and is recommended for use in conjunction with baseline rules (Layer-1).










Comments