Back Original

Laya (OS Jev) on Mac M4 CoreML Offline (45 decisions per second)

Instantly share code, notes, and snippets.

@fordnox

Last active

September 20, 2026 22:42
  • Save fordnox/e592d0f68b543fd044be8e6d040863a0 to your computer and use it in GitHub Desktop.
Save fordnox/e592d0f68b543fd044be8e6d040863a0 to your computer and use it in GitHub Desktop.
mkdir test-laya
cd test-laya
uv init
uv add 'laya-coreml[demo]'
hf download aac6fef/laya-multilingual-coreml-ane --local-dir models/snake
uv run laya-coreml-snake --model models/snake

@fordnox

testing https://github.com/mizorewww/laya-coreml

LAYA-CORE-ML.mov

Screenshot 2026-09-20 at 19 02 52

Memory usage

Analysis of sampling python (pid 26208) every 1 millisecond
Process:         python3.12 [26208]
Path:            /Users/USER/*/python3.12
Load Address:    0x10017c000
Identifier:      python3.12
Version:         ???
Code Type:       ARM64
Platform:        macOS
Parent Process:  uv [26207]
Target Type:     live task (Roots Present)

Date/Time:       2026-09-20 23:05:12.300 +0300
Launch Time:     2026-09-20 23:03:49.632 +0300
OS Version:      macOS 27.0 (26A428)
Report Version:  7
Analysis Tool:   /usr/bin/sample

Physical footprint:         560.4M
Physical footprint (peak):  778.0M
Idle exit:                  untracked

@coezbek

Nice! I just wanted to see what Laya does and put it behind Cloudflare's typesafe/jev API:

curl https://laya.inference.zaitlabs.com/ai/run \
  -H "Content-Type: application/json" \
  -d '{
    "state": "Help! My payouts have been failing for 3 days.",
    "questions": {
      "is_urgent": {"type": "noul", "instructions": "Does this convey urgency?"}
    }
  }'
{"answers":{"is_urgent":{"type":"noul","noul":0.7894}}}

https://laya.inference.zaitlabs.com/terms