Applied AI
Updated Nov 2026 by Mangesh Kashid
Fine-tuning a small model to route banking support tickets
I fine-tuned Qwen3-0.6BI started with Qwen3-0.6B and trained it to turn banking support requests into a fixed JSON response. with LoRAI trained a small adapter for Qwen3 while leaving nearly all base weights alone, then merged it into the model for local use. to classify banking support tickets. I ran the model locally and checked both the predicted intent and whether its response could be parsed by other software.
Role
Creator & Maintainer
Duration
2025 project
Evaluation results
- 50/50 Correct intents on held-out tickets
- 50/50 Schema-valid responses on the same tickets
- 93.4% Intent accuracy on a separate 2,600-example evaluation
- ~0.5% Model weights trained with LoRA
The larger evaluation is self-reported. The 50-ticket evaluation is available with per-ticket results.
Background and problem
Support tickets arrive in natural language. Routing systems need structured intent labels.
The public Bitext dataset had 25,545 rows in November 2026 and covers about 27 intents. I used 90% of the data for training and reserved 10% for evaluation.
The classifier returns a fixed JSON object so downstream code can parse the result.
When the output doesn’t fit
In the repo’s password-reset example, the classifier returns get_password. The next system can use that label to route the request.
The response has a fixed format so other code can check it.
The opportunity
I wanted one pipeline for training and running the model locally:
Start with public support tickets, fine-tune a small model, export it to GGUFI exported the merged classifier as GGUF f16 so it can run locally through llama-cpp-python. and classify tickets locally.
Building the pipeline
I formatted the Bitext examples as chat prompts with structured target responses, then fine-tuned Qwen3-0.6B with TRLI used TRL to train Qwen3 on conversations paired with the structured responses I wanted it to produce. and PEFT LoRAI used PEFT to train a LoRA adapter without changing the rest of the Qwen3 weights..
Data prep, training, conversion and inference each run on their own. The classifier runs locally, so tickets don’t go to a third-party API.
Fine-tuned on Apple Silicon
I trained the LoRA adapter locally on Apple SiliconI trained the Ticket Classifier on my Mac using its GPU rather than renting one in the cloud. using the MPS backendI used PyTorch's MPS backend to run local LoRA training on the Mac GPU., without a cloud GPU.
Validating the response
Each result contains an intent, a confidence number and a one-line reason. The evaluation checks that outputs are valid JSON with the expected keys and types.
I use a rule-based confidence score from data preparation. It isn’t a calibrated probability.
Checking held-out results
I tested the local GGUF model on held-out ticketsI keep evaluation tickets out of training to see whether the classifier can handle examples it has not seen., checking the intent and JSON schemaI check that every classifier result has the same three fields and that intent, confidence and reason have the right types. independently.
From a ticket to structured data
The classifier takes a plain-text ticket and returns its intent, confidence and a short reason as JSON. The README shows a password-reset example.
I strip Qwen’s reasoning blocks before parsing the classifier response.
Showing why a label was chosen
The reason field explains why the classifier chose the label.
Applications can use the intent field to route the ticket.
From training to local inference
I trained a LoRA adapter, merged it into the base model, exported a GGUF f16 checkpoint and ran it locally with llama-cpp-pythonI use it to load the GGUF classifier locally and get back the generated text for parsing.. The repo documents each step.
Six steps from public data to a local model. Step through them, or read all six at once.
Check accuracy and schema validity on a held-out slice.
The repo includes a per-sample evaluation report.
Trying the classifier
The repo shows how to pass a ticket to the classifier and read its parsed response. The trained weights are not bundled; the README documents how to reproduce them.
The public evaluation report includes the metrics and individual test predictions.
Reflections
I published the individual held-out predictions so you can check where the labels came from. This test doesn’t tell us how the classifier would handle all banking support traffic.