Repository navigation
Laya in one command: npx laya-system-one --port 8080 and it just works — anywhere, with zero dependencies
#599
italoalmeida0
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
First of all: thank you for Laya. The model, the RLCD method and the wire
protocol are genuinely good work.
I kept running into the same wall though: Python. The service I wanted to
put this in is Node.js, and the machines it has to run on are not places where
I can install PyTorch — a corporate Windows box, a small Linux container, a
Bun runtime, and occasionally a browser. So I built a way to run your model
where Python is not an option, and published it.
npm install laya-system-oneOr as a service, same
/v1/systemonewire format:What it actually is
The model is yours —
convaiinnovations/laya-multilingual, exported toONNX and quantized to INT8, unchanged. What this package adds is a runtime:
is a self-contained Rust binary (Axum +
tract+ thetokenizerscrate)that ships with the package.
dependenciesis empty.tokenizer.jsonpipeline exactly — verified token-for-token against the
tokenizerscrateon 95 cases, including the whitespace-run added tokens and
<mask>'slstrip.the browser and for platforms with no native binary).
arm64) — the right binary is selected by npm for the machine, so you
download 8–27 MB of binary, not the ~205 MB of all six.
Numbers, measured not claimed
Per question, warm,
nativebackend (4 questions per call):Model load is 1.3–2.9 s depending on the platform. The WebAssembly backend is
roughly 100x slower — it is there so browsers and unusual platforms work at
all, not for throughput.
On the 8,192-token context
This is the part I want to flag, because it bit me. The shipped budget was
1,024 tokens, so a long message was truncated and misread — a
~3,000-token input answered
saleswhere the full text answersbilling.That is a wrong answer, not a slow one, and nothing said so.
The next release makes it configurable (
LAYA_MAX_LEN=8192,Laya.load({ maxLen: 8192 }), or--max-lenon the binary) with a 2,048default. Two honest caveats, both from your own benchmark and my own
measurements:
to ~4,000 tokens and 8–17 of 20 beyond.
2,000 tokens ≈ 6 s, 4,000 ≈ 21 s, 8,000 ≈ 190 s. Your README's "about 1.7 s"
is on an Apple GPU with PyTorch; on CPU/ONNX it is a different world, and I
document both rather than implying the faster one.
What I did not do
re-export the checkpoint,
tools/export-model.pyin the repo reproduces theONNX/INT8 build and
tools/model-diff.jsproves a new file answers the sameas the old one before it ships.
build_sequenceisported faithfully, and the answers match the Python runtime on the prompts I
tested.
Links
laya-system-onemodel
Apache-2.0, same as upstream. If this is useful to anyone, the credit belongs
here — please star the original repository.
All reactions