Local Apple Silicon engines for bulk embeddings, document OCR, decision scoring, and schema-constrained JSON extraction. Built to replace cloud ML API bills at batch scale by running the Metal GPU and 16-core Apple Neural Engine (ANE) concurrently, with zero telemetry, no account, and 100% offline execution after weight download.
- Supported: Apple Silicon Macs (verified on 48 GB M4 Pro macOS 26.6 and 24 GB base M5 macOS 27.2.1), macOS 15+ for Core ML ANE bundles and native runners (
macOS 14+for GPU-only MLX), Python 3.12+, anduv. - Unsupported: Windows, Linux, and Intel Macs (ANE runners and Apple Vision require macOS Apple Silicon frameworks). Xcode Command Line Tools are required to compile native ANE
.dylibrunners (make -C packages/fast-bge-small native, optional when passingdefault_mode="gpu"); inference needs neithertorchnortransformers.
git clone https://github.com/mikewolfd/fast-silicon
cd fast-silicon
uv sync --python 3.13 --package fast-bge-small --inexact
make -C packages/fast-bge-small native
.venv/bin/bge-small setup-weights
python
from fast_bge_small import FastBgeSmall
passages = [
"Ocean currents carry heat from the tropics toward the poles.",
"A piano has 88 keys.",
]
engine = FastBgeSmall(default_mode="hetero")
query = engine.encode_texts("How does heat move through the ocean?", add_query_prefix=True)
vectors = engine.encode_texts(passages)
print(passages[int((vectors @ query).argmax())])
To install multiple packages or build tools, run uv sync --extra dev --extra extract --extra build and preview weight downloads (~36-38 GB full across all 8 model packages, or ~25.6 GB with --skip-test-extras) with .venv/bin/python scripts/setup_all.py --dry-run.
Stock MLX uses the Metal GPU and leaves the 16-core ANE idle, while Core ML uses the ANE and leaves the GPU idle. Most local runners are also tuned for single-user B=1 chat instead of offline batch ETL jobs that share the same system prompt and JSON schema across thousands of rows.
Variable-length batch (sorted by token count)
βββ longest sequences βββΆ Metal GPU (packed varlen / custom kernels) βββ
β ββββΆ merged outputs in input order
βββ shortest sequences ββ 16-core ANE (multifunction Core ML ring) ββββ
Pair that dual-accelerator scheduler with zero-padding sequence packing, shared system-prompt KV caches (PrefixTree / Hydragen v2), INT8/binary vector indexes, and schema-enforced fast-forward decoding, and throughput scales cleanly inside unified memory.
| Workload | Package | What you get | Prebuilt download |
|---|---|---|---|
| Search short English passages | fast-bge-small |
384d vectors; 0.49 ms warm query (M4 Pro),200.6k tok/s bulk (11.3x stock MLX). | ~0.15-0.35 GB |
| Index 2K passages & page images | fast-embeddinggemma-2 |
Up to 2,048 tokens (128-768d); 48.8k tok/s (4.3-4.8x MLX,3.3x Core ML),19.0 img/s lazy vision. | ~0.30-0.65 GB |
| Contextual passage & 32K search | fast-pplx |
Contextual 4K chunking lifts legal nDCG from 0.359 (isolated) to 0.703, matching stock pplx-context-mlx at4.4x speed;MaxSim covers 4K-32K docs. |
~1.8-2.4 GB |
| Score decisions & rerank choices | fast-decision-models |
100% Pure-ANE 421M Laya (5.1 ms query, 1,400 items in37.9 s hetero) +Kev-0.8B/4B with prefix cache. |
~1.3-4.9 GB |
| High-throughput JSON & tools (2B) | fast-gemma4 |
10.5 valid docs/s atB=128 (5.2xmlx-vlm valid rate across B=128 vs B=64; 150/150 valid at 0.946 F1; 4.8-6.3 GB MLX). |
~4.2-5.4 GB (~10.4-17.0 GB with test extras) |
| Reasoning, tools & 16K JSON (4B/9B) | fast-qwen3 |
Hybrid GatedDeltaNet + 4-bit QuaRot KV ( 2.1x faster at 16K);300/300 valid on 300 JSON/tool tasks. | ~3.3 GB |
| Extract Markdown & tables from PDFs | fast-ocr |
Clean PDF bypass ( 139-220 pp/s ), parallel Apple Vision ANE (5-9.6 pp/s ), andOvisOCR2-8bit VLM (1.5-3.5x ). |
~2.60 GB |
| Batch 20B MXFP4 MoE generation | fast-gpt-oss |
gpt-oss-20b verified across24-48 GB+ Macs (103 tok/s @ B=16 on 24 GB M5;444 tok/s @ B=128 on 48 GB; auto-clamps on 16 GB). |
~12.10 GB |
| Shared runtime & compact index | fast-shared |
Dynamic chip dispatch, CompactRetrievalIndex (0.50 ms @ 100k vecs),PrefixTree , KV quant, and Parquet ETL. |
- |
All runs execute locally after warmup with deterministic accuracy verification on pinned public benchmarks. See docs/BENCHMARKS.md for datasets, stock configs, hardware ceilings, and CLI reproducers.
| Workload (metric) | Base M5 ( 24 GB ) |
M4 Pro ( 48 GB ) |
Baseline comparison |
|---|---|---|---|
BGE-small retrieval (325 queries, FP16) |
200.6k tok/s (11.8 s, 1.54 GB) | 187.2k tok/s (12.2 s, 1.55 GB) | 11.3x (M5) /9.6x (M4 Pro) stock MLX |
EmbeddingGemma-2 (500 queries, FP16/W8A16) |
48.8k tok/s (57.1 s, 3.43 GB) | 38.5k tok/s (74.9 s, 2.49 GB) | 4.3-4.8x MLX,3.3x Core ML,6.2x CoreAI |
Contextual PPLX (325 queries, FP16/W8A16) |
0.7244 score (136.5 s, 2.34 GB) | 0.7241 score (167.3 s, 1.97 GB) | 4.4x (M5) /4.3x (M4 Pro)pplx-context-mlx |
Laya-421M scoring (1,400 items, W8A16/BF16) |
37.9 s hetero (3.72 GB) /76.7 s ANE (1.59 GB) | 59.3 s hetero (3.30 GB) /133.1 s ANE (1.52 GB) | 2.0x MLX (hetero) /12x ANE to25x hetero vs CoreAI (704 hetero / 711 ANE of 1,400) |
| Gemma 4 E2B extraction (4-bit W, INT8 KV) | 10.5 valid docs/s @ B=128 (monorepo: 1,289 tok/s, 4.76 GB MLX / 5.86 GB OS) | 8.8 valid docs/s (ANE+GPU, 6.28 GB MLX) | 5.2x stockmlx-vlm valid rate (10.5 @ B=128 vs 2.02 @ B=64) |
Qwen 3.5 4B JSON + tools (300 tasks, OptiQ 4-bit / auto KV) |
0.8955 (300/300 valid, 4.76 GB) |
0.8930 (299/300 valid, 4.99 GB) |
1.4-1.5x scored throughput vs unconstrained MLX |
Document OCR (96 pages, OvisOCR2 8-bit auto router) |
0.613 olmOCR /0.887 FinTab /0.687 Omni |
0.616 olmOCR /0.894 FinTab /0.657 Omni |
1.4-2.05x forced VLM (4-page);3.5x mixed PDF splice |
GPT-OSS-20B (MXFP4, batched) |
103.1 tok/s @ B=16 ( 13.4-14.3 GB ) |
444.1 tok/s @ B=128 (15.96 GB MLX /16.67 GB peak) |
Capacity sweep on 24-48 GB+ Macs (no matched stock B=128 run; auto-clamps on 16 GB) |
- Sub-millisecond vector search:
CompactRetrievalIndexpairs 1-bit ARM64 NEON Hamming prefiltering with symmetric INT8 reranking (4-6xsmaller than FP32) to search 100,000 vectors in0.50-0.66 ms/query (3.0-4.4xfaster than FP32 BLAS) with zero ranking loss (index details ). - Local post-training: Packed 8-bit
QLoRAruns at80.5-81.6 supervised tok/son 24 GB M5 (pack=1024, 5.2-7.3 GB peak) and546(packed) /1,385(shared-prefix) logical input tok/s on 48 GB M4 Pro (pack=2048), while disaggregatedGRPOrunsGemma 4rollouts on Metal GPU concurrently withLayacritic scoring on the ANE (2.6-3.4 rollouts/sM5,<0.4 msexposed critic time) (training benchmarks ).
Pre-compiled .mlmodelc Core ML bundles and pre-quantized MLX checkpoints skip local model compilation:
| Package | Prebuilt Hugging Face repo | Contents |
|---|---|---|
fast-decision-models |
mikewolfd/laya-typed-decisions-421m-coreml-ane |
6-bucket multifunction laya_typed_w8.mlmodelc (100% Pure-ANE) + FP16 weights + tokenizer |
fast-decision-models |
mikewolfd/kev-0.8b-mlx-w8 |
Pre-merged 8-bit ( g64 )model_w8.safetensors (801 MB ) + original Kev tokenizer |
fast-pplx |
mikewolfd/pplx-embed-v2-context-0.6b-coreml-ane |
4-stage W8A16 balanced ANE bundles (64..512 ) + FP16 weights + mmapembed_tokens |
fast-embeddinggemma-2 |
mikewolfd/embeddinggemma-2-coreml-ane |
9 packed W8A16 ANE bundles (32..512 ) + 3 CPU-SME bundles + FP16 weights + tokenizer |
fast-bge-small |
mikewolfd/bge-small-en-v1.5-coreml-ane |
9 FP16 Pure-ANE buckets ( s16..s512 ) + weights + tokenizer |
fast-gemma4 |
mikewolfd/gemma-4-e2b-it-early14-coreml-ane |
Early14 Core ML ANE prefill bundles (fp16 +w8 ,1,326 ANE ops) +150K vocab remap |
-
Single-model RAM vs. standalone Core ML: Running Metal GPU and ANE together consumes more unified memory than a standalone 8-bit Core ML export (for instance,
3.43 GBvs.0.84 GBon EmbeddingGemma-2). Usemode="ane"for minimal RAM when latency allows. -
Batch HTTP serving: OpenAI-compatible HTTP servers collect microbatches and return completed responses rather than token-by-token SSE streams.
-
Large-batch 20B memory:
fast-gpt-ossruns cleanly on 24 GB Macs (13.4-14.3 GBpeak, auto-clamped toB=16), while largeB=64-128batch sweeps want 32-48 GB+ RAM. There is no matched-prompt/batchB=128stockmlx-lmthroughput baseline, and on 25 tool tasks the recordedMXFP4-Q4run trailed unconstrainedmlx-lmaccuracy (9/25vs14/25). -
Grammar lift vs. kernel speed: On structured JSON benchmarks against unconstrained stock
mlx-lm/mlx-vlm,llguidancegrammar enforcement eliminates malformed JSON alongside kernel speedups; package READMEs report raw speed and validity separately. -
Hardware coverage: Verified continuously on M4 Pro and base M5; M1-M3 Macs work via the same MLX/Core ML paths but are not in our hardware CI matrix.
-
Compared to
mlx-lm/mlx-vlmandllama.cpp: Those excel at general interactive chat and broad GGUF/MLX model coverage;fast-silicontargets high-volume Apple Silicon batch pipelines with ANE off, shared-prefix KV reuse, and compact retrieval. -
Compared to public Core ML exports & Apple CoreAI: Standalone Core ML models save RAM on single models, while
fast-siliconadds long-context GPU fallback (2K-32K), batch work-stealing, and unified Python/Parquet CLIs. -
Acknowledgments:
zm2231/pplx-context-mlx(MIT) inspiredfast-pplxmemmap embeddings, tile-aligned slicing, and parity testing. Built onmlx,mlx-lm,coremltools,llguidance,pypdfium2, and upstream weights from BAAI, Google, Qwen, Perplexity, OpenAI, and ConvAI.
Code is MIT licensed (downloaded upstream model weights remain subject to their original licenses). For contributor workflows, sibling repo syncing, and test suites, see CONTRIBUTING.md.