Meet Laya: A Fast, Open-Source TypeSafe Jev Alternative That Runs Without a GPU Laya, an open-source, TypeSafe Jev alternative hosted on GitHub by NandhaKishorM, runs decision-model inference locally on CPU or GPU without a GPU requirement, offering a CLI, a Python SDK, and an HTTP API plus English and multilingual models covering over 100 languages. In a CPU test of the English model, Laya classified the request "I need to reschedule my clinic appointment tomorrow" as intent cancellation with 79.2% probability, urgency 0.648, frustration 1.11, refund_requested 0.088, and churn_risk 0.160 — the wrong intent, which the tutorial cites as a reminder that confidence scores do not guarantee correct predictions. The tutorial installs Laya via "pip install laya[serve]" on Python 3.10 or newer with CPU-only PyTorch, then builds a Router-based classifier that sorts requests into medical, finance, or education categories and scores urgency. Meet Laya: A Fast, Open-Source TypeSafe Jev Alternative That Runs Without a GPU Learn how to run lightweight AI decision models locally using Python, classify requests, generate structured predictions, and build fast AI applications 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 https://github.com/NandhaKishorM/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 https://pytorch.org/ 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. - Intent: Laya predicted cancellation with 79.2% probability, even though the user wanted to reschedule. - Urgency: It returned a 0.648 estimated probability of urgency. - Frustration: It assigned a score of 1.11. - Refund requested: Only an 8.8% estimated probability. - Churn risk: A 16% estimated probability. The model got the intent wrong. This is a good reminder that confidence scores don't always mean the prediction is correct. The first prediction downloads the English checkpoint from Hugging Face https://huggingface.co/ . Later predictions reuse the cached model. 3. Building a Simple Classifier Now let's build something useful. We want to classify requests into medical, finance, or education categories, estimate urgency, and detect rescheduling requests. Create app.py : python from laya import Router router = Router device="cpu" state = { "subject": "Reschedule an appointment", "body": "I have a clinic appointment tomorrow, but I can't make it. Please help me reschedule." } questions = { "area": { "type": "choice", "instructions": "Which area does this request relate to?", "criteria": { "medical": "Clinic visits and appointments", "finance": "Payments and transactions", "education": "Courses and school" } }, "urgency": { "type": "score", "instructions": "How soon does this need attention?", "criteria": "Can wait several days", "Needs attention within a few days", "Needs attention today" }, "reschedule": { "type": "noul", "instructions": "Does the user want to reschedule an appointment?" } } if name == " main ": result = router.predict state, questions, model="english" answers = result "answers" print "Area:", answers "area" "choice" print "Urgency:", answers "urgency" "score" print "Reschedule probability:", answers "reschedule" "noul" print "Model:", result "routing" "model" Run it: python app.py Actual test output: Area: medical Urgency: 1.789 Reschedule probability: 0.9355 Model: english This time, the model performed better. It correctly selected medical. The urgency score was 1.789 on a scale from 0 to 2, putting it close to "Needs attention today." The model also returned a 93.55% estimated probability that the user wanted to reschedule. Laya supports three decision types: choice selects an option, score evaluates an ordered scale, and noul estimates a yes/no probability. 4. Processing Multiple Requests Laya also supports batch processing, so we can classify several requests together. Create batch.py next to app.py : python from app import router, questions tickets = "Please reschedule my clinic appointment next week.", "My bank statement shows an unknown card payment.", "When is my university assignment deadline?" requests = { "state": text, "questions": questions, "model": "english" } for text in tickets results = router.predict batch requests for result in results: print result "answers" "area" "choice" Run it: python batch.py Actual test output: medical finance education All three requests were classified correctly in this test. The router groups compatible requests for prediction and returns the results in their original order. 5. Running Laya as a Local API Laya also includes an HTTP server, so you can integrate it into existing applications. Start the CPU server: LAYA HOST=127.0.0.1 LAYA DEVICE=cpu LAYA PRELOAD=0 laya-serve Open another terminal and send a request: curl -X POST http://127.0.0.1:8000/v1/systemone \ -H "Content-Type: application/json" \ -d '{ "model": "english", "state": "When is the university assignment deadline?", "questions": { "education": { "type": "noul", "instructions": "Is this request about education?" } } }' Actual response shortened : { "answers": { "education": { "type": "noul", "noul": 0.4584 } }, "routing": { "model": "english", "reason": "explicit model='english'" } } Interestingly, Laya returned only a 45.84% probability that this request was about education, even though it clearly mentioned a university assignment. This shows that the model can perform differently depending on how you frame the question. The API supports a TypeSafe Jev-compatible request format https://nandhakishorm.github.io/laya/http-api/ , making it easier to integrate Laya with existing decision-making workflows. Final Thoughts Laya is worth exploring if you are building AI agents, classifiers, or automated workflows. It is lightweight, supports both CPU and GPU, and is simple to use with Python or a local API. One thing I learned from testing Laya is that how you ask a question matters a lot . The model can give different predictions depending on how you structure your prompt, describe the options, or provide context. As we saw in our examples, it sometimes gets obvious answers wrong, even when the confidence score looks reasonable. I would recommend keeping your questions clear, avoiding vague or subjective instructions, and testing different prompt styles before using Laya in a real application. If I were you, I would start with the CLI, experiment with the Python SDK, and only move to production once the predictions are consistent and reliable. \ Abid Ali Awan\ https://abid.work https://abid.work @1abidaliawan https://www.linkedin.com/in/1abidaliawan is a certified data scientist professional who loves building machine learning models. Currently, he is focusing on content creation and writing technical blogs on machine learning and data science technologies. Abid holds a Master's degree in technology management and a bachelor's degree in telecommunication engineering. His vision is to build an AI product using a graph neural network for students struggling with mental illness.