jaimef21/security-lora-qwen2.5-coder-3b-gguf
081
security-lora-qwen2.5-coder-3b-gguf
GGUF quants of jaimef21/security-lora-qwen2.5-coder-3b-bf16, a Qwen2.5-Coder-3B-Instruct LoRA fine-tune for detecting malicious npm / PyPI supply-chain attack code.
Outputs a structured JSON verdict with cited line ranges. Tuned via DPO to suppress false positives on legitimate minified / telemetry / crypto code.
Training pipeline: <https://github.com/jaimef21/security-lora>
Files
Usage with llama.cpp
./llama-cli -m security-lora.q4_k_m.gguf \
-p "Analyze this code for malicious behaviour. Source: \`example.js\`.\n\n\`\`\`js\nconst x = require('child_process').exec(process.env.CMD);\n\`\`\`"Usage with Ollama
Build a Modelfile locally:
FROM ./security-lora.q4_k_m.gguf
SYSTEM "You are a security analyst. Given a source code file, return a JSON verdict {verdict, confidence, categories, reasoning, iocs} for whether the code is malicious. verdict ∈ {malicious, suspicious, benign}. Always cite specific line ranges in iocs.lines when flagging behaviour. Be precise and concise."
PARAMETER temperature 0.1
PARAMETER num_ctx 8192
PARAMETER stop "<|im_end|>"Then:
ollama create security-scan -f Modelfile
ollama run security-scan "Analyze this code..."Output schema
{
"verdict": "malicious | suspicious | benign",
"confidence": 0.0,
"categories": ["env_exfil", "crypto_miner", "backdoor", "typosquat",
"install_hook_abuse", "obfuscated_eval", "c2_beacon",
"credential_theft", "protestware"],
"reasoning": "step-by-step taint flow / deobfuscation walkthrough",
"iocs": {"domains": [], "files": [], "lines": [], "env_vars": []}
}Training pipeline
- CPT — Continued pre-training on Datadog malicious-packages + Advisory DB + Semgrep registry.
- SFT — Teacher-labeled verdicts (Qwen3-Coder-480B-A35B-FP8) on confirmed-malicious + popular-benign npm samples.
- DPO — 300 benign-lookalike pairs to suppress false positives on minified bundles, telemetry SDKs, real crypto.
