Python MLX: supported through openmed[mlx] on Apple Silicon Macs
Swift MLX: not yet in the current OpenMedKit Swift MLX v1 rollout for deberta-v2 models
Python Quick Start
Use the standard OpenMed API if you want OpenMed to choose the right runtime automatically:
bash
pip install "openmed[mlx]"
python
from openmed import extract_pii
text = ""
result = extract_pii(
text,
model_name="OpenMed/OpenMed-PII-German-SuperClinical-Large-434M-v1",
lang="de",
use_smart_merging=True,
)
for entity in result.entities:
print(entity.label, entity.text, round(entity.confidence, 4))
On Apple Silicon, OpenMed auto-selects MLX when openmed[mlx] is installed. On other systems it falls back to the Hugging Face / PyTorch backend.
Use This Preconverted MLX Repo Directly
If you want to use this MLX snapshot explicitly, download it locally and point OpenMed at the directory:
If this repo is still private in your environment, authenticate first with hf auth login or set HF_TOKEN.
python
from openmed import extract_pii
from openmed.core import OpenMedConfig
text = ""
result = extract_pii(
text,
model_name="./OpenMed-PII-German-SuperClinical-Large-434M-v1-mlx",
config=OpenMedConfig(backend="mlx"),
lang="de",
use_smart_merging=True,
)
print(result.entities)
Swift Status
This repo is based on deberta-v2. Python MLX supports this family today, but the current public Swift MLX rollout in OpenMedKit is intentionally limited to bert, distilbert, roberta, xlm-roberta, and electra.
If you are building an Apple app today, the recommended paths for this model are:
Python MLX for evaluation or local workflows on Apple Silicon
CoreML in OpenMedKit if you already have a compatible bundled Apple export
Track the current Swift support matrix in the OpenMedKit docs
Artifact Notes
This repo uses the current legacy-compatible MLX layout:
Tokenizer assets are not bundled in this repo layout. OpenMed and OpenMedKit keep backward compatibility by falling back to the source tokenizer reference in config.json when needed.