Downloads · 30 days
5
14% of all-time downloads
hassanabdel/llama-3.2-3b-support-ticket-lora
llama-3.2-3b-support-ticket-lora is a text generation model from hassanabdel. Use it when you need the model to write or continue text. It is set up for peft.
A LoRA adapter fine-tuned from meta-llama/Llama-3.2-3B-Instruct for structured customer-support ticket analysis.
Downloads · 30 days
5
14% of all-time downloads
All-time downloads
37
Public
Repo size
456 MB
Likes
0
Public
Click a slice to open those files.
.pt293 MB · 53%
From the Hugging Face model README
A LoRA adapter fine-tuned from meta-llama/Llama-3.2-3B-Instruct for structured customer-support ticket analysis.
The adapter is designed to analyze a customer-support conversation and produce a structured JSON response containing ticket triage, function/tool selection, internal analysis, and a customer-facing draft response.
This repository contains a LoRA adapter, not a standalone model.
The adapter must be loaded with the exact base model specified below.
| Property | Value |
|---|---|
| Base model | meta-llama/Llama-3.2-3B-Instruct |
| Fine-tuning method | Supervised Fine-Tuning (SFT) |
| Adapter | LoRA |
| Quantization | 4-bit |
| Framework | LlamaFactory |
| Sequence length | 1024 |
| Epochs | 3 |
| LoRA rank | 8 |
| LoRA alpha | 16 |
| LoRA dropout | 0.05 |
The model is trained to transform customer-support tickets into structured operational information.
Given a ticket containing:
the model produces:
Triage
Function call
Internal notes
Draft response
The model is trained using the following input structure:
{
"ticket": {
"customer": "Customer Name",
"history": [
{
"role": "customer",
"content": "Previous customer message"
},
{
"role": "agent",
"content": "Previous agent response"
}
],
"current_message": "Current customer message"
}
}
The following dataset fields are not provided to the model as input:
ticket_iddomainissue_typesThese fields may exist in the underlying dataset for organization and evaluation purposes, but they are intentionally excluded from the model input.
The expected output is a JSON object with the following structure:
{
"triage": {
"department": "string",
"priority": "low | medium | high | critical",
"sentiment": "string",
"estimated_resolution_time": "string"
},
"function_call": {
"name": "string",
"arguments": {}
},
"internal_notes": {
"issue_category": "string",
"root_cause_analysis": "string",
"suggested_solution_steps": [
"string"
]
},
"draft_response": {
"tone": "string",
"email_body": "string",
"actions_required_from_customer": "string"
}
}
triageProvides an initial classification of the ticket.
{
"department": "billing",
"priority": "medium",
"sentiment": "neutral",
"estimated_resolution_time": "2 business days"
}
function_callSpecifies the function or tool that should be used and the arguments required to execute it.
{
"name": "initiate_refund",
"arguments": {
"order_id": "QB12345678",
"amount": 2.5
}
}
The model predicts the function call. It does not execute external functions itself.
The application or agent layer should validate the generated arguments and execute the corresponding function.
internal_notesContains structured reasoning intended for internal support workflows.
{
"issue_category": "billing_dispute",
"root_cause_analysis": "The system may have automatically applied a standard service fee.",
"suggested_solution_steps": [
"Locate the order in the system",
"Confirm whether the service fee applies",
"Process a refund if the fee was incorrectly applied"
]
}
draft_responseContains the customer-facing response.
{
"tone": "neutral",
"email_body": "Hello Noah,
Thank you for contacting us...",
"actions_required_from_customer": "None"
}
The intended production architecture separates model reasoning from tool execution:
Customer Support Ticket
│
▼
┌─────────────────────────┐
│ Fine-tuned Llama 3.2 3B │
│ │
│ • Ticket analysis │
│ • Triage │
│ • Classification │
│ • Function selection │
│ • Argument extraction │
│ • Draft response │
└────────────┬────────────┘
│
▼
Structured JSON
│
▼
┌─────────────────────────┐
│ Agent / Backend Layer │
│ │
│ • Validate arguments │
│ • Apply permissions │
│ • Execute functions │
│ • Handle API/database │
└─────────────────────────┘
This adapter is therefore intended to be one component inside a larger customer-support agent system.
The model was fine-tuned using:
meta-llama/Llama-3.2-3B-InstructThe training dataset consists of customer-support ticket examples paired with their expected structured JSON responses.
Install the required libraries:
pip install transformers peft accelerate bitsandbytes
Then load the adapter with the base model:
import torch
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
)
from peft import PeftModel
BASE_MODEL = "meta-llama/Llama-3.2-3B-Instruct"
ADAPTER = "hassanabdel/llama-3.2-3b-support-ticket-lora"
tokenizer = AutoTokenizer.from_pretrained(
BASE_MODEL
)
model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(
model,
ADAPTER
)
model.eval()
ticket = {
"ticket": {
"customer": "Noah",
"history": [
{
"role": "customer",
"content": "I was charged an extra service fee on my order."
},
{
"role": "agent",
"content": "Could you provide your order number so I can check the charge?"
}
],
"current_message": "My order number is QB12345678. The extra $2.50 fee shouldn't have been charged."
}
}
The model should analyze this ticket and return a structured JSON response following the output schema.
{
"triage": {
"department": "billing",
"priority": "medium",
"sentiment": "neutral",
"estimated_resolution_time": "2 business days"
},
"function_call": {
"name": "initiate_refund",
"arguments": {
"order_id": "QB12345678",
"amount": 2.5
}
},
"internal_notes": {
"issue_category": "billing_dispute",
"root_cause_analysis": "The system may have automatically applied a standard service fee that needs to be verified.",
"suggested_solution_steps": [
"Locate the order in the system",
"Confirm whether the service fee applies",
"Process a refund if the fee was incorrectly applied"
]
},
"draft_response": {
"tone": "neutral",
"email_body": "Hello Noah,
Thank you for providing your order number. We will review the additional service fee and verify whether it was correctly applied.",
"actions_required_from_customer": "None"
}
}
The exact output will depend on the ticket.
The adapter is trained to select and describe the function that should be executed.
For example:
{
"function_call": {
"name": "initiate_refund",
"arguments": {
"order_id": "QB12345678",
"amount": 2.5
}
}
}
The model does not directly call the function.
A production application should:
This separation prevents the model from having direct unrestricted access to external systems.
This repository contains only the LoRA adapter.
It requires:
meta-llama/Llama-3.2-3B-Instruct
The base model may require appropriate access approval and authentication through Hugging Face.
Although the model is trained to produce the specified JSON structure, generated text from an LLM is not inherently guaranteed to be valid JSON.
Production applications should validate the output against the expected schema before using it.
The adapter only predicts the function call and arguments. It does not execute tools, APIs, database operations, refunds, account changes, or other external actions.
The adapter is specialized for customer-support ticket analysis based on its training data. Performance may decrease on domains, workflows, or function types that are substantially different from the training distribution.
A production implementation should use the adapter approximately as follows:
┌──────────────────┐
│ Customer Message │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Conversation │
│ History │
└────────┬─────────┘
│
▼
┌───────────────────────┐
│ Llama 3.2 3B + LoRA │
└───────────┬───────────┘
│
▼
Structured JSON
│
┌──────────────┼──────────────┐
│ │ │
▼ ▼ ▼
Triage Function Call Draft Reply
│
▼
Validation / Policy
│
▼
Tool Execution
│
▼
Tool/API Result
│
▼
Support Workflow
This adapter is derived from meta-llama/Llama-3.2-3B-Instruct.
Users are responsible for complying with the license and usage terms of the base model, including the applicable Llama 3.2 Community License.
See the base model page for the latest licensing and usage information:
https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct
Hugging Face:
hassanabdel/llama-3.2-3b-support-ticket-lora