privacy-filter-multilingual โ€” GGUF (F16 + Q8_0)

GGUF conversion of 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.

For the full model description, label space, evaluation, limitations, and citations, see the source model card โ€” this card only covers the GGUF packaging and how to run it.

Runtimes

This GGUF uses a custom architecture, openai-privacy-filter, that is not (yet) part of upstream llama.cpp. It runs on:

  1. privacy-filter.cpp (recommended) โ€” a small standalone GGML engine for exactly this model family, on stock upstream ggml with no patches (CPU / CUDA / Vulkan). This is the reference runtime and what the parity numbers below are measured against.

    # build (see the repo README for CUDA/Vulkan)
    cmake --preset release && cmake --build --preset release -j
    # run
    echo "Contact John Doe at jdoe@example.com" | \
      build/release/pf-cli --classify privacy-filter-multilingual-f16.gguf 0.5
    

    It exposes a flat C API (pf_load / pf_classify โ†’ entity spans with UTF-8 byte offsets; pf_tokenize / pf_logits) shaped for FFI โ€” see the repo README.

  2. LocalAI โ€” install from the model gallery; LocalAI serves it behind the gRPC 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-multilingual
    

    The gallery entry carries the detection policy in a pii_detection: block (default: mask everything detected; block credentials / financial-secrets / crypto). Other models opt in by listing it under pii.detectors:

    # any chat or cloud-proxy model โ€” opt in and reference the detector(s)
    name: my-assistant
    pii:
      enabled: true
      detectors:
        - privacy-filter-multilingual
    
  3. llama.cpp โ€” only with a patch. Stock llama.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 drive llama-embedding directly 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.

Files

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): 968135172ba8202374b4c3bd7d353e100c8fc574035da793fa4d13ca441319b7

Q8_0 quantization โ€” and why it isn't free. q8 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.

The catch: reducing precision throws information away, and it is almost never a free lunch. Our checks didn't find a regression โ€” on a mixed-PII document (1,360 tokens) q8 matched f16 on 100% of token labels and produced identical spans, with an average prediction shift (KL divergence) of just 6.9e-5. But "we didn't find a difference" is not the same as "there is none." Those numbers come from a single English document, and a tiny average shift can still hide a flip on the one input that matters to you โ€” a rare name, an unusual phone or ID format, or a language we never tested. Accuracy benchmarks and divergence metrics routinely look reassuring right up until the case that bites. For PII detection a single missed span is a leak, so:

  • Prefer F16 if you can afford the ~2.7 GB โ€” it is the reference these numbers are measured against, and what we trust by default.
  • Use Q8_0 when memory or speed forces it (e.g. a 4 GB Raspberry Pi 5), treat it as a deliberate tradeoff, and validate it on your own data first. A full span-F1-per-language sweep across the 16 languages is the bar we'd want before calling q8 a true drop-in.

Architecture & conversion

gpt-oss-style sparse MoE (8 layers, 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).

The conversion reproduces the HF reference exactly at F16: token-for-token argmax match on the parity prompt set, full-logit cosine = 1.0, every layer's residual-stream cosine = 1.0 (relerr โ‰ˆ 2e-4, i.e. F16 rounding). The two load-bearing conversion choices โ€” the expert 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.

This GGUF was produced by 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.

Label space

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.

Limitations & intended use

Identical to the source model: multilingual but uneven (strongest on de/es/fr/it/hi/te/en; weaker on CJK), trained on synthetic AI4Privacy data, not a substitute for legal/compliance review, and not a clinical PHI model. Use it as one tier behind deterministic regex pre-filters and human review.

License

Apache-2.0, inherited from openai/privacy-filter and OpenMed/privacy-filter-multilingual.

Credits & citation

Conversion and runtime support by the LocalAI project (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).

Downloads last month
677
GGUF
Model size
1B params
Architecture
openai-privacy-filter
Hardware compatibility
Log In to add your hardware

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for LocalAI-io/privacy-filter-multilingual-GGUF

Quantized
(1)
this model
Quantizations
1 model