Llama-3.1-8B-triage-volkov
a customer support request sorting adapter
2 min readupdated
This model is a LoRA (a small fine-tuned add-on built on top of a base model) for Llama 3.1 8B Instruct, designed to automatically classify customer inquiries for online stores in English and Malay. It outputs a structured JSON object containing the issue category, urgency level, and whether human intervention is needed. The model was trained on a dataset of 567 examples with a focus on edge cases, sarcasm, and unconventional wording. It is useful for developers and businesses looking to automate the initial processing of customer chats and support tickets.
Key features
- Precise JSON output featuring category, urgency, and human handover flag fields.
- Support for two languages: English and Malay.
- Fine-tuned using Unsloth technology on an NVIDIA GB10 GPU.
- Test accuracy boosted to 90 percent compared to 36 percent for the base version.
What you can do
- Integrate it into an online store's automated incoming message handling system for fast ticket sorting.
- Apply it in educational and experimental projects focused on language model-based support automation.
- Use it in sentiment analysis pipelines to detect urgent customer complaints.
Example
from huggingface_hub import hf_hub_download
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
repo = "Volkov04/Llama-3.1-8B-triage-volkov"
model = AutoPeftModelForCausalLM.from_pretrained(repo, device_map="auto", torch_dtype="auto")
tokenizer = AutoTokenizer.from_pretrained(repo)
system = open(hf_hub_download(repo, "system_prompt.txt"), encoding="utf-8").read().strip()
messages = [{"role": "system", "content": system},
{"role": "user", "content": "Tracking hasn't moved for five days, can you check?"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
output = model.generate(inputs, max_new_tokens=40, do_sample=False)
print(tokenizer.decode(output[0][inputs.shape[1]:], skip_special_tokens=True))
Read more
DetailsBenchmarks: 76 percent correct answers on a hidden leaderboard split.
Training parameters: LoRA, rank 16, alpha 16, dropout 0, 3 epochs, lr 2e-4, batch size 8.
Limitations: may overestimate urgency when threats are present in the text and miss some queries that require an operator.










Comments