Downloads · 30 days
4
11% of all-time downloads
EdgeAIMed/privacy-filter-mlx-8bit
privacy-filter-mlx-8bit is a token classification model from EdgeAIMed. Use it when you need labels on individual words, such as names. It is set up for openmed. The card lists the license as apache-2.0.
This repository contains an 8-bit OpenMed MLX artifact for openai/privacy-filter, packaged for local PII detection on Apple Silicon with OpenMed.
Downloads · 30 days
4
11% of all-time downloads
All-time downloads
38
Public
Repo size
1.5 GB
Likes
0
Public
Click a slice to open those files.
.safetensors1.5 GB · 98%
From the Hugging Face model README
This repository contains an 8-bit OpenMed MLX artifact for openai/privacy-filter, packaged for local PII detection on Apple Silicon with OpenMed.
OpenAI Privacy Filter is a bidirectional token-classification model for detecting personally identifiable information in text. This OpenMed MLX build keeps the original BIOES token-label head, uses the o200k_base tokenizer assets, and runs with OpenMed's Python and Swift MLX runtimes.
After the model is downloaded once, inference runs locally. No document text is sent to a server.
openai/privacy-filteropenai-privacy-filterweights.safetensorso200k_base / tiktoken-style BPEaccount_number, private_address, private_date, private_email, private_person, private_phone, private_url, secretThis artifact uses expert-aware MLX quantization: embeddings, attention projections, MoE gates, sparse-MoE expert tensors, and the token-classification head are all stored in 8-bit packed form. The resulting weights.safetensors file is about 1.39 GiB, compared with about 2.61 GiB for the BF16 OpenMed MLX artifact.
pip install -U openmed "openmed[mlx]"
from huggingface_hub import snapshot_download
from openmed.mlx.inference import create_mlx_pipeline
model_path = snapshot_download("OpenMed/privacy-filter-mlx-8bit")
pipe = create_mlx_pipeline(model_path)
text = "My name is Alice Smith and my email is [email protected]."
entities = pipe(text)
for entity in entities:
print(entity)
Example output:
{
"entity_group": "private_person",
"word": "Alice Smith",
"start": 11,
"end": 22,
"score": 0.9999,
}
{
"entity_group": "private_email",
"word": "[email protected]",
"start": 39,
"end": 62,
"score": 0.9998,
}
Add OpenMedKit to your Xcode project:
https://github.com/maziyarpanahi/openmed.OpenMedKit package product.import OpenMedKit
let modelURL = try await OpenMedModelStore.downloadMLXModel(
repoID: "OpenMed/privacy-filter-mlx-8bit"
)
let openmed = try OpenMed(backend: .mlx(modelDirectoryURL: modelURL))
let entities = try openmed.extractPII(
"My name is Alice Smith and my email is [email protected]."
)
for entity in entities {
print(entity.text, entity.label, entity.score)
}
For iOS, run on Apple Silicon hardware. The iOS Simulator is not the recommended acceptance target for MLX inference.
The 8-bit artifact was validated against the unquantized OpenMed MLX artifact with fixed text samples. BF16 and Q8 returned identical grouped spans for person, date, phone, email, address, and account-number examples.
OpenMed also includes unit tests for:
.scales coverageUse this model for local privacy filtering, PII detection, redaction workflows, and evaluation on Apple devices. For high-risk domains such as healthcare, legal, finance, education, and government, evaluate against your own data and policy requirements before production use.
openai/privacy-filter