Llama-3.1-8B-Triage-NULL
a LoRA adapter for support message classification
2 min readupdated
This tool is designed to automatically sort customer inquiries in an online store. The model outputs a JSON structure with three fields: request category, urgency level, and whether human intervention is required. The solution is built on top of the Llama-3.1-8B-Instruct model using QLoRA (an efficient fine-tuning method with quantization) and is built to support customer service workflows.
Key features
- Precise structure: classifies incoming messages strictly into the specified JSON format.
- Quality boost: exact match accuracy rose to 76% compared to 31% for the base model.
- Multilingual support: training included English, Malay, and code-mixing.
- Ready-to-use script: the repository contains the adapter and system prompt for quick integration.
What you can do
- Set up support: integrate the adapter into a local pipeline for automated ticket filtering.
- Analyze requests: distribute customer messages by category and urgency level.
- Check escalation: identify messages requiring human intervention.
Example
from pathlib import Path
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
"model",
max_seq_length=2048, load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
messages = [
{"role": "system", "content": Path("model/system_prompt.txt").read_text(encoding="utf-8").strip()},
{"role": "user", "content": "My parcel is late. Can you check it?"},
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
output = model.generate(input_ids=inputs, max_new_tokens=120, do_sample=False)
print(tokenizer.decode(output[0][inputs.shape[1]:], skip_special_tokens=True))
Read more
DetailsBenchmarks: exact match increased from 31% (for the base model) to 76% (V24).
Training: QLoRA SFT based on unsloth/Llama-3.1-8B-Instruct using an NVIDIA L4 GPU, 3 epochs.
Limitations: classification errors and false positives are possible, mandatory human oversight is required.










Comments