madewithlaya

Catalog / Tools & apps

0058GitHub

EdgeJev: offline Laya on a 4-core CPU, 15.6 ms per question with ONNX INT8

Convert → quantize → deploy path that turns Laya (and Kev, NanoJev, PlayJev) into an INT8 ONNX service on the official wire protocol. Runtime is onnxruntime, tokenizers, numpy.

Open source ↗ github.comcostfree, offlinetime15.6 ms / question on 4-core CPU
yzfly/edgejevREADME ↗
# EdgeJev

### 离线可用的本地类型化决策模型

Local & offline Jev / System One inference on CPU

**一台 4 核 CPU,单题 15.6 ms · 断网可用 · 运行时不依赖 torch**

[](https://pypi.org/project/edgejev/)
[](#model-zoo)
[](#离线运行)
[](LICENSE)
[](https://www.python.org/downloads/)

</div>

---

EdgeJev 把 [laya](https://github.com/NandhaKishorM/laya)、[kev](https://github.com/jaredpalmer/kev)、[NanoJev](https://github.com/TianyuCodings/NanoJev)、[PlayJev](https://github.com/OmniJev/PlayJev) 这些开源 [Jev](https://typesafe.ai) / System One 复现统一成一条「转换 → 量化 → 部署」的路径:导出 ONNX、INT8 量化、起一个官方协议兼容的本地服务。跑在普通 CPU 上,**全程离线,不需要 API key、不需要联网、数据不出本机**。运行时只要 onnxruntime、tokenizers、numpy 三个包,不装 torch。

一次类型化决策要多久(每格 8 ms):

```
官方 Jev 托管 API   ████████████████████████████████████████  314 ms
laya 原项目 · CPU   █████████████████████████·····            200–500 ms
laya 原项目 · T4    ████                                       32.8 ms
EdgeJev · 4 核 CPU  ██                                         15.6 ms
```

跑的是 laya 同一份权重,没有换更小的模型。省下来的是网络往返,加上 ONNX Runtime 图优化(1.7x)
和 INT8 走 AVX512-VNNI 整数乘加(1.2x)。模型同时从 1290 MB 缩到 324 MB。

15.6 ms 的意义在于它够小。语音对话留给决策层的预算是 50–150 ms,一轮还往往要问好几个问题;
三题打成一次请求是 44.8 ms,仍在预算内。

## Quick start

```bash
uv tool install "edgejev[build]"
edgejev build --backend laya --out ./jev-int8
```

```python
from edgejev import Agent

ag = Agent("./jev-int8")
r = ag.system_one("我的信用卡被扣了两次款,麻烦退一笔。", {
    "dept":   {"type": "choice", "instructions": "该转给哪个组?",
               "criteria": {"billing": "支付、扣款、发票、退款",
                            "technical": "程序缺陷、报错",
                            "sales": "售前咨询、定价"}},
    "urgent": {"type": "noul",  "instructions": "这条消息表达了紧急或时间压力"},
    "anger":  {"type": "score", "instructions": "客户的不满程度",
               "criteria": ["平静陈述", "有情绪但讲道理", "非常愤怒"]},
})

r["answers"]["dept"]["choice

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