
Abid Ali Awan
· 1 min read
Meet Laya: A Fast, Open-Source TypeSafe Jev Alternative That Runs Without a GPU
TypeSafe Jev introduced a new way of using AI models. Instead of asking a model to generate text, we can ask it to make a decision and return structured results with probabilities. And if you think about it, a lot of AI applications don't really need long explanations. They just need to decide which tool to use, how to classify a request, or what action to take next.
This is where decision models become interesting. They can be faster, cheaper, and more efficient than using a large language model to generate an answer every time.
And now we have Laya, a lightweight, open-source alternative to TypeSafe Jev that you can run locally without a GPU. It supports both CPU and GPU inference, builds on the mature Python and PyTorch ecosystem, and provides a simple command-line interface (CLI), a Python software development kit (SDK), and an HTTP API. It also offers English and multilingual models supporting over 100 languages.
In this tutorial, we will use the English-only model on a CPU to keep things simple. We will install Laya, test its predictions, build a small decision-making application, and run it as a local API.
1. Installing Laya
First, make sure you have Python 3.10 or newer.
Create and activate a virtual environment on macOS or Linux:
python3 -m venv .venv
source .venv/bin/activate
On Linux, install CPU-only PyTorch:
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
Now install Laya with its server dependencies:
python -m pip install "laya[serve]"
2. Testing Laya Using the Command-Line Interface
Before writing Python code, let's try Laya from the terminal.
laya "I need to reschedule my clinic appointment tomorrow" --preset triage --model english --device cpu
Here is the output from the local CPU test:
Model : english
Reason : explicit model='english'
intent : cancellation (p=0.792)
is_urgent : 0.648
frustration : 1.11
refund_requested: 0.088
churn_risk : 0.160
Let's understand what happened.
Create app.py:
Original source
This story was published by KDnuggets and written by Abid Ali Awan. SyncAI.news shows a preview; the complete article is on the publisher's site.
Read the full story on kdnuggets.com


