Instructions to use MaxwellMensah/fraud_model_v7 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MaxwellMensah/fraud_model_v7 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MaxwellMensah/fraud_model_v7") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MaxwellMensah/fraud_model_v7") model = AutoModelForCausalLM.from_pretrained("MaxwellMensah/fraud_model_v7", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use MaxwellMensah/fraud_model_v7 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 MaxwellMensah/fraud_model_v7:Q8_0 # Run inference directly in the terminal: llama cli -hf MaxwellMensah/fraud_model_v7:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf MaxwellMensah/fraud_model_v7:Q8_0 # Run inference directly in the terminal: llama cli -hf MaxwellMensah/fraud_model_v7:Q8_0
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 MaxwellMensah/fraud_model_v7:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf MaxwellMensah/fraud_model_v7:Q8_0
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 MaxwellMensah/fraud_model_v7:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf MaxwellMensah/fraud_model_v7:Q8_0
Use Docker
docker model run hf.co/MaxwellMensah/fraud_model_v7:Q8_0
- LM Studio
- Jan
- vLLM
How to use MaxwellMensah/fraud_model_v7 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MaxwellMensah/fraud_model_v7" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MaxwellMensah/fraud_model_v7", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MaxwellMensah/fraud_model_v7:Q8_0
- SGLang
How to use MaxwellMensah/fraud_model_v7 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MaxwellMensah/fraud_model_v7" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MaxwellMensah/fraud_model_v7", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MaxwellMensah/fraud_model_v7" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MaxwellMensah/fraud_model_v7", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use MaxwellMensah/fraud_model_v7 with Ollama:
ollama run hf.co/MaxwellMensah/fraud_model_v7:Q8_0
- Unsloth Desktop
- Pi
How to use MaxwellMensah/fraud_model_v7 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MaxwellMensah/fraud_model_v7:Q8_0
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": "MaxwellMensah/fraud_model_v7:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use MaxwellMensah/fraud_model_v7 with Docker Model Runner:
docker model run hf.co/MaxwellMensah/fraud_model_v7:Q8_0
- Lemonade
How to use MaxwellMensah/fraud_model_v7 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MaxwellMensah/fraud_model_v7:Q8_0
Run and chat with the model
lemonade run user.fraud_model_v7-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use MaxwellMensah/fraud_model_v7 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MaxwellMensah/fraud_model_v7:Q8_0
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 MaxwellMensah/fraud_model_v7:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use MaxwellMensah/fraud_model_v7 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MaxwellMensah/fraud_model_v7:Q8_0
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 "MaxwellMensah/fraud_model_v7:Q8_0" \ --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"
🛡️ Llama 3.2 Fraud Analysis Reasoning Engine (v7)
This repository contains full 16-bit merged weights and 8-bit (Q8_0) quantized GGUF binaries for a fine-tuned Llama-3.2-1B-Instruct model trained on synthetic transaction fraud detection scenarios. The model enforces a strict 4-step Chain-of-Thought (CoT) reasoning framework to audit payment anomalies, evaluate behavioral risks, and issue automated fraud decisions.
Fine-tuned using Unsloth with 4-bit LoRA Supervised Fine-Tuning (SFT).
📊 Performance & Evaluation Benchmarks
Evaluated on an unseen 600-sample validation dataset (val_600.jsonl) comparing the un-tuned base model against fraud-model-v7. Semantic similarity is calculated against target responses using nomic-embed-text embeddings:
| Model Variant | Risk Assessment Exact Match (%) | Cosine Semantic Similarity |
|---|---|---|
| Base Llama 3.2 (1B) | ~38.4% | ~0.7840 |
Fine-Tuned (fraud_model_v7) |
76.2% | 0.9822 |
💡 Model Capabilities & Output Schema
The model accepts structured transaction parameters (User ID, Amount, Location, IP/Network, Device, Time) and outputs structured analysis across four distinct reasoning steps:
Step 1 - Context: Summarizes user ID, location, timing, and transfer amount.
Step 2 - Anomaly Detection: Identifies flagged IPs (VPN/Proxy), novel devices, location jumps, or off-peak timing.
Step 3 - Risk Assessment: Evaluates threat velocity, account takeover indicators, and behavioral anomalies.
Step 4 - Decision: Emits final status: LOW RISK (Approved), MEDIUM RISK (Review), or HIGH RISK (Blocked).
Example Prompt & Output
User Query:
U-1193821 attempting rapid successive 4.99 USD payments (x6). IP is Proxy/Relay. Singapore, 03:45 AM. Mobile (new) used.
Model Output:
Step 1 - Context: U-1193821 initiated multiple low-value transfers (4.99 USD x6) from Singapore at 03:45 AM. Step 2 - Anomaly Detection: Anonymized network origin (Proxy/Relay), unrecognized hardware (Mobile (new)), off-peak timeframe, and rapid transaction frequency detected. Step 3 - Risk Assessment: High probability of automated card-testing script combined with identity obfuscation. Step 4 - Decision: HIGH RISK — Transaction blocked immediately and flagged for manual review.
📦 File Inventory
| File / Folder | Description | Target Environment |
|---|---|---|
fraud_model_v7_gguf/ |
Directory containing Q8_0 GGUF binary & Modelfile |
Ollama / CPU & Edge Execution |
model.safetensors |
Merged 16-bit Full Precision Checkpoint | PyTorch / vLLM / Transformers |
Modelfile |
Config file defining system prompts and parameters | Ollama deployment |
🚀 How to Use
Option 1: Local CPU / Edge Inference via Ollama
- Clone or pull the GGUF weights:
git lfs install
git clone https://huggingface.co/MaxwellMensah/fraud_model_v7
cd fraud_model_v7
- Register and execute via Ollama using the included
Modelfile:
ollama create fraud-model-v7 -f fraud_model_v7_gguf/Modelfile
ollama run fraud-model-v7 "U-8916730 attempting 12,500.00 USD transfer. IP is Corporate Network. Toronto, afternoon."
Option 2: Python / Hugging Face Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "MaxwellMensah/fraud_model_v7"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
messages = [
{"role": "system", "content": "You are a fraud detection expert. Analyze transactions using step-by-step reasoning."},
{"role": "user", "content": "U-8916730 attempting 12,500.00 USD transfer. IP is Corporate Network. Toronto, afternoon. Desktop (saved) used."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.1)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
🛠️ Training Specifications
- Base Model:
unsloth/Llama-3.2-1B-Instruct - Fine-Tuning Framework: Unsloth SFT (4-bit LoRA)
- LoRA Rank/Alpha:
r=16,lora_alpha=16 - Target Modules:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj - Dataset Size: 2,400 training samples (
train_2400.jsonl) / 600 validation samples (val_600.jsonl) - Quantization Export: 8-bit Integer GGUF (
Q8_0)
- Downloads last month
- 381
Model tree for MaxwellMensah/fraud_model_v7
Base model
meta-llama/Llama-3.2-1B-Instruct