madewithlaya

Catalog / Tools & apps

0059GitHub

Laya MPS: typed decisions on a Mac GPU via PyTorch Metal, ~32 ms median

Runs the typed-decisions checkpoint on Metal Performance Shaders: ~32 ms median and ~2.1 GiB RAM on M5 Pro, plus a slower ~0.74 GiB low-memory mode. Demo and benchmark included.

Open source ↗ github.comcostfree, localtime~32 ms median on M5 Pro
afshinm/laya-mpsREADME ↗
# Laya MPS

**Run Jev-style typed decisions locally on your Mac with low RAM usage and fast responses.**

Laya delivers typed decisions with ~32 ms median latency using ~2.1 GiB RAM on
M5 Pro, with a slower ~0.74 GiB mode for lower memory use.



MPS stands for [Metal Performance Shaders](https://developer.apple.com/metal/pytorch/),
which PyTorch uses to run Laya on your Mac's GPU.

[Laya typed-decisions](https://huggingface.co/convaiinnovations/laya-typed-decisions)
chooses options, scores inputs, and estimates whether statements are true. The
English model specializes in customer service, invoices, security incidents,
and agent traces. It is not a general-purpose language model.
[Model comparison and benchmarks](benchmarks/README.md).

## Requirements

- Apple Silicon Mac (M1 or newer), macOS 14+.
- Git and [uv](https://docs.astral.sh/uv/getting-started/installation/). uv installs Python 3.12 if needed.
- Allow 4 GB of free disk space for the runtime, download cache, and ~843 MB model.

## Get started

Clone the repository and start the server:

```bash
git clone https://github.com/afshinm/laya-mps.git
cd laya-mps
./scripts/serve.sh
```

The first run installs dependencies and downloads the model. Open
**[the demo](http://127.0.0.1:8000/demo/)** and click **Play** or **Run Benchmark**.
The benchmark runs for 60 seconds and plots response latency.

The server runs on `127.0.0.1:8000`. Later runs use local files and inference
works offline. Stop it with **Ctrl+C**. To update a clone, stop the server,
run `git pull`, then run the script again.

## Memory settings

All settings run the same complete model in FP32. Measured on an **M5 Pro,
24 GiB RAM**, macOS 26.4:

| Setting | Peak process RAM | Median decision latency |
| --- | ---: | ---: |
| `minimal` | **0.74 GiB** | 

Also filed under Tools & apps

  1. 0005

    laya-mlx plays Snake at 60 decisions per second

    介绍比Jev快50倍,在你设备上跑的laya-mlx! 只在你的设备上占用最高1G内存 Laya是一个开源的类似于Jev的,基于文本输出概率的分类系统 我将其移植到MLX,并且做了一些性能优化! 视频中就是这个模型在我的本地M3Max上玩贪吃蛇 这个模型能够以每秒决策60次的速度玩贪吃蛇! https://t.co/31KGUiNunb

    @mizorewww · Tools & apps · free, local · 60 decisions/s

  2. 0112

    Laya on Axera AX650 and AX8850 edge NPUs, under 70 ms

    AXERA-TECH's conversion of all three Laya checkpoints for its edge AI chips, reported at latency under 70 ms per decision on AX650/AX8850.

    AXERA-TECH · Tools & apps · free, on-device · < 70 ms on AX650 / AX8850

  3. 0099

    laya-mcp (PerryLink): a warm sidecar that fixes Laya's silent truncation and constant noul

    MCP server plus HTTP sidecar: token-budget preflight that reports what would be cut, a persisted calibration store, structured errors, and a noul fix (P(true) 0.5 → 1.0).

    @PerryLink · Tools & apps · free, local

  4. 0097

    Gomoku against Laya-MLX: you play black, the model picks white's move from six candidates

    Local 15x15 Gomoku on Apple Silicon. Rules in Python, board in the browser, every AI move one real Laya choice over up to six candidates, probabilities shown. No Gomoku training.

    smile-magic · Tools & apps · free, local