Downloads · 30 days
10
100% of all-time downloads
coreai-community/GLiNER2-PII-CoreAI
GLiNER2-PII-CoreAI is a token classification model from coreai-community. Use it when you need labels on individual words, such as names. It is set up for coreai. The card lists the license as apache-2.0.
Core AI is Apple's on-device ML runtime in iOS 27 / macOS 27 and the successor to Core ML: PyTorch models are exported with Apple's coreai-torch (LLMs: coreai.llm.export) into .aimodel bundles that run on the GPU or t…
Downloads · 30 days
10
100% of all-time downloads
All-time downloads
10
Public
Repo size
2.1 GB
Likes
1
Trending 1
Click a slice to open those files.
.mlirb1.2 GB · 57%
From the Hugging Face model README
Core AI is Apple's on-device ML runtime in iOS 27 / macOS 27 and the successor to Core ML: PyTorch models are exported with Apple's coreai-torch (LLMs: coreai.llm.export) into .aimodel bundles that run on the GPU or the Neural Engine, e.g. Qwen3-8B 4-bit decodes at 94 tok/s on an M4 Max GPU, MLX 90 under the same protocol (apple-silicon-llm-bench, macOS 27 beta 26A5353q, 2026-06-11).
<!-- gen-cards:devicemark begin (managed by scripts/gen-cards + tools/devicemark_row.py — edit cards.json, not this block) -->Mirror of
mlboydaisuke/GLiNER2-PII-CoreAI— the canonical repo (CoreAI Model Zoo). Updates land there first.
This model has no row on DeviceMark, the on-device LLM leaderboard.
<!-- gen-cards:devicemark end -->The zoo's first NER / schema-driven information-extraction model, and its first DeBERTa-v3
(disentangled-attention) port. Zero-shot entity extraction: pass any label set at call time and the
model finds those entities in the text — the flagship use is on-device PII redaction.
fastino/gliner2-privacy-filter-PII-multi
(Apache-2.0) on a multilingual mDeBERTa-v3 base
(278M), fused into one static Core AI graph; the tokenizer, schema linearization, and span
decode run in the Swift host.
Uncontested on iPhone. An on-device GLiNER2 already exists (GLiNER2Swift) but it is macOS-CPU / MLX only. This runs the GPU on iPhone (and, AOT-compiled, the ANE) — the first GLiNER on Apple Silicon's accelerators.
Three lines with CoreAIKit — InformationExtractor
downloads this bundle once, then runs fully offline:
import CoreAIKitEmbeddings
let extractor = try await InformationExtractor(model: .gliner2PII)
// zero-shot: any labels you want, decided at call time
let entities = try await extractor.extract(
from: "Contact Dr. Sarah Johnson at sarah.j@acme.com or +1-415-555-0142.",
entities: ["person", "email", "phone number"])
// ["person": ["Sarah Johnson"], "email": ["sarah.j@acme.com"], "phone number": ["+1-415-555-0142"]]
// or redact in place
let clean = try await extractor.redact(
"SSN 123-45-6789, card 4111 1111 1111 1111.",
entities: ["social security number", "credit card number"])
// "SSN [SOCIAL SECURITY NUMBER], card [CREDIT CARD NUMBER]."
Runnable demo: Examples/InfoExtract ↗ — a paste-text → detect-and-redact PII app (iOS + macOS CLI).
One fused static graph runs the whole model; the host handles the text↔schema plumbing that makes it schema-agnostic.
forward(input_ids[1,256], attention_mask[1,256], text_word_idx[1,96], schema_idx[1,17]) → span_scores[1,16,96,8]. Inside: mDeBERTa-v3 (disentangled attention, exported
at a fixed shape so the relative-position buckets gather cleanly) → "first" sub-word pooling →
SpanMarker → CountLSTM → einsum → sigmoid. MMAX=16 labels, T=96 words, span width K=8.input_ids (( [P] entities ( [E] l0 [E] l1 … ) ) [SEP_TEXT] …) and supplies the
gather indices, so a single converted bundle answers any schema up to MMAX.collate_fn_inference._format_spans.Byte-gated against the reference GLiNER2 ext.extract at every tier — the Swift collator matches
Python collate_fn_inference (input ids + gather indices), the fp16 Core AI graph matches the fp32
reference (span-scores cos 0.999993), and the decoded entities match exactly:
ext.extract.ext.extract exactly.GATE_RESULT: PASS. Model load ~1.8 s;
extraction ~22–32 ms per text (warm).ios/ JIT .aimodel loads in 0.75 s on the first launch (the
phone specializes it itself) and 0.09 s after; first call 1.4 s, then warm. Load-only measurement
(2026-09-26); the extraction suite was not re-run on this phone.macos/ — JIT .aimodel (fp16, 611 MB) + tokenizer/ + extractor.json.ios/ — the same JIT .aimodel (611 MB) + tokenizer/ + extractor.json. Every iPhone generation
specializes it on its first load (iPhone 18 Pro: 0.75 s, then 0.09 s); no per-architecture bundle needed.ios-h18p/ — the AOT-compiled h18p bundle (~823 MB) + tokenizer/ + extractor.json, for the iPhone 17 Pro
only (an .aimodelc loads on its own architecture and nowhere else). Until revision 887627e this bundle
sat in ios/, where the iPhone 18 Pro refused it (incompatibleCompiledAssetArchitecture). It was compiled
from the 2026-07-07 export; the JIT .aimodel in macos/ and ios/ is the 2026-07-20 re-export
(coreai-torch 0.4.1), and the h18p package was not recompiled from it.extractor.json carries the graph shapes and the GLiNER special-marker token ids (they live above
the Unigram vocab, so the host emits them directly). The tokenizer is the mDeBERTa SentencePiece model
declared as XLMRobertaTokenizer so swift-transformers routes it through its Unigram implementation.
More models in this format: Core AI Model Zoo — 75 models, each with the recipe that produced it.
Want a different model on-device? Open a request — free, open weights only; the export and its measured numbers get published publicly.
<!-- /funnel:v1 -->