Instructions to use ganmoor-ai-labs/sms-shield with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ganmoor-ai-labs/sms-shield with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ganmoor-ai-labs/sms-shield:Q4_K_M # Run inference directly in the terminal: llama cli -hf ganmoor-ai-labs/sms-shield:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ganmoor-ai-labs/sms-shield:Q4_K_M # Run inference directly in the terminal: llama cli -hf ganmoor-ai-labs/sms-shield:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf ganmoor-ai-labs/sms-shield:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ganmoor-ai-labs/sms-shield:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf ganmoor-ai-labs/sms-shield:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ganmoor-ai-labs/sms-shield:Q4_K_M
Use Docker
docker model run hf.co/ganmoor-ai-labs/sms-shield:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use ganmoor-ai-labs/sms-shield with Ollama:
ollama run hf.co/ganmoor-ai-labs/sms-shield:Q4_K_M
- Unsloth Desktop
- Pi
How to use ganmoor-ai-labs/sms-shield with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ganmoor-ai-labs/sms-shield:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ganmoor-ai-labs/sms-shield:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ganmoor-ai-labs/sms-shield with Docker Model Runner:
docker model run hf.co/ganmoor-ai-labs/sms-shield:Q4_K_M
- Lemonade
How to use ganmoor-ai-labs/sms-shield with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ganmoor-ai-labs/sms-shield:Q4_K_M
Run and chat with the model
lemonade run user.sms-shield-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ganmoor-ai-labs/sms-shield with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ganmoor-ai-labs/sms-shield:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default ganmoor-ai-labs/sms-shield:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ganmoor-ai-labs/sms-shield with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ganmoor-ai-labs/sms-shield:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "ganmoor-ai-labs/sms-shield:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
SMS-Shield โ Indian SMS scam & inbox classifier (4B)
SMS-Shield reads one SMS (sender header + body) and returns a structured safety
verdict as JSON. Built for Indian SMS traffic in English, Hindi (Devanagari),
and romanized Hinglish, including DLT sender-header reasoning (the same bank
alert is safe from JD-SBIINB and dangerous from a bare 10-digit mobile).
Trained entirely on-device on an NVIDIA DGX Spark (GB10, 128 GB unified memory).
Two model variants in this repo
| File | Model | Size | Use case |
|---|---|---|---|
sms-shield-q4_k_m.gguf |
SMS-Shield 4B (Qwen3-4B-Instruct LoRA) | 2.4 GB | Maximum accuracy: 99.2% verdict acc, servers/desktops |
sms-shield-mini-q4_k_m.gguf |
SMS-Shield Mini 1.7B (Qwen3-1.7B LoRA) | 1.2 GB | On-device/mobile: 99.0% verdict acc, 100% dangerous recall, 0 OTP false-flags, 3-4x faster |
adapter_model.safetensors |
4B LoRA adapter | 127 MB | Use with Qwen/Qwen3-4B-Instruct-2507 via PEFT |
The Mini was trained on the same verified dataset plus a targeted cashback-boundary booster, and passes the same release gates (zero genuine OTPs/bank alerts flagged).
Output contract
Input:
sender: 9182736450
message: Dear customer aapka SBI account aaj band ho jayega. KYC turant update karein: sbi-kyc-renew.top/verify
Output:
{"verdict": "dangerous", "category": "scam", "scam_type": "kyc_fraud", "risk": 80,
"red_flags": ["account closure", "urgent update", "suspicious link"],
"explanation": "Yeh ek fraud message hai. SBI kabhi bhi SMS se aapka account band karne ki dhamki nahi deta. Link par click na karein."}
verdict:safe|suspicious|dangerous(risk bands 0-39 / 40-69 / 70-100)category:otp|banking|delivery|bill_utility|govt|promo|personal|scamscam_type: 15 fraud patterns (kyc_fraud, digital_arrest, upi_fraud, job_scam, fake_delivery, investment_scam, lottery_prize, utility_scam, loan_app, phishing_generic, refund_cashback, impersonation, apk_malware, sextortion_threat, other_scam) โ null unless flaggedexplanation: one sentence in the language/script of the input message
Results (held-out test set, n=1,390 โ included in this repo)
| Metric | SMS-Shield 4B | Gemma3-27B zero-shot (same prompt) |
|---|---|---|
| Verdict accuracy | 99.2% | 49.2% |
| โ English / Hindi / Hinglish / Mixed | 99.2 / 99.8 / 98.8 / 98.9 | 53.2 / 26.6 / โ / 27.3 |
| Category accuracy | 99.1% | 74.0% |
| Dangerous recall | 99.5% | 87.2% |
| Safe precision | 100% | 100%* |
| Genuine OTP/bank alerts misflagged as scam | 0 / 1,390 | 22 |
| JSON parse failures | 0 | 0 |
*The baseline almost never predicts safe โ it over-flags legitimate traffic,
including 22 genuine OTPs/bank alerts. Over-flagging is the deployment killer
for SMS safety apps; SMS-Shield was explicitly trained against it with ~40%
hard negatives (scary-but-legitimate messages).
Training
- Base: Qwen3-4B-Instruct-2507, LoRA (r=16, bf16), 3 epochs + 1 calibration epoch
- Data: 12.5k synthetic Indian SMS, two-teacher pipeline run fully locally: gemma3:27b generated labeled candidates โ 20+ deterministic validators (script/language checks, risk-band consistency, sender-format, fuzzy dedup) โ gpt-oss-safeguard:120b independently re-judged every sample blind; label disagreements dropped (~24% rejection). Includes counterfactual sender-flip pairs and a deliberately generated ambiguous "suspicious" tier. The training corpus is not published; the full 1,390-row eval set is.
Known limitations
- Sender-counterfactual calibration: on paired sender-flip tests, 100% of
flipped messages are flagged (none pass as safe), but 18% land one severity
band off (
suspiciousvsdangerous) against the reference labels. - Languages: EN/HI/Hinglish only in v1. Kannada, Tamil, Telugu, Bengali, Marathi planned.
- Single-message classification; no thread context in v1.
- Trained on synthetic data; real-world distribution shift is expected. Evaluate on your own traffic before relying on it.
- This model assists judgment; it is not a guarantee. Never treat
safeas proof of legitimacy for financial actions.
Usage
Ollama:
ollama run santosh07401/sms-shield
Transformers (adapter in this repo):
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B-Instruct-2507")
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507", dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, "ganmoor-ai-labs/sms-shield")
GGUF: sms-shield-q4_k_m.gguf (2.4 GB) โ llama.cpp/Ollama ready; use a ChatML
template (no <think> block).
Intended use
Defensive scam protection for Indian mobile users: on-device SMS filtering, inbox categorization, and fraud warnings. Not for generating scam content.
- Downloads last month
- 142
4-bit
Model tree for ganmoor-ai-labs/sms-shield
Base model
Qwen/Qwen3-4B-Instruct-2507