Self-hosted · Python 3.10+
Laya local
Run Laya locally with laya-serve. The server loads the open weights on your machine and answers POST /v1/systemone with a typed choice, score, or yes/no. The first start downloads the checkpoint from Hugging Face.
What you need
- Python 3.10 or newer.
- A CPU is enough for one checkpoint. Set
LAYA_DEVICE=cudaonly when this machine has an NVIDIA GPU. - Disk for the weights. The English checkpoint is about 800 MB. Multilingual is a separate download.
Install and start Laya locally
- Create a virtual environment and install the server extra:
pip install "laya[serve]". - Bind the process to
127.0.0.1. The package default listens on every interface at port 8000. - Preload one checkpoint. Local names are
english,multilingual, andtyped-decisions.laya-englishis not a checkpoint name. - Set
LAYA_API_KEYbefore any other machine calls this server.
python -m venv .venv
.venv\Scripts\python -m pip install "laya[serve]"
$env:LAYA_HOST = "127.0.0.1"
$env:LAYA_PORT = "8000"
$env:LAYA_DEVICE = "cpu"
$env:LAYA_MODELS = "english"
$env:LAYA_PRELOAD = "1"
$env:LAYA_API_KEY = "choose-a-local-secret"
laya-serve On macOS or Linux, create the same virtual environment, activate .venv/bin, and export those variables instead of using $env:.
Call the local API
Check GET /health, then send state plus named questions. Use model english or multilingual so the router keeps that checkpoint.
curl http://127.0.0.1:8000/health
curl http://127.0.0.1:8000/v1/systemone \
-H "Authorization: Bearer choose-a-local-secret" \
-H "Content-Type: application/json" \
-d '{
"state": "Payment failed since yesterday.",
"model": "english",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"Billing": "Payments and invoices",
"Technical": "Bugs and outages"
}
}
}
}'Laya local and the hosted playground
Laya local is the open-weight server on your computer. To try the same question in the browser, open the playground with a Laya model already selected: