Use cases / Support tickets

Support ticket classification with local AI

Classify support tickets locally: assign a team, detect refund requests, and score urgency in one call. Includes Python code, evaluation, and review guidance.

Try the HF demo ↗Run locally ↓View on GitHub ↗

Open weights · Apache-2.0 · Examples for jev-style 0.6.2

When to use this local approach

For a local Python support-ticket classifier, JevStyle scores the team, refund intent and urgency from one input. Compare it with a trained classifier or embedding router; use the label-only migration guide to test a replacement before dispatching actions.

Three questions about the same ticket

Use this workflow when your next step depends on a defined category or score. Keep customer communication, eligibility checks, and actions such as refunds in the systems that own those decisions.

A support inbox needs more than a single category. You may need a team assignment, a factual yes/no check, and an ordered priority signal. JevStyle accepts these questions together and reads the shared ticket once.

QuestionTypeRead from the response
Which team?choiceSelected label and probability for each option
Is a refund explicitly requested?noulProbability that the statement is true
How soon is action requested?scoreExpected position on the ordered scale and its distribution

Run the small text model

Use Python 3.10 or newer in a virtual environment. Install the backend for your machine, then keep the server running in this terminal.

bash
# Apple silicon
python -m pip install "jev-style[mlx]"

# Linux, Windows, or an Intel Mac: use this instead
# python -m pip install "jev-style[torch]"

jev-style serve --release 0.8b

The first run downloads the model. Once it is ready, open the local Playground. Run the Python examples in a second terminal with the same environment.

Classify your first ticket

Save this as ticket.py, then run python ticket.py. The input is illustrative; the script prints the actual response from your running model.

python
import json
from jev_style import JevStyle, choice, noul, score

ticket = {
    "subject": "Duplicate charge",
    "body": "I was billed twice for my March plan. Please refund one charge today.",
}
with JevStyle(base_url="http://127.0.0.1:8765") as model:
    result = model.decide(ticket, {
        "team": choice("Which team should handle this ticket?", {
            "billing": "Charges, refunds, invoices, and payment methods",
            "shipping": "Deliveries, tracking, and lost parcels",
            "account": "Login, passwords, and account settings",
            "other": "Anything outside those teams",
        }),
        "refund_requested": noul("The customer explicitly requests a refund."),
        "urgency": score("How soon does the customer request action?", [
            "No deadline stated", "This week", "Today or immediately",
        ]),
    })
print(json.dumps(result["answers"], indent=2))

A score is an expected zero-based level index, so the three levels above span 0 to 2 and the result may be fractional. It is not a probability. The refund_requested.noul value is P(true).

Keep your support policy explicit

A refund request is different from refund eligibility. Use the model to recognize what a customer asks; use order records and your refund policy to decide what is permitted. For multi-issue tickets, add separate yes/no checks if more than one team can be involved, rather than assuming one choice describes every issue.

Send ambiguous assignments to your triage queue. Evaluate urgency against written labeling guidance, since customer tone, requested deadline, and business severity are different signals.

Evaluate the inbox you actually receive

Start with human-reviewed tickets from your own languages and categories. Hold back a test split before adjusting question wording. Track routing accuracy per team, missed urgent cases, and how many tickets need review at your chosen threshold.

The repository includes 30 hand-written support tickets to demonstrate the evaluation file format. They are useful for a smoke test, not evidence of production accuracy.

bash
git clone https://github.com/lawrence3699/jev-style.git
cd jev-style
jev-style eval examples/support_tickets.jsonl --url http://127.0.0.1:8765 --strict

Follow the evaluation guide to replace the illustrative file with representative, independently labeled data.

Make multilingual performance measurable

The 0.8B release has published evaluations across 51 languages. That does not establish accuracy for every support domain or language variety. Include your customers’ wording, mixed-language tickets, spelling errors, and rare classes in evaluation.

The 0.8B model accepts text and JSON. For decisions that require reading a receipt image, use the 2B v4 PyTorch build.

Common questions

What can JevStyle classify in a support ticket?

You define the questions and categories. This example selects a team, detects an explicit refund request, and scores the requested urgency from one shared ticket. These outputs describe the ticket; they do not authorize a refund, send a reply, or update your help desk.

Do customer tickets have to leave my machine?

The local example sends inputs to a server on 127.0.0.1. After installing dependencies and downloading the model, those decision calls do not need the hosted JevStyle API. The Hugging Face demo is a separate hosted service. Your surrounding help desk, logging, and other integrations may still transmit data.

Can I classify tickets in different languages?

The 0.8B release has published multilingual evaluations, but those results do not establish performance on your ticket categories. Test each important language, mixed-language input, rare issue, and ambiguous request on your own labeled examples. Read the benchmark scope and limitations before comparing scores.

How should uncertain tickets and server failures be handled?

Send ambiguous assignments and low-probability decisions to human triage. Handle timeouts, connection failures, and invalid responses as review cases too. Choose thresholds using labeled validation data and evaluate missed urgent tickets separately from overall accuracy. The example above prints scores and does not implement automatic dispatch.

Which local model should I start with?

The tutorial uses 0.8B v3 for text and JSON. The 2B v4 PyTorch build also accepts images, such as receipts; its MLX and GGUF builds are text-only. Compare task accuracy, available memory, and end-to-end latency on your hardware using the model selection guide.