PTENES
Decision engine ยท Hands-on lab

Your support starts with a decision.

Run Laya on your machine. Classify tickets in Portuguese, check the signals, and send them for review.

Editorial image provided: Laya is here, open source
What it is

Four signals. One next step.

A fork of the official Laya with a small, verifiable application. The model suggests; a person confirms.

โ—ˆ Portuguese-language triage

Department, urgency, threat of cancellation, and refund request using the multilingual checkpoint.

โ—ˆ Interface, API, and terminal

Choose a browser to try it out, or use JSON to integrate it into a local process.

โ—ˆ Evaluation included

16 synthetic tickets, metrics, and predictions recorded. Errors are part of the deliverable, too.

How it works

From text to recommendation

The input is validated before inference. The application rejects text that would lose tokens and keeps human review in place for every response.

Ticket in Portugueseโ†’ Validation + Layaโ†’ Human review
Prerequisites

Set up the environment

Python 3.10+ recommended (tested with 3.12), Git, space for weights, and internet access for the first download. GPU is optional; CPU is the default.

Check Python and Git

Use a virtual environment. If you choose GPU, install a PyTorch version compatible with your hardware.

# command
python3 --version
git --version
User guide ยท step by step

From installation to your first ticket

Commands for Linux/macOS. On Windows, activate the environment with .venv\Scripts\activate. The published site is the guide; inference happens on the local server.

1

Install the project

The clone preserves the official SDK and adds the practical folder.

git clone https://github.com/inematds/laya.git
cd laya
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -e . -r practical/requirements.txt
2

Prepare the weights

Downloads and loads multilingual only. The first run takes longer.

python3 -m practical download
3

Try it in the terminal

The output is JSON. No external action is performed.

python3 -m practical triage \
  --message "Fui cobrado duas vezes. Quero o reembolso."
4

Open the triage desk

Open http://127.0.0.1:8765 in a browser on the same machine. Port in use? Use --port 8875.

python3 -m practical serve --port 8765
# GPU opcional: --device vem antes do subcomando
python3 -m practical --device cuda serve --port 8875
5

Integrate through the API

HTTP 422 indicates invalid input; 503 indicates the model is unavailable. Use the prediction only after HTTP 200.

curl -X POST http://127.0.0.1:8765/api/triage \
  -H "Content-Type: application/json" \
  -d '{"message":"Quero contratar o plano empresarial."}'
6

Measure and inspect errors

Compare the output with the expected labels and preserve the test conditions.

python3 -m practical --device cuda evaluate --output avaliacao.json
python3 -m unittest discover -s tests/practical -v
Examples

What happened in the real-world test

NVIDIA GB10, multilingual checkpoint, four questions per message. Small educational sample: this is not a production validation.

13 of 16 departments correct

81.25% accuracy, versus a 25% majority-class baseline. Multiclass Brier score: 0.30835; ECE across ten bins: 0.17988.

Inspect all results โ†’

Three errors preserved

A purchase of 20 licenses went to finance. A weather forecast and a message sent by mistake went to technical support.

The result shows why the policy keeps human review in place, even for confident predictions.

The choice confidence in the SDK measures how concentrated the distribution is; it does not guarantee a correct answer. Churn is an explicit threat in the text for this schema. None of these outputs authorize a refund or cancellation.

Roadmap

What exists and what comes next

The next steps depend on your own data and operational criteria. No automatic training is included in this release.

DELIVERED
Runnable labCLI, API, interface, input validation, review policy, examples, and evaluation.
NEXT
Your domain dataBuild and label representative samples, including negations and out-of-scope cases.
AFTER MEASURING
Specialization and gradual rolloutCalibrate, evaluate held-out data, and consider fine-tuning. Automation requires an additional validated policy.

Study in course v2 โ†’