← all repositories
mizorewww/laya-coreml

Core ML ports that missed their 10× goal—and published it

It ports open-weight Laya decision models to Apple Core ML so you can get structured choice, score, and boolean probabilities locally in about five milliseconds—no generated tokens, no JSON parsing.

laya-coreml
Collecting fresh signals — velocity needs a few days of history.
collecting data…
star history

What it does Laya-CoreML is an independent port of the Laya decision model to Apple Core ML. It runs open-weight models on Apple Silicon via CPU, GPU, or the Neural Engine to return structured probabilities for choice, ordinal score, and boolean noul questions—no autoregressive decoding, no generated JSON to parse. The package includes a terminal Snake demo that sustains roughly 50 decisions per second while rendering live model probabilities and safety interventions.

The interesting bit Most porting projects trumpet their wins and bury the losses; this one publishes detailed benchmark notebooks showing it fell short of its own 10× speedup target, settling for roughly 1.4× faster inference and 2.8× better energy efficiency than compiled MLX on an M3 Max. The authors also document which quantization experiments failed their fidelity gates and ship a W8 palette-compressed variant that barely edges out FP16, which is the kind of thoroughness you want in infrastructure you might actually deploy.

Key highlights

  • ~4.98 ms P50 latency for short decisions on M3 Max ANE FP16; an approximate W8 variant reaches 4.88 ms
  • 2.78× better system energy per decision than compiled MLX FP16, measured via direct SMC sensor readings
  • Validated port fidelity: 189/189 matching answers on general FP16 checkpoints, and 59/59 on ANE FP16 with maximum calibrated-probability drift under 0.003
  • Inference requires no PyTorch, Transformers, or MLX; runs fully offline after initial model download
  • ANE bundles are strictly limited to 96 tokens (B1/L96); longer contexts require falling back to CPU+GPU checkpoints with up to 1024 tokens

Caveats

  • The 96-token ANE capacity limit is hard: exceed it and you get a capacity error, not a graceful fallback
  • The promised 10× speed-and-energy improvement over MLX was not achieved; real gains are modest and honestly reported
  • Six- and four-bit quantization experiments failed the project’s fidelity gates and remain unpublished

Verdict Worth exploring if you need deterministic, low-latency structured decisions on Apple Silicon without pulling in PyTorch or MLX. Not the right tool if you need long-context reasoning or generative output.

Frequently asked

What is mizorewww/laya-coreml?
It ports open-weight Laya decision models to Apple Core ML so you can get structured choice, score, and boolean probabilities locally in about five milliseconds—no generated tokens, no JSON parsing.
Is laya-coreml open source?
Yes — mizorewww/laya-coreml is open source, released under the Apache-2.0 license.
What language is laya-coreml written in?
mizorewww/laya-coreml is primarily written in Python.
How popular is laya-coreml?
mizorewww/laya-coreml has 1.3k stars on GitHub.
Where can I find laya-coreml?
mizorewww/laya-coreml is on GitHub at https://github.com/mizorewww/laya-coreml.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.