Laya for Go, Java, Elixir, Ruby and Zig
Beyond Python and JavaScript, the community has ported Laya to several other languages. Most run an ONNX export with ONNX Runtime, a few reimplement the model natively, and some are thin clients for a Python process or HTTP server.
33 projects
laya-decision-web
LeeeeeeM
Runs a local browser demo for Laya decisions in Snake and side-scrolling game scenarios
ruby_llm-providers-laya
codenamev
A RubyLLM provider uses local ONNX Laya checkpoints to answer judge questions
ruby_decision_model-providers-laya
codenamev
Adds a local ONNX-backed Laya provider to the Ruby decision-model gem
quarkus-langchain4j-jev-laya
kdubois
Integrates Jev and self-hosted Laya decision backends into a Quarkus LangChain4j agent
Reflex
dimpu47
Routes infrastructure alerts using Jev or local Laya decision model APIs
ohmylaya
QuBiit0
Installs laya.cpp and exposes local Laya decisions to coding agents through MCP and an agent skill
layajev
metalagman
A Go server runs Laya locally behind a Jev-compatible decision API
intents
ezeike
Documents and sketches decision-model patterns for routing user input to application actions
laya-mc-bot
LixiaoLeo123
Minecraft bots use Laya decision models alongside external LLM harnesses
Go
laya-onnx (MstyAI) is a Go library and CLI on ONNX Runtime for macOS and glibc Linux:
go install github.com/MstyAI/laya-onnx/cmd/laya-onnx@latest
laya-onnx prepare
Preparation downloads about 819 MiB. laya-go (lengoman) (go get github.com/lengoman/laya-go) is a Go client that drives a Python laya sidecar or server. system-one-router is a Go LLM gateway that uses local Laya or Jev to pick a model.
Java
Laya4j runs the multilingual checkpoint through ONNX Runtime Java and needs Java 17+:
<dependency>
<groupId>com.laya4j</groupId>
<artifactId>laya4j-core</artifactId>
<version>0.2.0</version>
</dependency>
It mirrors the Python presets (triage, guard, moderation, model router). The README reports 148 ms p50 for a 5-question predict on a Mac M4 CPU.
Elixir
laya_ex is a native Nx/Bumblebee runtime that downloads the official checkpoint on first load. It does not choose an Nx backend, so configure one, for example EMLX.Backend on Apple Silicon or EXLA.Backend on CPU and NVIDIA.
Ruby
ruby-laya is a port with a Router and a declarative Laya::Decision class, running on ONNX Runtime (Ruby 3.3+):
bundle add ruby-laya
laya (EduardoGHdez) is a smaller gem (gem "laya") that runs the receptron ONNX export on CPU.
Zig
zlaya is a CPU-only engine that can also build to WebAssembly. It needs Zig nightly:
zig build -Doptimize=ReleaseFast
sh scripts/download-model.sh models/laya
zig-out/bin/zlaya models/laya examples/triage.json
The README gives about 1.7 GiB of RAM for loading and inference. laya-zig is a dependency-free Zig runtime for the multilingual model, and its author labels it a work in progress.
Caveats
These are independent community projects with different maturity levels. Check each one's parity tests against the Python reference before relying on its probabilities.
More ways to use Laya