0
stars
8
commits
4
linked in READMEs
Sep 7, 2026
updated
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, 2026-06).
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).macos/ — JIT .aimodel (fp16, ~582 MB) + tokenizer/ + extractor.json.ios/ — AOT-compiled h18p bundle (~823 MB; the device JIT is skipped) + tokenizer/ +
extractor.json.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.
8 commits
0
stars
8
commits
4
linked in READMEs
Sep 7, 2026
updated
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, 2026-06).
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).macos/ — JIT .aimodel (fp16, ~582 MB) + tokenizer/ + extractor.json.ios/ — AOT-compiled h18p bundle (~823 MB; the device JIT is skipped) + tokenizer/ +
extractor.json.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.
8 commits