Downloads · 30 days
0
satyadube1/customer-support-llm
customer-support-llm is a machine learning model from satyadube1. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated May 18, 2026
Repo size
4.5 MB
Likes
0
Public
Click a slice to open those files.
.safetensors4.5 MB · 55%
From the Hugging Face model README
Production-Grade Customer Support LLM
Project Overview
This project demonstrates the complete lifecycle of building a domain-specific AI-powered Customer Support Assistant using a lightweight open-source Large Language Model (LLM).
The system was designed to:
The project focuses on lightweight and efficient deployment suitable for low-resource environments while maintaining strong customer interaction quality.
Objective
The primary objective of this project is to build a specialized customer support AI assistant capable of:
The project also demonstrates:
Dataset
Dataset Used
Bitext Customer Support Dataset from Hugging Face.
Dataset Link: https://huggingface.co/datasets/bitext/Bitext-customer-support-llm-chatbot-training-dataset
Dataset Description
The dataset contains real-world styled customer support conversations such as:
Each sample contains:
Dataset Preprocessing
The preprocessing pipeline includes:
Example formatted sample:
Instruction:
I want a refund because my order arrived damaged.
Response:
We apologize for the inconvenience. Your refund request has been initiated.
Base Model
Model Used
TinyLlama/TinyLlama-1.1B-Chat-v1.0
Model Link: https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0
Why TinyLlama?
TinyLlama was selected because:
Fine-Tuning Approach
Fine-Tuning Method
The model was fine-tuned using:
Instead of updating all model parameters, LoRA trains only small adapter layers which:
LoRA Configuration
Parameter| Value r| 8 lora_alpha| 16 lora_dropout| 0.05 task_type| CAUSAL_LM
Training Configuration
Parameter| Value Batch Size| 1 Epochs| 1 Learning Rate| 2e-4 Max Length| 256 Dataset Size| 100 Samples
Why Reduced Dataset?
The dataset size was intentionally reduced because:
The objective was to demonstrate the complete LLM engineering pipeline rather than perform massive-scale training.
Model Training Pipeline
The training pipeline includes:
Inference Pipeline
The inference pipeline follows:
Customer Query ↓ Prompt Validation ↓ Toxicity Filtering ↓ LLM Inference ↓ Response Generation ↓ Safety Validation ↓ Final Response
Toxicity Filtering
Objective
To prevent unsafe or toxic responses generated by the model.
Library Used
Detoxify
Implementation
The generated response is passed through Detoxify:
Example:
Prompt Guardrails
Objective
Prevent:
Guardrail Strategy
A blocked keyword system was implemented.
Blocked examples:
Unsafe prompts are rejected before inference.
Benchmarking
Metrics Measured
Measures response generation time.
Measures memory utilization during inference.
Measures inference throughput.
Benchmark Results
Metric| Result Latency| ~1.2 sec GPU Memory| ~5 GB Tokens/sec| ~40
Base Model vs Fine-Tuned Model
Scenario| Base Model| Fine-Tuned Model Refund Handling| Generic| Professional Cancellation| Weak workflow| Structured response Angry Customer| Limited empathy| Better customer handling Customer Queries| Generic answers| Domain-specific responses
AI Safety Implementation
The project implements multiple AI safety layers:
Blocks toxic responses.
Prevents malicious prompts.
Rejects prompt injection attempts.
Deployment
Framework Used
FastAPI
Deployment Architecture
User Request ↓ FastAPI Backend ↓ Prompt Validation ↓ Safety Layer ↓ LLM Inference ↓ Response Generation
Public Deployment
The API was exposed publicly using ngrok.
Swagger UI was used for API testing.
Endpoints:
FastAPI Features
Hugging Face Deployment
The fine-tuned model was uploaded to Hugging Face for:
GitHub Repository
The GitHub repository contains:
Challenges Faced
Resolved by:
Resolved by:
Resolved by:
Future Improvements
Future enhancements may include:
Key Learnings
This project helped demonstrate:
Technologies Used
Technology| Purpose Python| Development Transformers| LLM Framework PEFT| LoRA Fine-Tuning TinyLlama| Base Model FastAPI| API Deployment ngrok| Public Tunnel Detoxify| Toxicity Filtering Hugging Face| Model Hosting Google Colab| Training Environment
Conclusion
This project demonstrates a complete end-to-end workflow for building a production-style domain-specific LLM application.
The system successfully:
The project highlights practical LLM engineering concepts including:
Author
Satyanarayan Dubey
Data Scientist | Machine Learning Engineer | Generative AI Enthusiast