Instructions to use Noman33/hifazat-edge 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 Noman33/hifazat-edge 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 Noman33/hifazat-edge # Run inference directly in the terminal: llama cli -hf Noman33/hifazat-edge
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Noman33/hifazat-edge # Run inference directly in the terminal: llama cli -hf Noman33/hifazat-edge
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 Noman33/hifazat-edge # Run inference directly in the terminal: ./llama-cli -hf Noman33/hifazat-edge
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 Noman33/hifazat-edge # Run inference directly in the terminal: ./build/bin/llama-cli -hf Noman33/hifazat-edge
Use Docker
docker model run hf.co/Noman33/hifazat-edge
- LM Studio
- Jan
- Ollama
How to use Noman33/hifazat-edge with Ollama:
ollama run hf.co/Noman33/hifazat-edge
- Unsloth Desktop
- Pi
How to use Noman33/hifazat-edge with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Noman33/hifazat-edge
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": "Noman33/hifazat-edge" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Noman33/hifazat-edge with Docker Model Runner:
docker model run hf.co/Noman33/hifazat-edge
- Lemonade
How to use Noman33/hifazat-edge with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Noman33/hifazat-edge
Run and chat with the model
lemonade run user.hifazat-edge-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use Noman33/hifazat-edge with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Noman33/hifazat-edge
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 Noman33/hifazat-edge
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Noman33/hifazat-edge with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Noman33/hifazat-edge
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 "Noman33/hifazat-edge" \ --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"
Model Card β hifazat-edge
Model description
hifazat-edge is a scam-detection classifier fine-tuned for Safe Pakistan (Hifazat ΨΩΨ§ΨΈΨͺ) β Pakistan's AI scam guardian. It is Layer 1 of a three-layer inference cascade: a fast, free, local edge model that answers confident cases in ~2.3s on CPU, so vulnerable users on slow or zero internet still get an instant verdict.
- Base model:
Qwen/Qwen2.5-1.5B-Instruct - Fine-tuning: LoRA (Unsloth) on a single Tesla T4
- Format: Q4_K_M GGUF, served via Ollama (OpenAI-compatible
/v1endpoint) - Languages: English, Roman Urdu, Urdu (Nastaliq input)
Intended use β Layer 1 ONLY, not standalone
Classify a single SMS / WhatsApp message / transcribed call into:
{"verdict":"scam|suspicious|safe","score":0-100,"confidence":0-100,"type":"","redFlags":[]}
Inference parameters: temperature 0.1, max_tokens 220, format: json.
The model is designed to be conservative: unsure cases return low confidence so the orchestrator escalates to a stronger cloud model (confidence gate β₯ 70). Do not deploy this model standalone β its JSON compliance and suspicious-class recall are insufficient without the cascade safety net (see Limitations).
Training data
1,500 localized examples hand-built from real Pakistani scam patterns (JazzCash, Easypaisa, BISP 8171, NADRA CNIC, OTP harvesting, fake prizes):
| Class | Count |
|---|---|
| scam | 864 |
| suspicious | 336 |
| safe | 300 |
Training loss: 2.10 β 0.026 (LoRA, Qwen2.5-1.5B-Instruct, T4).
Evaluation β 155-message hold-out, 3-run variance
Hold-out: 155 UNSEEN messages (95 scam incl. 5 sender-spoofed Β· 30
suspicious Β· 30 safe with trigger words like OTP/Rs/balance). Three full
online runs of the live cascade (backend/eval-runs.js):
| Metric | RUN 1 | RUN 2 | RUN 3 | MINβMAX | MEAN |
|---|---|---|---|---|---|
| Accuracy | 74.8% | 76.8% | 77.4% | 74.8β77.4% | 76.3% |
| Scam recall | 85.3% | 88.4% | 87.4% | 85.3β88.4% | 87.0% |
| Safe precision | 95.8% | 92.6% | 89.3% | 89.3β95.8% | 92.6% |
| Safe FPR | 16.7% | 13.3% | 13.3% | 13.3β16.7% | 14.4% |
| Macro F1 | 69.5% | 69.9% | 71.4% | 69.5β71.4% | 70.3% |
| L1 parse fails | 80 | 76 | 78 | 76β80 | 78.0 |
Regex baseline on the same set: accuracy 46.5%, scam recall 49.5%.
Per-layer attribution (representative online run)
| Layer | Predictions | Correct | Accuracy |
|---|---|---|---|
| L0_VERIFIED (sender prior) | 22 | 22 | 100.0% |
| FT_MODEL (this model) | 52β60 | β | 56β68% |
| QWEN_MAX (cloud teacher) | 73β81 | β | ~76% |
| RULES (regex floor) | 0 online | β | β |
L0 whitelist/template decisions are perfect by construction; this model is the fast-and-cheap middle; the cloud layer cleans up its misses.
Limitations β stated honestly
- JSON parse failure β 55% on out-of-distribution input (76β80 per run). Every failure escalates silently in the cascade β the user never sees it, but it is why this model cannot stand alone.
- Offline safe precision 35β40%: without the cloud layer the regex floor over-flags legit alerts containing trigger words (conservative by design).
- Run-to-run variance: Β±3% accuracy, up to Β±7% on safe precision (89.3β95.8% across 3 runs).
- Suspicious-class recall is weak β smallest training slice (336/1,500).
- Confidence scores are model outputs, not calibrated probabilities.
Deployment
OLLAMA_KEEP_ALIVE=24h ollama serve
# model registered locally as `hifazat-edge`
POST http://127.0.0.1:11434/v1/chat/completions
Warm-up: run one classification at boot β first-call latency is the main operational risk. Target: < 4s warm on a mid-range laptop CPU.
Bias, risks, limitations
- Trained on Pakistani scam patterns; transfer to other regions/languages is untested.
- A false SAFE is more harmful than a false SCAM β the cascade prefers escalation over guessing.
- The model gives verdicts, not legal advice; reporting goes to NCCIA (NCCIA Shikayat), never presented as law-enforcement action.
Model Details
- Developed by: Safe Pakistan team (Noman) β co-built with Qoder AI
- Model type: Causal LM, instruction-tuned, LoRA adapter merged
- Base: Qwen2.5-1.5B-Instruct (Alibaba)
- Quantization: Q4_K_M
- Cascade context: L0 sender-prior β L1 hifazat-edge β gate β₯ 70 β L2 Qwen-Max β L3 on-device rules
- Downloads last month
- 5
We're not able to determine the quantization variants.