Views
No views yet
OpenMed/privacy-filter-multilingual,
a multilingual PII token-classification model (a fine-tune of
openai/privacy-filter). It labels every
token with a BIOES tag over 54 PII categories (217 classes) across 16 languages, so
it can be served locally with no Python as the encoder/NER tier of a PII redactor.openai-privacy-filter, that is not (yet) part of
upstream llama.cpp. It runs on:1# build (see the repo README for CUDA/Vulkan)
2cmake --preset release && cmake --build --preset release -j
3# run
4echo "Contact John Doe at jdoe@example.com" | \
5 build/release/pf-cli --classify privacy-filter-multilingual-f16.gguf 0.5pf_load / pf_classify → entity spans with UTF-8 byte offsets;
pf_tokenize / pf_logits) shaped for FFI — see the repo README.TokenClassify RPC and runs the constrained BIOES Viterbi decode,
returning entity spans. LocalAI drives it through the privacy-filter backend (which
wraps privacy-filter.cpp); older builds used a llama.cpp-patched path. The model is not a
chat/completion model — it is a PII detector that other models opt into.local-ai models install privacy-filter-multilingualpii_detection: block (default: mask
everything detected; block credentials / financial-secrets / crypto). Other models opt in by
listing it under pii.detectors:1# any chat or cloud-proxy model — opt in and reference the detector(s)
2name: my-assistant
3pii:
4 enabled: true
5 detectors:
6 - privacy-filter-multilingualllama.cpp, llama-cpp-python, Ollama, and
LM Studio will fail to load this file (unknown model architecture: 'openai-privacy-filter'). The arch can be added with carry-patches (TOKEN_CLS pooling, the
architecture + HF→GGUF converter, the bidirectional banded-attention graph, and an all-SWA
no-cache mask fix; TOKEN_CLS pooling tracks the still-open
PR #19725). Until that support lands
upstream, the patched path is carried by LocalAI; privacy-filter.cpp above is the
patch-free alternative.Pooling note (llama.cpp path only): the model must be loaded with TOKEN_CLS pooling (the GGUF's default). If you drivellama-embeddingdirectly for testing, do not pass--pooling none— that overrides the default and yields raw hidden states instead of label logits. privacy-filter.cpp handles this automatically.
| File | Precision | Size | Notes |
|---|---|---|---|
privacy-filter-multilingual-f16.gguf | F16 | ~2.7 GB | Reference artifact. 217 classifier.output_labels; pooling_type = TOKEN_CLS. |
privacy-filter-multilingual-q8.gguf | Q8_0 (experts) | ~1.6 GB | MoE expert weights → Q8_0, the rest F16. For RAM-constrained / edge use. |
sha256 (q8): 968135172ba8202374b4c3bd7d353e100c8fc574035da793fa4d13ca441319b7q8 stores the bulk of the weights (the MoE
expert matrices) as 8-bit integers instead of 16-bit floats — via
scripts/requant_q8.py,
with attention, embeddings and the classifier head left at F16. That roughly halves the download
(≈2.7 GB → ≈1.6 GB) and is usually a bit faster on CPU.d_model=640, 128 experts, top-4 routing, ~50M active
per token), bidirectional banded attention (symmetric sliding window 128, attention sinks
retained), interleaved (GPT-J) RoPE with YaRN (θ=150000, factor 32), o200k (o200k_base)
tokenizer, and a 217-way token-classification head (score → cls.output).gate_up chunk(2) split and the n_swa = 2·sliding_window window mapping — are both
confirmed by that parity. privacy-filter.cpp re-derives the YaRN truncate=false frequencies at
load time (fed to ggml_rope_ext as freq_factors) so the same GGUF is interchangeable across
runtimes.scripts/convert.py
— a self-contained HF→GGUF converter (no llama.cpp dependency). Nightly CI re-runs it and gates
the output against the HF reference logits, so the published artifact stays in parity.O plus B-/I-/E-/S- for each of 54 categories (1 + 54×4 = 217), spanning identity,
contact, address, dates/time, government IDs, financial, crypto, vehicle, digital, and auth
entities. The ordered id2label table is embedded in the GGUF (classifier.output_labels).
See the source card
for the full list.openai/privacy-filter and OpenMed/privacy-filter-multilingual.privacy-filter.cpp). The model
itself is by OpenMed, fine-tuned from OpenAI's privacy-filter, on AI4Privacy
datasets — please cite all of them (BibTeX in the
source card).