Instructions to use ellachang/phishing-detector-14b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ellachang/phishing-detector-14b-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen3-14b-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "ellachang/phishing-detector-14b-lora") - Transformers
How to use ellachang/phishing-detector-14b-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ellachang/phishing-detector-14b-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ellachang/phishing-detector-14b-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use ellachang/phishing-detector-14b-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ellachang/phishing-detector-14b-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ellachang/phishing-detector-14b-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ellachang/phishing-detector-14b-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="ellachang/phishing-detector-14b-lora", max_seq_length=2048, )
phishing-detector-14b — QLoRA LoRA Adapter
QLoRA fine-tuned LoRA adapter for Qwen3-14B on phishing email binary classification.
Base model: unsloth/qwen3-14b-unsloth-bnb-4bit
Performance (400-sample test set)
| Metric | Value |
|---|---|
| Accuracy | 88.75% |
| Precision | 0.833 |
| Recall | 0.970 |
| F1-Score | 0.896 |
Per-category accuracy:
| Category | Baseline | Fine-tuned |
|---|---|---|
| Human-Phishing | 100% | 94% |
| Human-Legitimate | 0% | 62% |
| LLM-Phishing | 100% | 100% |
| LLM-Legitimate | 0% | 99% |
Baseline (zero-shot Qwen3) scored 50% overall — the model could not distinguish LLM-generated emails at all.
Training Data
Human-LLM Generated Phishing-Legitimate Emails (Kaggle)
4,000 emails across 4 classes: Human-Phishing, Human-Legitimate, LLM-Phishing, LLM-Legitimate (1,000 each).
Split: 80% train / 10% val / 10% test (stratified).
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = AutoModelForCausalLM.from_pretrained(
"unsloth/qwen3-14b-unsloth-bnb-4bit",
load_in_4bit=True,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, "ellachang/phishing-detector-14b-lora")
tokenizer = AutoTokenizer.from_pretrained("ellachang/phishing-detector-14b-lora")
prompt = """Analyze the following email and determine if it is a phishing email or a legitimate email. Provide your classification.
### Input:
{email_text}
### Response:"""
inputs = tokenizer(prompt.format(email_text="<your email here>"), return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=20, temperature=0)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training Details
- Method: QLoRA (4-bit quantization + LoRA)
- LoRA rank: r=16, alpha=16
- Target modules: q_proj, k_proj, v_proj, o_proj
- Hardware: NVIDIA RTX 4090 (24GB VRAM)
- Framework: Unsloth + TRL SFTTrainer
Project
Part of a term project on LLM-based phishing detection with RAG and Chain-of-Thought analysis.
Source code: [GitHub repo link]
- Downloads last month
- 1