KVC899's picture
Add KvcHub security & benchmark comparison tables and link to SECURITY.md
2661a42 verified
|
Raw History Blame Contribute Delete
10 kB
metadata
language:
  - en
license: mit
tags:
  - pii
  - privacy
  - redaction
  - ner
  - token-classification
  - mlx
  - apple-silicon
metrics:
  - f1
  - accuracy
library_name: mlx
pipeline_tag: token-classification

πŸš€ Kava Privacy (Apple Silicon MLX Transformer)

License: MIT Framework: Apple MLX Latency: 2.2ms

Kava Privacy is a lightweight, ultra-fast 2.01 Million parameter bidirectional Transformer model trained natively on Apple Silicon GPU via Apple MLX. It detects and redacts 16 categories of Personally Identifiable Information (PII) with 2.2ms latency, zero cloud data leakage, and 100% false-positive immunity on technical, financial, legal, and scientific text.


πŸ’» CLI Usage

Pass text directly via command line arguments or stdin:

1. Get the files from the Files tab of this repo*

[https://huggingface.co/KVCHub/Kava-Privacy-2.01M-mlx/tree/main/]. Download the zip file

2. Install the dependencies (Apple Silicon Mac required):

Make sure you have pip installed before running the next command

pip install mlx numpy

2. Run it

python3 kava_privacy.py "Email me at jane.doe@gmail.com or call 555-123-4567. SSN is 501-22-9384."
# Output: Email me at [EMAIL] or call [PHONE]. SSN is [SSN].

🐍 Python API Usage

First install the libary

pip install kava-privacy

Sample Code:

from kava_privacy import KavaPrivacy

kp = KavaPrivacy(model_name="2.01M")

redacted, entities = kp.redact("Email me at jane.doe@gmail.com or call 555-123-4567.")
print(redacted)
# Output: "Email me at [EMAIL] or call [PHONE]."

You can restrict redaction to specific entity types:

redacted, entities = kp.redact(text, entity_types={"EMAIL", "PHONE"})

πŸ“Š Model Performance

  • Hard Adversarial Benchmark: 100.0% Pass (12/12 Passed)
  • Zero-Shot Out-Of-Distribution Benchmark: 87.5% Pass Rate
  • Inference Speed: 2.2ms / document on Apple Silicon GPU
  • Zero False Positives: Ignores physics constants (299,792,458 m/s), subnets (255.255.255.0), legal rules (12(b)(6)), and stock tickers ($182.50).

βš™οΈ Model Architecture & Specs

  • Parameters: 2,011,233 (2.01M Parameters)
  • Model File Size: 8.0 MB (kava_privacy.safetensors)
  • Supported Entities (16): NAME, EMAIL, PHONE, DOB, ADDRESS, SSN, CREDIT_CARD, IP, HANDLE, PASSPORT, VISA, DRIVER_LICENSE, BANK_ACCOUNT, ACCOUNT_NUMBER, URL, SECRET.

πŸ“„ License

Licensed under the permissive MIT License. Free for commercial and open-source applications.

Security & KvcHub Model Comparison

See SECURITY.md for the full threat model, deployment checklist, and vulnerability reporting policy.

KvcHub Model Security Comparison

Model Task Params Weight Format (Pickle-Free) Runtime Isolation Training Provenance Data / Secret Hygiene Supply-Chain & Checksums License
Kava-Privacy-30M PII Redaction (36 langs, 30 entities) 30.46M safetensors (Yes) 100% local / offline (Transformers, CPU/MPS/CUDA) 100% from scratch Synthetic 36-lang + CC-BY-4.0/Apache-2.0 synthetic PII; no real user PII; zero-hallucination span tagging HF LFS SHA-256 + eval_results.json Apache-2.0
Kava-Privacy-2.01M-mlx PII Redaction (EN, 16 entities) 2.01M safetensors (Yes) 100% local / offline (Apple MLX) 100% from scratch Fully synthetic training data; zero cloud calls HF LFS SHA-256 (kava_privacy.py custom loader) MIT
Kava-Privacy-636k-mlx PII Redaction (EN, 9 entities) 636K safetensors (Yes) 100% local / offline (Apple MLX) 100% from scratch Fully synthetic training data; zero cloud calls HF LFS SHA-256 (kava_privacy.py custom loader) MIT
KaiLu-3-Pro Conversational LM 1.03B safetensors + GGUF (Yes) 100% local / offline (llama.cpp, Ollama, Transformers) 100% from scratch Public open corpora + DPO (UltraFeedback, HelpSteer2, HH-RLHF); no formal red-team audit Explicit SHA256SUMS + HF LFS SHA-256 Apache-2.0
KaiLu-3-Mini Conversational LM 329M safetensors + GGUF (Yes) 100% local / offline (Transformers, llama.cpp) 100% from scratch Public open corpora + DPO (UltraFeedback, HelpSteer2, HH-RLHF); no formal red-team audit HF LFS SHA-256 KaiLu-3 License (Non-commercial)
KaiLu-Web In-Browser Chat LM 329M / 1.03B Split GGUF (Yes) Browser WebAssembly sandbox (wllama); zero server calls Packaged from KaiLu-3 / 3-Pro Same as KaiLu-3 / 3-Pro; browser COOP/COEP isolation HF LFS SHA-256 Per-file (Apache-2.0 / KaiLu-3)
KaiLu-2-2B-GGUF Reasoning & Chat LM 1.90B GGUF F16–Q2_K (Yes) 100% local / offline (llama.cpp) 100% from scratch (distilled text mix) Public open datasets + synthetic reasoning; no formal safety red-teaming HF LFS SHA-256 + stats.json Apache-2.0
KaiLu-1-933M Mobile / Desktop Chat LM 933M safetensors + GGUF (Yes) 100% local / offline (Apple MLX / mobile GGUF) 100% from scratch Offline on-device execution; legacy v1 release HF LFS SHA-256 Apache-2.0
Ki-Complete-7B Code Autocomplete (FIM) 7B (LoRA r=64) GGUF + PEFT safetensors (Yes) 100% local / offline (llama-server on 127.0.0.1) Fine-tuned on Qwen2.5-Coder-7B Permissive-license code only; pre-training secret/key scan + extension blocks novel key-shaped strings HF LFS SHA-256 Apache-2.0
Ki-Complete-1.5B Code Autocomplete (FIM) 1.5B (LoRA r=64) GGUF + PEFT safetensors (Yes) 100% local / offline (llama-server on 127.0.0.1) Fine-tuned on Qwen2.5-Coder-1.5B Permissive-license code only; pre-training secret/key scan + extension blocks novel key-shaped strings HF LFS SHA-256 Apache-2.0

KvcHub Model Benchmark Comparison

1. PII Redaction Family (Kava-Privacy)

Model Params Languages Entities Architecture Primary Benchmark Result False-Positive / Hard-Neg Check Speed (Apple Silicon)
Kava-Privacy-30M 30.46M 36 30 (61 BIO) ModernBERT (from scratch) Held-out test Exact Span F1 0.9146 (P 0.8952 / R 0.9348) Hard-Neg FPR: 0.0 33.3 docs/sec (MPS)
Kava-Privacy-2.01M-mlx 2.01M 1 (EN) 16 MLX Encoder (from scratch) Adversarial 100% (12/12) Β· Zero-shot OOD 87.5% 0% on physics/subnet/legal/ticker suite 2.2 ms / doc (MLX)
Kava-Privacy-636k-mlx 636K 1 (EN) 9 4L MLX Encoder (from scratch) Synthetic val token acc 99.6%–100.0% across 9 tags Synthetic val O-tag acc 100.0% Sub-ms (2.4 MB weights)

2. Conversational & Reasoning LM Family (KaiLu)

Model Params Architecture Context (Trained) Footprint (Recommended) Speed (Apple Silicon) Reported Benchmarks
KaiLu-3-Pro 1.03B LFM2 Hybrid (36L) 1,024 (51K cfg) 1.09 GB (Q8_0 GGUF) / 2.07 GB (bf16) Local CPU/Metal/Ollama Benchmarks intentionally omitted (MMLU/ARC/HumanEval/GSM8K included in SFT; evaluate on unseen data)
KaiLu-3-Mini 329M LFM2 Hybrid (24L) 1,024 model.safetensors + kailu-3.gguf Local CPU/Metal Pretrained on 6.6B tokens + 460K SFT + 60K DPO pairs (no formal eval table published)
KaiLu-Web 329M / 1.03B LFM2 Hybrid (wllama WASM) 1,024 351 MB (3-Q8_0) / 623 MB (3-Pro-Q4_K_M) In-browser WASM Browser-packaged builds of KaiLu-3-Mini & KaiLu-3-Pro
KaiLu-2-2B-GGUF 1.90B LFM2 Hybrid (104L) 1,024 (4K GGUF) 1.17 GB (Q4_K_M, 1.51 GB RAM) 107 tok/s GPU / 64 tok/s CPU (Q4_K_M) Held-out PPL 11.003 (F16) / 11.077 (Q4_K_M); 8th-grade math 75.0%; Random math 43.3%; Unseen-vocab IQ 72.5%
KaiLu-1-933M 933M MLX Transformer β€” 546 MB mobile GGUF (1.15 GB RAM) 260+ tok/s (Apple Silicon) Legacy v1 baseline (no formal benchmark suite published)

3. Code Autocomplete Family (Ki-Complete) β€” Measured on Apple M5 Pro (llama.cpp, Q8_0)

Model Params Base Model HumanEval-Infill (1-line) HumanEval-Infill (multi-line) HumanEval-Infill (mid-line) Real Code Exact Line (no ctx / w/ ctx) Unwanted Extra Lines Latency (no ctx / w/ ctx)
Ki-Complete-7B 7B Qwen2.5-Coder-7B 95.0% 53.5% 46.3% 49.7% / 37.7% Β· 52.9% / 41.7% 4% (vs 42% base) 1.00 s / 4.5 s
Ki-Complete-1.5B 1.5B Qwen2.5-Coder-1.5B 89.4% 53.4% 40.9% 44.0% / 36.0% Β· 45.1% / 38.6% 3% (vs 65% base) 0.23 s / 1.1 s