Privacy Filter β€” Multilingual, Mixed-Precision GGUF (Q4_0 / Q8_0)

A mixed-precision GGUF quantization of the multilingual OpenAI Privacy Filter PII/NER model, built for in-browser, CPU-only inference via WebAssembly. It is β‰ˆ2.8Γ— smaller than the f16 GGUF (β‰ˆ1.0 GB vs β‰ˆ2.82 GB) with no measurable loss in detection quality.

⚠️ This GGUF requires privacy-filter.cpp, not standard llama.cpp. The model uses the custom openai-privacy-filter architecture (gpt-oss-style MoE encoder with a token-classification head). It will not load in generic GGUF runtimes.

Attribution & provenance

This is a derivative work. Full credit to the original authors:

Changes made (Apache 2.0 Β§4): mixed-precision quantization of selected weight tensors (see below). No architecture, vocabulary, label taxonomy, or training change. This model is distributed under the same Apache 2.0 license as the original (see LICENSE and NOTICE in this repository).

What this is

The model is a bidirectional token classifier for PII / Named Entity Recognition: gpt-oss-style pre-norm encoder, grouped-query attention with RoPE/YaRN, a sparse mixture-of-experts feed-forward (128 experts), and a token-classification head. It detects person names, organizations, addresses/locations, dates, and structured identifiers across multiple languages (validated on Spanish, Catalan, and English).

Quantization recipe

Mixed precision, applied per tensor (block size 32 β€” note Q4_K/Q5_K are not applicable to this architecture because its inner tensor dimensions, e.g. 128/640/896/217, are not divisible by 256):

Tensor group Type Count
FFN MoE experts (ffn_gate_exps.weight, ffn_up_exps.weight, ffn_down_exps.weight) Q4_0 24
Attention weights (attn_q/k/v/output.weight) Q8_0 32
Token embeddings, all norms, all biases, classifier head (cls.output.*) kept verbatim (F16/F32) 100

Why mixed and not uniform Q4_0: uniform Q4_0 (0.99 GB) degrades short-token detections (it dropped a first name and a city in testing). Keeping attention at Q8_0 recovers full quality at essentially the same size (the MoE experts dominate the file), while the sensitive classifier head and embeddings stay verbatim.

Evaluation (f16 reference vs this mixed model)

Measured with privacy-filter.cpp (pf-cli, threshold 0.5) over a diverse Spanish/Catalan/English PII corpus including real documents (contracts, an insurance policy, a court ruling, an administrative resignation, a flight itinerary) plus detector fixtures:

Metric Result
Reference spans (f16) 328
Recall of mixed vs f16 98.5% (323/328)
Threshold-crossing regressions (f16 β‰₯ 0.5 β†’ mixed < 0.5) 0
Recall on real-document content 100%
Per-type recall DNI/SSN 100%, IBAN 100%, dates 100%, person 99.0%, address 98.2%, phone 96.3%, email 96.2%

Efficiency vs f16 (native, CPU): size β‰ˆ1.0 GB (βˆ’65%), peak RSS β‰ˆ1.06 GB (βˆ’63%), latency β‰ˆ0.2 s/inference (βˆ’45%). In browser (Chrome, WebAssembly): loads with a plain WASM32 build (no memory64, no OPFS needed because the file is < 2 GiB), β‰ˆ1.04 GiB WASM heap, β‰ˆ1.4 s total (stream + load + classify) for a short input.

Intended use

On-device / in-browser PII detection where the full f16 model (2.82 GB) is too heavy and a GPU (WebGPU) is unavailable. Built for Ocultia's client-side anonymization pipeline, running entirely on CPU via WebAssembly. Also suitable for air-gapped / on-premise deployments.

How to run

# Build privacy-filter.cpp (CPU), then:
cat input.txt | pf-cli --classify privacy-filter-multilingual-mixed.gguf 0.5 cpu

Output is a JSON array of entity spans: {"entity_group","start","end","score","text"} (byte offsets). For WebAssembly usage, compile privacy-filter.cpp with Emscripten and load the GGUF into MEMFS (the file fits under the browser's β‰ˆ2 GiB single-ArrayBuffer limit).

Limitations

  • Evaluated against the f16 model as reference over a diverse but not canonically labeled corpus; absolute precision/recall against gold labels is not measured here.
  • The quantization recipe is specific to this architecture; do not assume it transfers to other GGUF models.
  • Language coverage is inherited from the original multilingual model. This quantization is language-agnostic and adds no per-language tuning; we only validated detection parity (vs f16) on Spanish, Catalan, and English. Other languages supported by the base model are expected to work but were not measured here.
  • Inherits the capabilities and biases of the original OpenAI Privacy Filter model.

License

Apache 2.0 β€” same as the original model. See LICENSE and NOTICE. You must retain attribution and the change notice above when redistributing.

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

We're not able to determine the quantization variants.

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

Model tree for lostium/privacy-filter-multilingual-mixed-gguf