01 / Check Python requirements and create an environment
The repository specifies Python 3.10 or newer. Use a dedicated environment so project dependencies stay separate. The commands below use a macOS or Linux shell.
python3 -m venv .venv
source .venv/bin/activate02 / Install Laya with pip
python -m pip install layaCheck the repository’s platform instructions if installation fails. First use may download model weights, so allow for network access, storage, and a slower first request.
03 / Run a local Laya classification example
Save this example as first_decision.py, then run python first_decision.py. It adapts the documented Router interface to a support-queue decision.
from laya import Router
router = Router()
questions = {
"queue": {
"type": "choice",
"instructions": "Which team should handle this message?",
"criteria": {
"billing": "Charges, invoices, and refunds",
"technical": "Bugs, errors, and outages",
"other": "Anything else",
},
}
}
result = router.predict("I was charged twice.", questions)
print(result["answers"]["queue"]["choice"])The code prints the selected label. “Billing” is the intended label for this example, not a guaranteed model response.
04 / Try inputs that challenge the labels
- “My invoice page shows an error.” Is that billing or technical?
- “Thanks, everything works now.” Does your “other” category cover it?
- “I need a refund and I cannot sign in.” Should a single label be enough?
These examples test your task definition as much as the model. Write the expected labels first, then inspect disagreements.
Before you serve real requests
Record the installed package and checkpoint versions, measure memory usage, and decide how to handle a failed prediction. If you expose an endpoint, add authentication, input limits, and observability as part of the application.
Sources & review notes
Source review: September 27, 2026. Product documentation can change. Atlas has not rerun model inference. Third-party measurements, where included, are attributed to their authors.
- Laya repository — Python requirement, installation command, and Router API