Laya Offers Local AI Decisions Without GPU

Laya, an alternative open-source to TypeSafe Jev, allows for the execution of decision models locally on CPU, with a multilingual offering covering over 100 languages. Its interfaces are particularly aimed at applications that need to classify a request or choose an action rather than produce a lengthy response. However, tests yield mixed results.
A university query receives only 45.84%
When queried by HTTP about whether a university deadline question falls within the educational domain, Laya returns a probability of 45.84% in one test. The response confirms the explicit choice of the English model.
Another test involves a batch that includes a medical appointment reschedule, an unrecognized bank payment, and a university deadline: all three requests are correctly classified. The batch.py file reuses the router and questions from app.py, then calls router.predict_batch. The router gathers compatible requests while returning responses in their original order.
To integrate these decisions into an existing application, Laya includes an HTTP server and accepts a request format compatible with TypeSafe Jev. The university call uses a POST request containing JSON, addressed to http://127.0.0.1:8000/v1/systemone with the parameter english.
Mixed results for a medical reschedule
In a Python test, Router is configured on CPU to differentiate between medical, financial, and educational domains, measure urgency, and identify a desire to reschedule. The call to router.predict receives a state including an object and a message body, along with questions, using the English model. The medical reschedule request is then correctly classified; the estimated probability of rescheduling reaches 93.55%. Urgency scores 1.789 on a scale from 0 to 2, close to the level requiring same-day intervention.
The AI brief the pros read every evening
The 7 best AI stories, the essentials in 5 min. Free.
Included when you join: our pick of the best AI guides & comparisons.
Choose your rhythm
Free · No spam · Unsubscribe in 1 click
Laya offers three types of decisions: choice is used to select an option, score to evaluate an ordered scale, and noul to estimate a binary probability. However, a separate test executed in the terminal with the triage preset classifies a medical reschedule request as a cancellation, with a 79.2% probability. Thus, a confidence level does not guarantee accuracy.
This last execution also uses the English model on CPU. It produces an urgency estimate of 0.648, a frustration score of 1.11, an 8.8% probability of a refund request, and an estimated 16% risk of unsubscribing.
Structured decisions accessible via Python or HTTP
TypeSafe Jev allows for requesting structured decisions accompanied by probabilities instead of generating text. Selecting a tool, categorizing requests, or determining the next action falls under this approach. Decision models can be faster, cheaper, and more efficient than the systematic use of a response generated by a large language model.
Laya offers a lightweight alternative based on Python and PyTorch. Access is through the terminal, a Python development kit, or the HTTP API. Potential use cases include AI agents, classifiers, and automated processes.
Python 3.10 is required for installation
Operation without a graphics card does not exclude hardware acceleration: Laya accepts inference on both CPU and GPU. Detailed tests employ only the English model on CPU, while the offering also includes multilingual models for over 100 languages.
Installation requires at least Python 3.10. The procedure involves setting up a virtual environment on macOS or Linux; on Linux, it installs the CPU variant of PyTorch from its dedicated repository. The command pip install "laya[serve]" adds Laya and the necessary dependencies for the server.
For the local server, the command uses laya-serve with LAYA_HOST=127.0.0.1, LAYA_DEVICE=cpu, and LAYA_PRELOAD=0. During the first prediction, the English checkpoint is downloaded from Hugging Face. Subsequent calls reuse this cached copy.
Brief AI — AI news in French
The essentials of artificial intelligence news, decoded and explained every day.