Llama-3.1-8B-triage-anthropic
LoRA adapter for automated customer support triage
2 min readupdated
This model is a LoRA (a small add-on for a base model for fast fine-tuning) built on top of Llama-3.1-8B-Instruct, trained to sort online store customer messages and output results strictly in JSON (data exchange text format). The adapter categorizes inquiries, determines urgency levels, and decides whether a human agent is needed. The model is designed for customer support automation and efficient processing of incoming requests across multiple languages.
Key features
- Multilingualism: Supports English, Malay (including Manglish), Mandarin, and partially Hindi, Tamil, French, and Spanish.
- Strict JSON output: Guarantees correct data structure formatting for integration with external systems.
- Efficient training: Fine-tuned using the QLoRA (quantized adaptation method) method in just 17 minutes on a single NVIDIA L4 GPU.
- High accuracy: Correctly handles 94% of cases on a test set compared to 36% for the unconfigured base model.
What you can do
- Support integration: Connect the adapter as a backend service for automated primary processing of customer tickets.
- Chat sorting: Set up a messenger bot to distribute urgent complaints and refund requests.
- Inquiry analysis: Use the model to quickly filter messages by criticality level (for example, identifying fires, fraud, or injuries).
Example
from unsloth import FastLanguageModel
model, tok = FastLanguageModel.from_pretrained("aniqsfwn/Llama-3.1-8B-triage-anthropic", max_seq_length=2048, load_in_4bit=True)
FastLanguageModel.for_inference(model)
msgs = [{"role": "system", "content": open("system_prompt.txt").read()},
{"role": "user", "content": "My parcel never arrived and I was charged twice."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(input_ids=ids, max_new_tokens=64, do_sample=False)[0][ids.shape[1]:], skip_special_tokens=True))Read more
DetailsBenchmarks: 94% correct answers compared to 36% for the base model, 100% JSON format compliance.
Hardware: Requires 1 GPU supporting 4-bit quantization (a GPU with 22.5 GB VRAM will work).
Limitations: Poor at counting days between dates, confuses first-time inquiries with follow-ups, requires mandatory human oversight in critical situations.
Training: 908 labeled messages (1057 rows), 3 epochs, QLoRA (r=16, alpha=16).










Comments