Your reading comfort
MODULE 3.1

Triage console in Portuguese

Use the application and understand its boundaries.

6 topics 35–50 min with hands-on practice Practical application Commented exercises
Ticket in PT Four signals Triage agent LAYA / INEMA · conceptual flow
Your progress
Your progress
  1. Open the local interface
  2. Read the result as a recommendation
  3. The policy is outside the model
  4. Use the API with a small contract
  5. Data and export
  6. End-to-end lab
1

Open the local interface

What it is

The start command serves an HTTP server at 127.0.0.1, port 8765 by default. Open the address in your browser on the same machine. The form accepts an optional subject and a message; example buttons fill in billing, support, and sales cases without automatically running an analysis.

Why learn

The guide published on GitHub Pages is static documentation; the inference interface runs on the machine that executes Python. Do not confuse a public course link with a model server. The first analysis may load the weights and take longer.

Applied example

python3 -m practical --device cuda serve --port 8765; open http://127.0.0.1:8765.

✓ Apply with criteria

No. Pages serves HTML and assets. For inference, run the local project; the course and guide explain how to do it.

✗ Avoid the automatic conclusion

Does the model run on GitHub Pages?

Don’t accept an answer just by the field name or by the appearance of precision. Check the definition and the context of this section.

Key concepts

Loopback

local access

Server

Python process

Pages

static site

Form

controlled input

Test your understanding

Does the model run on GitHub Pages?

Check the commented answer

No. Pages serves HTML and assets. For inference, run the local project; the course and guide explain how to do it.

2

Read the result as a recommendation

What it is

The screen shows department, SDK confidence, cancellation urgency, threat of cancellation, and refund request. The full JSON preserves distributions and metadata for inspection. A numeric field is only useful when you know the question that produced it and the scale that was used.

Why learn

Start from the original text, check the suggested department, and look for contradictory signals. A request can include a refund without cancellation; dissatisfaction does not automatically imply critical urgency. The interface includes human review and states that calibration was not validated in the client’s domain.

Applied example

Ticket: thanks, the refund arrived. The presence of the word refund should not be automatically interpreted as a new request.

  1. 1
    Observe

    Ticket: thanks, the refund arrived. The presence of the word refund should not be automatically interpreted as a new request.

  2. 2
    Define

    The screen shows department, SDK confidence, urgency, cancellation threat, and a refund request.

  3. 3
    Check

    You don’t need to show everything in the foreground, but it should allow inspection. Expandable JSON provides details without turning the screen into a mandatory technical panel.

Key concepts

Contextual reading

full meaning

Signal

bounded prediction

Distribution

alternatives

Recommendation

reviewable decision

Test your understanding

Should the interface hide low probabilities to make it feel simpler?

Check the commented answer

You don’t need to show everything in the foreground, but it should allow inspection. Expandable JSON provides details without turning the screen into a mandatory technical panel.

3

The policy is outside the model

What it is

review_policy receives validated responses and builds the routing. The implementation returns human_review in all cases and automated_action_executed false. The confidence threshold adds a reason for review; it does not enable an automatic action. This boundary is an explicit product decision.

Why learn

Separating policy and inference lets you modify operational rules without rewriting the encoder. It also prevents treating act_probability—which is a learned field from upstream—as real permission to use tools, pay amounts, or delete records.

Applied example

Model: refund_requested 0,95. Policy: the triage agent must check billing, identity, and the refund rule in their systems.

Reference command / schema

python3 -m practical serve --port 8765
# On another terminal:
curl -X POST http://127.0.0.1:8765/api/triage \
  -H "Content-Type: application/json" \
  -d '{"message":"Fui cobrado duas vezes."}'

Key concepts

Policy

operational rule

Authorization

external permission

learned signal

is not permission

Review

human responsibility

Test your understanding

What needs to change before you automate any routing?

Check the commented answer

Define allowed actions, validate quality with your own data, set limits and auditability, test failures, and approve the policy. An isolated threshold doesn’t replace that work.

4

Use the API with a small contract

What it is

POST /api/triage accepts only message and subject. Validation rejects extra fields, empty messages, and excessive size. GET /api/health tells you whether the server responds and whether the model has already been loaded. The health check does not run inference and does not guarantee predictive quality.

Why learn

A consumer should check the HTTP status before using answers. A 422 response indicates an input problem, such as a token limit; 503 indicates the model is unavailable. Treating both as other would hide failures and pollute your metrics.

Applied example

Send JSON with message; process answers only after HTTP 200. Log the error type separately from the predicted label.

✓ Apply with criteria

The check should be fast and without expensive side effects. It distinguishes a live service from a loaded model; the real inference remains the test of the end-to-end path.

✗ Avoid the automatic conclusion

Why doesn’t /api/health load the model?

Don’t accept an answer just by the field name or by the appearance of precision. Check the definition and the context of this section.

Key concepts

HTTP 200

result

HTTP 422

invalid input

HTTP 503

unavailability

Health

service state

Test your understanding

Why doesn’t /api/health load the model?

Check the commented answer

The check should be fast and without expensive side effects. It distinguishes a live service from a loaded model; the real inference remains the test of the end-to-end path.

5

Data and export

What it is

The application does not automatically store the text of tickets. The user can download a JSON result, which contains predictions and execution metadata. The embedded examples are synthetic. For your own evaluation, minimize personal data and define where the files will be stored.

Why learn

Running locally avoids sending the ticket to an external inference API, but the weights need to be obtained from the Hub initially. Server logs and exported files also form part of the operation; review your settings before using real data.

Applied example

Replace name, email, and full document number with internal identifiers when they are not needed for classification.

Key concepts

Minimization

only what’s necessary

Export

user choice

Weights cache

initial download

Retention

retention time

Test your understanding

If the model is local, can any data be put in without thinking?

Check the commented answer

No. The machine, logs, backups, and people with access remain relevant. Use only the data you need and the rules from your organization.

6

End-to-end lab

What it is

Run the server, load an example, analyze, inspect the JSON, and download the result. Then change a phrase meaningfully: from I’m going to cancel to I’m not going to cancel. Compare the threat signal and record whether the model followed the negation.

Why learn

This test reveals real behavior without requiring a large benchmark. Do not change the expected label after seeing the response just to count an answer as correct. Separate schema review from evaluation: if you change the question, start a new version of the experiment.

Applied example

Create minimal pairs: I want a refund versus I do not want a refund; the service is down versus the service is back.

Key concepts

Minimum batch

controlled change

Negation

semantic change

Record

preserved evidence

Version

distinct experiment

Test your understanding

Which output demonstrates that the lab worked?

Check the commented answer

Two actual results with contrasting messages, identified device, four answered questions, and preserved human review—along with your analysis of the correct and incorrect parts.

Module summary

Select a snippet from the lesson to highlight or annotate. Questions and notes stay in your journey; export the JSON to back up.

Module reading