Skip to content
System One

Laya-CoreML

Core ML ports of all three Laya checkpoints for Apple Silicon, reaching 4.98ms P50 on the Neural Engine for a short multilingual decision, with a Snake demo sustaining about 50 decisions per second.

Laya Core ML playing Snake with real local model probabilities
Image from github.com

mizorewww/laya-coreml on GitHub

Stars
1,401
Forks
118
Language
Python
License
Apache-2.0
Last push
22 Sep 2026

Read from GitHub on . Counts change daily.

Reported by the author

Short decision
4.98 ms P504.98 ms P50 / 5.31 ms P95 on M3 Max with ANE FP16github.com
Snake demo
49-50 dec/s49.1–50.0 decisions/s across threegithub.com

Laya-CoreML ports Laya, an open typed-decision model, to Apple’s Core ML framework, including variants that run on the Neural Engine, with zero generated tokens since it reads option probabilities directly. On an M3 Max, the author measured 4.98 milliseconds median and 5.31 milliseconds P95 for one short multilingual decision, and reports the same setup uses 2.78 times less whole-system energy per decision than a compiled MLX FP16 version of the same model; a separately validated 8-bit weight variant reached 4.88 milliseconds with a 3.19 times energy improvement. The author notes plainly that a targeted 10x improvement was not reached.

The Snake demo drives every move through a real local Laya call, sustaining 49.1 to 50.0 decisions per second across three uncapped 600-step episodes with zero deaths and two safety interventions from the visible safety layer. The 4.98 millisecond figures are for single questions, not full Snake frames, and the game-loop timings include rendering.

Following upstream Laya v0.3.5, it clamps fitted calibration temperatures to between 0.5 and 5.0 before use. The shipped value for questions with 11 or more options, 0.1006, would otherwise sharpen the probabilities about tenfold and report a coin flip as near-certain.

Open on GitHub

More like this

Use cases this is tagged with