Kava-Privacy-30M / README.md
KVC899's picture
Link all 5 KvcHub research papers
8b03567 verified
|
Raw History Blame Contribute Delete
22 kB
---
license: apache-2.0
library_name: transformers
pipeline_tag: token-classification
datasets:
- KvcHub/Kava-Privacy-30M-Dataset
language:
- en
- es
- fr
- de
- it
- pt
- nl
- pl
- ru
- uk
- tr
- ar
- he
- fa
- hi
- bn
- ur
- ta
- zh
- ja
- ko
- vi
- th
- id
- ms
- tl
- sv
- no
- da
- fi
- cs
- ro
- hu
- el
- sw
tags:
- pii
- pii-redaction
- privacy
- ner
- token-classification
- secrets-detection
- modernbert
- multilingual
- from-scratch
- kava-privacy
model-index:
- name: Kava-Privacy-30M
results:
- task:
type: token-classification
name: Multilingual PII Redaction (36 Languages, 30 Entities)
dataset:
name: Kava-Privacy-30M-Dataset (test)
type: KvcHub/Kava-Privacy-30M-Dataset
metrics:
- type: f1
value: 0.9146
name: Exact Span F1
- type: precision
value: 0.8952
name: Exact Span Precision
- type: recall
value: 0.9348
name: Exact Span Recall
---
# Kava-Privacy-30M
**Kava-Privacy-30M** is a **30.46M-parameter** multilingual PII & Secrets redaction encoder trained **100% from scratch** (custom 36-language tokenizer + randomly initialized ModernBERT encoder weights) for deterministic, zero-hallucination PII detection and redaction across **36 languages** and **30 entity classes**.
> **Training Dataset:** Kava-Privacy-30M was trained exclusively on **[KvcHub/Kava-Privacy-30M-Dataset](https://huggingface.co/KvcHub/Kava-Privacy-30M-Dataset)** (284,526 examples across 36 languages, hosted separately as a dataset repository).
## Model Summary
| Property | Value |
|---|---|
| **Architecture** | `ModernBertForTokenClassification` (10 layers, hidden 384, 6 heads, GeGLU 1024, RoPE) |
| **Parameters** | **30,457,021** (30.46M) |
| **Initialization** | **100% from scratch** (no pretrained weights) |
| **Tokenizer** | Custom 32,768-vocab 36-language Byte-Level BPE with individual digit splitting |
| **Training Dataset** | [KvcHub/Kava-Privacy-30M-Dataset](https://huggingface.co/KvcHub/Kava-Privacy-30M-Dataset) |
| **Training Curriculum** | 2-hour wall-clock run (121.4 min, 34.6M tokens total): Stage 1 Multilingual MLM Pretraining (30 min) -> Stage 2 BIO Token Classification (90 min) |
| **Hardware** | Single Apple M5 Pro (24 GB unified memory, zero disk swap) |
| **Languages** | 36 languages across 12 writing systems |
| **Entity Classes** | 30 PII & Secrets categories (61 BIO labels) |
## Held-Out Test Benchmarks
Evaluated on **8,503** held-out test documents (**54,326** PII spans across 36 languages) using strict **exact character-span match** (start offset, end offset, and entity type must all match — even 1 character off counts as wrong; scores are reported on the standard `0.0–1.0` scale where `1.00 = 100%`):
- **Exact Span F1:** **`91.46%`** (`0.9146`)
- **Exact Span Precision:** **`89.52%`** (`0.8952`)
- **Exact Span Recall:** **`93.48%`** (`0.9348`)
- **Hard-Negative False Positive Rate (605 zero-PII docs):** **`0.00%`** (`0.0000` — zero false redactions on version numbers, SKUs, dates, and technical prose)
- **Unseen Real-World Forms (`nvidia/Nemotron-PII`, 10,045 spans):** **`93.26%` Exact Span F1** (`95.29%` Recall)
- **High-Risk Secrets & IDs:** `DB_CONNECTION` **100.0%** · `CRYPTO_WALLET` **100.0%** · `TAX_ID` **99.8%** · `PASSPORT` **99.4%** · `MEDICAL_ID` **99.2%** · `AUTH_TOKEN` **98.6%** · `API_KEY` **98.2%** · `NATIONAL_ID` **97.9%** · `CREDIT_CARD` **97.8%** · `EMAIL` **97.3%**
- **Inference Throughput (Apple M5 Pro MPS):** **`33.3 docs/sec`** (~30 ms/doc) · **Model Size:** **`116 MB`** (`30.46M` params)
## Tiny Footprint, Massive Punch — Industry Comparison
**Kava-Privacy-30M** delivers production-grade multilingual PII & secrets redaction in just **30.46M parameters (116 MB)** — **~9× smaller** than popular open-source encoder redactors (`~280M`) and **thousands of times smaller** than cloud frontier LLMs like OpenAI GPT-4o, while keeping **100% of sensitive data on-device** with zero API cost and zero generative hallucination:
| Solution | Size / Footprint | Languages | PII & Secret Scope | Runs 100% Offline? | Hallucination / Prompt-Injection Risk | Typical Speed | Reported Benchmark / Notes |
|---|---:|---:|---|---|---|---|---|
| **[KvcHub/Kava-Privacy-30M](https://huggingface.co/KvcHub/Kava-Privacy-30M)** | **30.46M (116 MB)** | **36 (12 scripts)** | **30 classes** (personal, financial, medical, gov IDs + API keys, JWTs, DB URLs) | **Yes** (CPU / MPS / CUDA) | **None** (deterministic BIO span tagging) | **~30 ms/doc** (33.3 docs/s MPS) | **91.46% Exact Span F1** (`93.48%` Recall, **`0.00%`** hard-neg FPR, **93.26% F1** on held-out Nemotron-PII) — trained 100% from scratch in 2h |
| **OpenAI GPT-4o** *(cloud LLM redaction)* | Cloud-only (hundreds of billions of params) | Broad multilingual | Prompt-defined | **No** *(requires sending raw PII to external cloud servers)* | **Yes** (generative rewrites can alter non-PII text or follow injected instructions) | ~500 ms – 3+ s/doc + API cost | High semantic ceiling on complex prose (e.g. ~60%–65% strict F1 on hard medical/legal suites), but creates a privacy paradox & high latency/cost |
| **`iiiorg/piiranha-v1`** *(mDeBERTa-v3-base)* | ~280M (~9× larger) | 6 (EN, ES, FR, DE, IT, NL) | 17 PII classes | Yes | None (token classifier) | Tens of ms/doc | 93.12% reported token-level multi-class F1 on its 6-language test set |
| **`nvidia/gliner-PII`** *(GLiNER encoder)* | ~160M–300M (~5–10× larger) | Primarily English | Zero-shot / configurable | Yes | None (span extractor) | Tens of ms/doc (GPU) | 87.0% reported strict F1 on NVIDIA's internal eval suite (τ=0.3) |
| **`urchade/gliner_multi_pii-v1`** *(mDeBERTa-v3)* | ~280M (~9× larger) | 6 (EN, FR, DE, ES, IT, PT) | 40+ zero-shot labels | Yes | None (span extractor) | Tens of ms/doc (GPU) | Strong zero-shot flexibility; weaker on non-Latin scripts |
| **Microsoft Presidio** *(Regex + spaCy NER)* | Lightweight (~15 MB+ spaCy) | Primarily English (per-lang pipelines) | Pattern/rule-driven + NER | Yes | None | <10–50 ms/doc | Very strong on rigid regex formats; drops sharply (~30%–50% F1) on unstructured/contextual prose |
> *Fairness note:* Each external tool's reported score comes from its own published benchmark suite rather than a single shared test set. Size, disk footprint, language coverage, offline privacy guarantees, and non-generative safety are direct architectural comparisons.
## Live Redaction Examples
**[en]**
- Input: `Hi, I'm Elena Vance (DOB 1989-04-12). Email: elena.vance@proton.me, SSN 412-88-9021, API key sk-proj-9kLm2PqR8vTx4YzA7bCdEfGhIjKlMnOpQrSt.`
- Redacted: `Hi, I'm [PERSON] (DOB [DATE_OF_BIRTH]). Email: [EMAIL], SSN [NATIONAL_ID], API key [API_KEY].`
**[es]**
- Input: `Hola, soy Mateo García, correo mateo.garcia@gmail.com, teléfono +34 612 345 678, DNI 48291034K.`
- Redacted: `Hola, soy [PERSON], correo [EMAIL], teléfono [PHONE], DNI [NATIONAL_ID].`
**[zh]**
- Input: `您好,患者张伟,手机号 +86 138 0013 8000,身份证号 110101199001011234,诊断:2型糖尿病。`
- Redacted: `您好,患者[PERSON],手机号 [PHONE],身份证号 [NATIONAL_ID]1234,诊断:2型糖尿病。`
**[ar]**
- Input: `مرحباً، الاسم الكامل: عمر المنصور، البريد الإلكتروني: omar.mansour@outlook.com، رقم الهاتف: +971 501 234 5678.`
- Redacted: `مرحباً[CITY] الاسم الكامل: [PERSON] البريد الإلكتروني: [EMAIL] رقم الهاتف: [PHONE].`
**[ja]**
- Input: `氏名: 佐藤 蓮、住所: 渋谷区道玄坂 24、メールアドレス: ren.sato@icloud.com。`
- Redacted: `氏名: [PERSON]、住所: [ADDRESS]、メールアドレス: [EMAIL]`
**[hard_neg]**
- Input: `Release v2.14.8 fixes a memory leak in the cache layer and passes 184 unit tests for SKU-90412-XL.`
- Redacted: `Release v2.14.8 fixes a memory leak in the cache layer and passes 184 unit tests for SKU-90412-XL.`
## Quickstart
### Option 1: Using `transformers` pipeline directly
```python
from transformers import pipeline
ner = pipeline(
"token-classification",
model="KvcHub/Kava-Privacy-30M",
aggregation_strategy="simple",
)
print(ner("Contact Alice Smith at alice@example.com or SSN 123-45-6789."))
```
### Option 2: Full Deterministic Redaction with `redactor.py`
```python
from huggingface_hub import hf_hub_download
import importlib.util
path = hf_hub_download("KvcHub/Kava-Privacy-30M", "redactor.py")
spec = importlib.util.spec_from_file_location("redactor", path)
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
redactor = mod.KavaRedactor.from_pretrained("KvcHub/Kava-Privacy-30M")
out = redactor.redact("Patient John Doe, MRN-4829103, email john@clinic.org, API key sk-proj-abc123...")
print(out["redacted_text"])
print(out["spans"])
```
## Per-Entity Test Performance (30 Classes)
| Entity Type | Precision | Recall | F1 | Support |
|---|---:|---:|---:|---:|
| `PERSON` | 0.8065 | 0.8442 | **0.8249** | 7,747 |
| `USERNAME` | 0.8178 | 0.8245 | **0.8211** | 1,698 |
| `EMAIL` | 0.9664 | 0.9787 | **0.9725** | 3,759 |
| `PHONE` | 0.8949 | 0.9185 | **0.9066** | 2,995 |
| `ADDRESS` | 0.8121 | 0.9134 | **0.8597** | 3,406 |
| `CITY` | 0.7468 | 0.9000 | **0.8163** | 2,150 |
| `POSTAL_CODE` | 0.9116 | 0.9755 | **0.9425** | 1,840 |
| `DATE_OF_BIRTH` | 0.9798 | 0.9810 | **0.9804** | 1,583 |
| `AGE` | 0.9762 | 0.9914 | **0.9837** | 1,157 |
| `NATIONAL_ID` | 0.9699 | 0.9876 | **0.9787** | 1,208 |
| `PASSPORT` | 0.9972 | 0.9908 | **0.9940** | 1,092 |
| `DRIVER_LICENSE` | 0.9848 | 0.9778 | **0.9813** | 1,128 |
| `TAX_ID` | 0.9972 | 0.9991 | **0.9981** | 1,062 |
| `CREDIT_CARD` | 0.9789 | 0.9768 | **0.9778** | 948 |
| `CVV_PIN` | 0.9359 | 0.9458 | **0.9408** | 941 |
| `BANK_ACCOUNT` | 0.9376 | 0.9807 | **0.9587** | 1,608 |
| `CRYPTO_WALLET` | 1.0000 | 1.0000 | **1.0000** | 580 |
| `MEDICAL_ID` | 0.9893 | 0.9952 | **0.9923** | 840 |
| `MEDICAL_INFO` | 0.8515 | 0.9774 | **0.9101** | 839 |
| `IP_ADDRESS` | 0.9610 | 0.9867 | **0.9737** | 1,349 |
| `MAC_ADDRESS` | 0.9895 | 0.9958 | **0.9926** | 949 |
| `DEVICE_ID` | 0.9836 | 0.9948 | **0.9892** | 967 |
| `URL_SENSITIVE` | 0.9664 | 0.9759 | **0.9711** | 1,620 |
| `PASSWORD` | 0.9278 | 0.9579 | **0.9426** | 926 |
| `API_KEY` | 0.9740 | 0.9905 | **0.9822** | 1,058 |
| `AUTH_TOKEN` | 0.9804 | 0.9923 | **0.9863** | 909 |
| `DB_CONNECTION` | 1.0000 | 1.0000 | **1.0000** | 670 |
| `VEHICLE_ID` | 0.9804 | 0.9971 | **0.9887** | 1,052 |
| `ORGANIZATION` | 0.7945 | 0.8621 | **0.8269** | 5,583 |
| `ACCOUNT_ID` | 0.9668 | 0.9835 | **0.9750** | 2,662 |
## Per-Language Test Performance (36 Languages)
| Code | Language | Precision | Recall | F1 | Support |
|---|---|---:|---:|---:|---:|
| `en` | English | 0.8560 | 0.9140 | **0.8841** | 14,545 |
| `es` | Spanish | 0.7898 | 0.8420 | **0.8151** | 1,633 |
| `fr` | French | 0.8567 | 0.9086 | **0.8819** | 1,553 |
| `de` | German | 0.8488 | 0.8820 | **0.8651** | 1,687 |
| `it` | Italian | 0.8190 | 0.8706 | **0.8440** | 1,538 |
| `pt` | Portuguese | 0.9489 | 0.9657 | **0.9572** | 1,020 |
| `nl` | Dutch | 0.7919 | 0.8263 | **0.8087** | 1,727 |
| `pl` | Polish | 0.9775 | 0.9877 | **0.9826** | 1,056 |
| `ru` | Russian | 0.9800 | 0.9847 | **0.9823** | 1,044 |
| `uk` | Ukrainian | 0.9511 | 0.9755 | **0.9631** | 978 |
| `tr` | Turkish | 0.9761 | 0.9884 | **0.9822** | 1,033 |
| `ar` | Arabic | 0.8863 | 0.9473 | **0.9158** | 1,119 |
| `he` | Hebrew | 0.9435 | 0.9723 | **0.9577** | 1,048 |
| `fa` | Persian | 0.9694 | 0.9794 | **0.9744** | 1,068 |
| `hi` | Hindi | 0.8952 | 0.9572 | **0.9252** | 982 |
| `bn` | Bengali | 0.9023 | 0.9630 | **0.9317** | 1,055 |
| `ur` | Urdu | 0.9630 | 0.9867 | **0.9747** | 1,054 |
| `ta` | Tamil | 0.9523 | 0.9686 | **0.9604** | 1,051 |
| `zh` | Chinese (Simplified) | 0.9647 | 0.9787 | **0.9717** | 1,034 |
| `zh-TW` | Chinese (Traditional) | 0.9499 | 0.9676 | **0.9587** | 1,019 |
| `ja` | Japanese | 0.8909 | 0.9437 | **0.9165** | 1,030 |
| `ko` | Korean | 0.9581 | 0.9738 | **0.9659** | 1,032 |
| `vi` | Vietnamese | 0.9586 | 0.9836 | **0.9709** | 1,035 |
| `th` | Thai | 0.8344 | 0.9165 | **0.8735** | 1,006 |
| `id` | Indonesian | 0.9709 | 0.9853 | **0.9780** | 1,017 |
| `ms` | Malay | 0.9410 | 0.9682 | **0.9544** | 1,037 |
| `tl` | Filipino | 0.9702 | 0.9823 | **0.9762** | 962 |
| `sv` | Swedish | 0.8006 | 0.8195 | **0.8099** | 1,612 |
| `no` | Norwegian | 0.9621 | 0.9751 | **0.9685** | 884 |
| `da` | Danish | 0.9633 | 0.9749 | **0.9691** | 1,077 |
| `fi` | Finnish | 0.9666 | 0.9865 | **0.9765** | 1,114 |
| `cs` | Czech | 0.9698 | 0.9888 | **0.9792** | 1,073 |
| `ro` | Romanian | 0.9542 | 0.9737 | **0.9638** | 1,026 |
| `hu` | Hungarian | 0.8763 | 0.9379 | **0.9060** | 1,095 |
| `el` | Greek | 0.8823 | 0.9451 | **0.9126** | 1,039 |
| `sw` | Swahili | 0.9441 | 0.9722 | **0.9580** | 1,043 |
## Separation of Artifacts
- **Model Repository:** `KvcHub/Kava-Privacy-30M` (model weights, custom tokenizer, `redactor.py`, evaluation metrics — no dataset files)
- **Dataset Repository:** [`KvcHub/Kava-Privacy-30M-Dataset`](https://huggingface.co/KvcHub/Kava-Privacy-30M-Dataset) (36-language training, validation, and test Parquet shards)
<!-- KVCHUB-SECURITY-AND-BENCHMARKS -->
## Security & KvcHub Model Comparison
See [`SECURITY.md`](./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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/Kava-Privacy-30M)** | 30.46M | **36** | **30** (61 BIO) | ModernBERT (from scratch) | Held-out test Exact Span **F1 91.46%** (`0.9146` · P `89.52%` / R `93.48%`) | Hard-Neg FPR: **`0.00%`** | **33.3 docs/sec** (MPS) |
| **[Kava-Privacy-2.01M-mlx](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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](https://huggingface.co/KvcHub/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** |
<!-- KVCHUB-PAPERS-LINK -->
## Research Papers & Technical Reports
Five accompanying research papers (Markdown + arXiv-ready LaTeX + 300-DPI figures + reproducible benchmarks) are published at **[`KvcHub/KvcHub-Research-Papers`](https://huggingface.co/datasets/KvcHub/KvcHub-Research-Papers)**:
1. [**Kava-Privacy-30M**](https://huggingface.co/datasets/KvcHub/KvcHub-Research-Papers/blob/main/01_Kava_Privacy_30M/PAPER.md) — *Training a 36-Language, 30-Entity PII & Secrets Redaction Encoder from Scratch in Two Hours on a Single Laptop*
2. [**Zero-Swap Training on Unified Memory**](https://huggingface.co/datasets/KvcHub/KvcHub-Research-Papers/blob/main/02_Zero_Swap_Apple_Silicon_MPS/PAPER.md) — *Eliminating MPSGraph Cache Explosion and Dynamic-Shape Leaks on Apple Silicon*
3. [**How Small Is Safe Enough?**](https://huggingface.co/datasets/KvcHub/KvcHub-Research-Papers/blob/main/03_PII_Scaling_Laws_636K_to_30M/PAPER.md) — *Scaling Laws for From-Scratch On-Device PII Redaction from 636K to 30M Parameters*
4. [**PolyPII-36**](https://huggingface.co/datasets/KvcHub/KvcHub-Research-Papers/blob/main/04_PolyPII_36_Dataset_Benchmark/PAPER.md) — *A 36-Language, 12-Script Benchmark for Joint Personal PII and Developer Secret Redaction*
5. [**The Zero-Cloud AI Workstation**](https://huggingface.co/datasets/KvcHub/KvcHub-Research-Papers/blob/main/05_Zero_Cloud_AI_Workstation/PAPER.md) — *Combining Sub-30ms Deterministic PII Firewalls with Local Code and In-Browser Language Models*