--- language: - en - ar tags: - mlx - cybersecurity - security - qwen3 - saif - circuit-aware - hayula library_name: mlx pipeline_tag: text-generation license: apache-2.0 --- # SAIF v2 Pro — Circuit-Aware Security Specialist **SAIF (سيف)** v2 Pro is a unified security analysis model based on **Qwen3-8B**, trained with Circuit-Aware LoRA and IACR (Integrated Adapter Circuit Refinement). ## Architecture - **Base Model:** Qwen3-8B (36 layers) - **Circuit-Aware LoRA:** Trained on 387 security analysis samples (rank=8, scale=20) - **IACR Fine-tuning:** Integrated Adapter Circuit Refinement (loss 0.033) - **13 Security Probes:** Avg accuracy 98.7% - **Fused Format:** MLX native (single 15GB model) ## Capabilities | # | Capability | Supported | |---|-----------|:---------:| | 1 | SQL Injection Analysis | ✅ | | 2 | SSRF Detection | ✅ | | 3 | XSS Analysis | ✅ | | 4 | RCE Exploitation | ✅ | | 5 | IDOR Detection | ✅ | | 6 | CSRF Analysis | ✅ | | 7 | LFI Detection | ✅ | | 8 | Open Redirect | ✅ | | 9 | CORS Misconfig | ✅ | | 10 | Auth Bypass | ✅ | | 11 | Business Logic | ✅ | | 12 | Race Conditions | ✅ | | 13 | LLM Prompt Inject | ✅ | ## Usage (MLX) ```python from mlx_lm import load, generate model, tokenizer = load("BinSaqban/SAIF-v2-Pro") prompt = "Analyze this SSRF vulnerability: ..." messages = [{"role": "user", "content": prompt}] prompt_text = tokenizer.apply_chat_template(messages, tokenize=False) response = generate(model, tokenizer, prompt=prompt_text, max_tokens=512) print(response) ``` ## Server Mode ```bash mlx_lm.server --model BinSaqban/SAIF-v2-Pro --port 8452 ``` ## Performance - **Latency:** ~7.4s for 200 tokens (27 tok/s on M2 Ultra) - **Accuracy:** 98.7% on 13 security probes - **Memory:** ~16GB (M2 Ultra 192GB) ## Training Trained on Hayula Labs infrastructure using MLX on M2 Ultra (192GB). - Circuit-Aware: 500 iterations, train loss 0.927 - IACR: Additional refinement, final loss 0.033 ## License Apache 2.0