Turkish PII masking model for Ollama and llama.cpp
turkish-pii-detection-GGUF is the GGUF build of turkish-pii-detection v02, a 270M model that masks Turkish personal data (names, national ID numbers, IBANs, phone numbers, emails, addresses; 53 labels) following a Turkish instruction. It runs locally and offline with Ollama or llama.cpp, without Python or Transformers.
- Files
- Q8_0 (300 MB), BF16 (551 MB)
- Base model
halilneed/turkish-pii-detectionv02- Benchmark
- Q8_0 0.944, BF16 0.943 exact match on 1,000 rows
- Runs in
- Ollama, llama.cpp
- Licence
- Gemma Terms of Use
Files and scores
| File | Size | Exact match, 1,000 rows | Same output as original |
|---|---|---|---|
| original model, Transformers BF16 | 536 MB | 0.944 | — |
turkish-pii-detection-BF16.gguf | 551 MB | 0.943 | 99.6% |
turkish-pii-detection-Q8_0.gguf | 300 MB | 0.944 | 98.9% |
Measured on cagrigungor/turkish-pii-masking-benchmark with row-level exact match, the same metric as the original model. The GGUF files were run through Ollama 0.40.7 at temperature 0. Q8_0 has the same weak slices as the original (PII with suffixes 0.803, UPPERCASE text 0.847); the one difference is the 20-row multi-person slice, 0.650 against 0.750. If you mask texts that mention several people, use BF16.
Run it in Ollama
ollama pull hf.co/halilneed/turkish-pii-detection-GGUF:Q8_0
For deterministic output and the right stop token, create a named model with the Modelfile from the repository:
# Modelfile and .gguf in the same folder
ollama create turkish-pii -f Modelfile
ollama run turkish-pii "Metindeki tüm kişisel verileri uygun etiketlerle maskele.
Metin: müşteri Ayşe Yılmaz tc 12345678950 tel 0532 111 22 33"
# -> müşteri [AD] tc [TCKN] tel [TEL]
The prompt is always an instruction, a blank line, then Metin: and the text. The instruction sets the policy, for example “Sadece telefon numaralarını maskele” (mask only phone numbers).
Run it in llama.cpp
llama-cli -hf halilneed/turkish-pii-detection-GGUF:Q8_0 --temp 0 -n 512
Limitations
The original model’s limits apply: it was evaluated on synthetic data, so measure it on your own text before production; it can produce labels outside the schema, so validate the output against the label list. There is no Q4_K_M build. KVKK or GDPR compliance remains the user’s responsibility.
Questions
Which file should I use?
Q8_0 (300 MB) scores 0.944 row-level exact match on the 1,000-row benchmark, the same as the original model; BF16 (551 MB) scores 0.943. On the 20-row multi-person slice Q8_0 scores 0.650 against 0.750, so use BF16 for texts that mention several people.
Is there a Q4_K_M build?
No. 168M of the 268M parameters are in the embedding table and Q8_0 is already 300 MB. A 4-bit build is not published without measuring its loss.
What is the prompt format?
An instruction, a blank line, then Metin: followed by the text. The instruction sets the masking policy. Use the Modelfile in the repository for temperature 0 and the right stop token.
Does it guarantee KVKK or GDPR compliance?
No. It was evaluated on synthetic data; measure it on your own text and validate the labels against the schema. Compliance remains the user's responsibility.
Ollama ve llama.cpp için Türkçe kişisel veri maskeleme modeli
turkish-pii-detection v02’nin GGUF sürümü: Ollama ve llama.cpp ile yerelde, Python ve transformers olmadan çalışır. Q8_0 (300 MB) 1.000 satırlık benchmark’ta 0.944 tam eşleşme alır; çok kişili metinler için BF16 (551 MB) önerilir.
Links
- GGUF files and Modelfile on Hugging Face
- All Turkish privacy and safety models on Hugging Face
- Original model: Python usage, full benchmark and training notes
- Masking tool: rule-based TCKN, IBAN, phone and email masking in the browser
- Personal data and AI guide
- All models