laya-mlx
Independent MLX port of Laya for Apple Silicon: typed decisions in about 13 ms (7 ms multilingual) with no PyTorch or cloud API.
Overview
Laya-MLX runs open-weight Laya typed decisions natively on Apple Silicon with MLX, without PyTorch, the Transformers runtime or a cloud API, and generates zero output tokens. It keeps upstream question formatting and calibration and publishes port-fidelity checks and performance measurements. The README reports 13.4 ms median end-to-end for a short English decision and 7.4 ms with the multilingual checkpoint on an M3 Max, and notes these are one-question API benchmarks rather than game frame times.
A terminal Snake demo calls Laya on every move with a visible safety layer that can correct unsafe proposals; with compilation and prefix reuse it sustained 75.4 moves per second over 2,400 moves with zero deaths and two safety interventions, about 6.5% faster than the eager control. It installs from PyPI, needs Python 3.11+ and macOS 14+, and downloads the checkpoint on first load, after which inference is fully local. Chinese documentation and detailed benchmarks are linked. The same author later built Laya-CoreML.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Who should handle this? (example: billing, technical, sales) | billing · technical · sales |
| Choice | Which way should the snake move next?(inferred) | — |
How it works
- pip install laya-mlx
- laya.load a checkpoint from Hugging Face
- Call predict with a state and typed questions
- Receive probabilities locally on the GPU
Strengths
- Fast local inference on Apple Silicon
- Port fidelity checked against upstream
- No cloud dependency after download
Caveats
- Apple Silicon only
- Only some macOS versions tested
- Snake demo relies on a safety layer for correctness
Getting started
pip install laya-mlx, then laya.load("aac6fef/laya-mlx").predict(state, questions).At a glance
- Type
- Service
- Status
- beta
- Language
- Python
- Runtime
- MLX on Apple Silicon
- Has code
- yes
- Has tests
- yes
Use cases and integrations
How curated lists describe it
Local runtime: independent MLX port of the Laya checkpoints that runs typed decisions natively on Apple Silicon — 13.4 ms median end-to-end per short English decision, 7.4 ms with the multilingual checkpoint, and zero output tokens, with no PyTorch, Transformers runtime, or cloud API.
yibie/awesome-jevIndependent native MLX port of Laya for Apple Silicon: Choice, Score, and Noul without text generation or a cloud API, retaining upstream question formatting and calibration, with published port-fidelity checks and performance measurements
AnotiaWang/awesome-decision-models
Frequently asked questions
How fast is it?
About 13.4 ms per short English decision and 7.4 ms multilingual on an M3 Max, per the README.
Does it need PyTorch?
No, it uses MLX only.
Is it the same model as Laya?
Yes, it ports the Laya checkpoints and keeps upstream formatting and calibration.
Related projects
Deploys DiffusionGemma-Jev behind a TypeSafe-compatible API on a Cloud Run GPU, with snake, dino and tetris demos.
ServiceprototypePythonOpen family of System One-style models fine-tuned from Qwen3.5 and Gemma that return typed decision probabilities in one pass.
ModelbetaPythonApache-2.0 395M ModernBERT System One model serving calibrated Choice, Noul and Score locally as a drop-in /v1/systemone replacement.
ServicebetaPython, TypeScriptGemma 3 4B option scorer that prefills context once and scores all options in one pass, on MLX or PyTorch, with a Doom demo.
ServiceprototypePythonGemma 4 12B with its LM head replaced by a small answer head, serving Jev-style noul, choice and score decisions with custom code.
ModelresearchPythonDocker service exposing local Laya, Von, a CLM head or hosted Jev through one TypeSafe-compatible HTTP and MCP endpoint.
MCP serverbetaPython