From d6b773510af50a04be6992b440d0958e149d795a Mon Sep 17 00:00:00 2001 From: Adam Eehan Date: Tue, 10 Nov 2026 16:24:16 +0530 Subject: [PATCH] feat: initial release of Aira Cyber Defender AI (Qwen 2.5 7B GGUF) --- .gitignore | 23 ++++++++ LICENSE | 17 ++++++ Modelfile | 16 +++++ README.md | 106 ++++++++++++++++++++++++++++++++++ deploy/server_run.sh | 60 +++++++++++++++++++ examples/audit_code_sample.py | 57 ++++++++++++++++++ 6 files changed, 279 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 Modelfile create mode 100644 README.md create mode 100644 deploy/server_run.sh create mode 100644 examples/audit_code_sample.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d67b92f --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Binaries & large model weights +*.gguf +*.bin +*.pt +*.safetensors + +# Environment files +.env +.env.* +.env.local + +# Python artifacts +__pycache__/ +*.py[cod] +*$py.class +.venv/ +venv/ + +# llama.cpp build artifacts +llama-server +llama-cli +*.zip +*.tar.gz diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f2b56f6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,17 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + Copyright 2026 Aira Group of Technology (Er. Adam Eehan) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Modelfile b/Modelfile new file mode 100644 index 0000000..f493a88 --- /dev/null +++ b/Modelfile @@ -0,0 +1,16 @@ +FROM ./aira-cyber-defender-Q4_K_M.gguf + +TEMPLATE """<|im_start|>system +{{ .System }}<|im_end|> +<|im_start|>user +{{ .Prompt }}<|im_end|> +<|im_start|>assistant +""" + +SYSTEM """You are Aira Cyber Defender, an elite cybersecurity intelligence and defensive audit engine built by Aira Group of Technology. Provide deep technical, precise, practical, and mathematically rigorous security insights. You specialize in vulnerability triage, static code audits, CVE analysis, secure patching, and resilient system hardening.""" + +PARAMETER stop "<|im_start|>" +PARAMETER stop "<|im_end|>" +PARAMETER temperature 0.3 +PARAMETER top_p 0.9 +PARAMETER repeat_penalty 1.1 diff --git a/README.md b/README.md new file mode 100644 index 0000000..2e4d8ca --- /dev/null +++ b/README.md @@ -0,0 +1,106 @@ +# 🛡️ Aira Cyber Defender AI + +

+ Hugging Face Model + Base Architecture + GGUF Quantization + License +

+ +> **Aira Cyber Defender AI** is an autonomous, open-weights cybersecurity intelligence and defensive audit engine fine-tuned on Alibaba Cloud's state-of-the-art **Qwen 2.5 7B** architecture. Engineered by **Er. Adam Eehan**, Founder & Lead AI Architect at **Aira Group of Technology**. + +--- + +## 🌟 Model Hub & Quick Links + +* 🔗 **Hugging Face Model:** [airagroupoftechnology/aira-cyber-defender](https://huggingface.co/airagroupoftechnology/aira-cyber-defender) +* 📦 **Direct GGUF Download:** [aira-cyber-defender-Q4_K_M.gguf (4.36 GB)](https://huggingface.co/airagroupoftechnology/aira-cyber-defender/resolve/main/aira-cyber-defender-Q4_K_M.gguf) +* 🏢 **Organization Portal:** [Aira Group of Technology](https://airaaigroup.in) +* 🐙 **GitHub Organization:** [@adameehanairagroup](https://github.com/adameehanairagroup) + +--- + +## ⚡ Quickstart + +### 1. Instant Run with Ollama +Run directly from Hugging Face with a single command: +```bash +ollama run hf.co/airagroupoftechnology/aira-cyber-defender +``` + +Or using the local [`Modelfile`](Modelfile): +```bash +# 1. Download the GGUF binary +wget https://huggingface.co/airagroupoftechnology/aira-cyber-defender/resolve/main/aira-cyber-defender-Q4_K_M.gguf + +# 2. Build and launch Ollama instance +ollama create aira-cyber-defender -f Modelfile +ollama run aira-cyber-defender +``` + +--- + +### 2. High-Performance C++ Inference (`llama.cpp`) +```bash +# Clone and build llama.cpp (or use pre-built releases) +./llama-cli -m aira-cyber-defender-Q4_K_M.gguf \ + -p "<|im_start|>system\nYou are Aira Cyber Defender, an elite cybersecurity auditor.<|im_end|>\n<|im_start|>user\nAudit this C code for memory corruption bugs:\n[INSERT CODE]\n<|im_end|>\n<|im_start|>assistant\n" \ + --temp 0.3 -c 4096 -n 1024 +``` + +--- + +### 3. Deploy 24/7 OpenAI-Compatible Server (DigitalOcean / VPS) +You can deploy a 24/7 API server on DigitalOcean or any Linux VPS using the included script in `deploy/server_run.sh`: +```bash +chmod +x deploy/server_run.sh +./deploy/server_run.sh +``` +This serves an OpenAI-compatible REST API at `http://localhost:8080/v1/chat/completions`. + +--- + +## 🎯 Core Capabilities & Specializations + +1. **Active Cyber Defense & SOC Incident Analysis:** + - Enterprise breach post-mortems and attack vector classification (Ransomware, Phishing, DDoS, SQL Injection, Zero-days). + - Root-cause vulnerability diagnostics and enterprise remediation playbooks. + +2. **Autonomous Security Code Auditing:** + - Static Application Security Testing (SAST) for C, C++, Python, Rust, Go, Dart, and JavaScript. + - Buffer overflow, format string, use-after-free, logic flaw, and deserialization detection. + +3. **Domain Grounding & Hardening:** + - Grounded in sovereign AI architecture, Honey-potting prompt injection defense (Google VRP Track ID: 493408185), and compiler engineering (AiraLang). + +--- + +## 🔬 Training Configuration & Metrics + +| Parameter | Specification | +| :--- | :--- | +| **Base Architecture** | Qwen/Qwen2.5-7B-Instruct | +| **Fine-Tuning Method** | 4-bit QLoRA via Unsloth | +| **Hardware** | Tesla T4 GPU (Cloud Accelerator) | +| **LoRA Rank ($r$) / Alpha** | $r=16$, $\alpha=16$ | +| **Target Modules** | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` | +| **Optimizer** | 8-bit AdamW (`adamw_8bit`) | +| **Loss Progression** | Started at **5.016** ➔ Converged to **0.819** | +| **Context Window** | Up to 32,768 tokens | +| **Quantization Format** | GGUF `Q4_K_M` (4.36 GB) | + +--- + +## ⚖️ Ethical Use & Security Charter + +Aira Cyber Defender is released under the **Apache-2.0 License** exclusively for educational, authorized defensive auditing, and security research purposes. Users and security teams must ensure they have explicit authorization before scanning, auditing, or probing any network or software systems. + +--- + +## 🏢 About Aira Group of Technology + +Aira Group of Technology is an autonomous intelligence, systems programming, and high-assurance security initiative founded by **Adam Eehan**. Specializing in the development of sovereign AI engines, compiler architectures ([AiraLang](https://github.com/adameehanaira)), and active cyber defense systems. + +* **Founder & CEO:** Adam Eehan +* **Email:** [me@airaaigroup.in](mailto:me@airaaigroup.in) +* **Domain:** [airaaigroup.in](https://airaaigroup.in) diff --git a/deploy/server_run.sh b/deploy/server_run.sh new file mode 100644 index 0000000..c640c57 --- /dev/null +++ b/deploy/server_run.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +# ============================================================================== +# Aira Cyber Defender - 24/7 DigitalOcean / Linux VPS Deployment Script +# Managed by Aira Group of Technology (Er. Adam Eehan) +# ============================================================================== + +set -e + +MODEL_NAME="aira-cyber-defender-Q4_K_M.gguf" +MODEL_URL="https://huggingface.co/airagroupoftechnology/aira-cyber-defender/resolve/main/${MODEL_NAME}" +PORT=${PORT:-8080} +API_KEY=${API_KEY:-"aira-live-secret-key"} + +echo "🛡️ Starting Aira Cyber Defender AI Deployment..." + +# 1. Download Model if not present +if [ ! -f "$MODEL_NAME" ]; then + echo "⬇️ Downloading ${MODEL_NAME} from Hugging Face..." + wget -c "$MODEL_URL" -O "$MODEL_NAME" +else + echo "✅ Model file already exists: ${MODEL_NAME}" +fi + +# 2. Check for llama-server binary +if ! command -v llama-server &> /dev/null; then + echo "📦 llama-server not found in PATH. Checking local directory..." + if [ ! -f "./llama-server" ]; then + echo "🔧 Installing pre-built llama.cpp binaries..." + OS_ARCH=$(uname -m) + if [ "$OS_ARCH" = "x86_64" ]; then + RELEASE_URL="https://github.com/ggerganov/llama.cpp/releases/latest/download/llama-b4130-bin-ubuntu-x64.zip" + else + RELEASE_URL="https://github.com/ggerganov/llama.cpp/releases/latest/download/llama-b4130-bin-arm64.zip" + fi + + wget -q "$RELEASE_URL" -O llama_bin.zip || true + if [ -f llama_bin.zip ]; then + unzip -q llama_bin.zip -d ./llama_dist || true + cp ./llama_dist/build/bin/llama-server ./ || cp ./llama_dist/llama-server ./ || true + chmod +x ./llama-server || true + rm -rf llama_bin.zip ./llama_dist + fi + fi +fi + +LLAMA_BIN="llama-server" +if [ -f "./llama-server" ]; then + LLAMA_BIN="./llama-server" +fi + +echo "🚀 Launching Aira Cyber Defender API on port ${PORT}..." +exec $LLAMA_BIN \ + -m "$MODEL_NAME" \ + --host 0.0.0.0 \ + --port "$PORT" \ + --api-key "$API_KEY" \ + --threads "$(nproc)" \ + -c 4096 \ + -ngl 99 \ + --metrics diff --git a/examples/audit_code_sample.py b/examples/audit_code_sample.py new file mode 100644 index 0000000..8ce9f9b --- /dev/null +++ b/examples/audit_code_sample.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +""" +Aira Cyber Defender - API Audit Client Example +Demonstrates how to send untrusted code to the Aira Cyber Defender endpoint for automated vulnerability triage. +""" + +import os +import requests + +API_URL = os.environ.get("AIRA_API_URL", "http://localhost:8080/v1/chat/completions") +API_KEY = os.environ.get("AIRA_API_KEY", "aira-live-secret-key") + +VULNERABLE_CODE_SAMPLE = """ +void process_packet(char *user_input) { + char local_buffer[64]; + strcpy(local_buffer, user_input); + printf("Processed packet: %s\\n", local_buffer); +} +""" + +def audit_code(code_snippet: str): + prompt = f"Perform a rigorous security audit of the following code snippet. Identify any memory corruption vulnerabilities, explain the exploit vector, and provide a secure, hardened patch:\n\n```c\n{code_snippet}\n```" + + headers = { + "Authorization": f"Bearer {API_KEY}", + "Content-Type": "application/json" + } + + payload = { + "model": "aira-cyber-defender", + "messages": [ + { + "role": "system", + "content": "You are Aira Cyber Defender, an elite cybersecurity intelligence and defensive audit engine." + }, + { + "role": "user", + "content": prompt + } + ], + "temperature": 0.2, + "max_tokens": 1024 + } + + print("🛡️ Sending code to Aira Cyber Defender...") + try: + response = requests.post(API_URL, headers=headers, json=payload, timeout=60) + response.raise_for_status() + data = response.json() + result = data["choices"][0]["message"]["content"] + print("\n=== AIRA CYBER DEFENDER AUDIT REPORT ===\n") + print(result) + except Exception as e: + print(f"❌ Error connecting to Aira Cyber Defender API: {e}") + +if __name__ == "__main__": + audit_code(VULNERABLE_CODE_SAMPLE)