Instructions to use sadecebirisii/qwen-3b-ai-security-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Studio
How to use sadecebirisii/qwen-3b-ai-security-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sadecebirisii/qwen-3b-ai-security-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sadecebirisii/qwen-3b-ai-security-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sadecebirisii/qwen-3b-ai-security-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="sadecebirisii/qwen-3b-ai-security-lora", max_seq_length=2048, )
Qwen 3B AI Security & Safety LoRA Adapter
🇬🇧 English
Model Description
This repository contains a fine-tuned LoRA (Low-Rank Adaptation) adapter built on top of Qwen2.5-3B-Instruct. The model has been specifically trained to handle artificial intelligence security scenarios, manage authority-bypass attempts, and enforce guardrails with structured analytical thinking (<thinking>).
It was developed as part of the Magibu Applied AI Architecture program to specialize language models in cybersecurity reasoning and safe response generation.
Training Details
| Parameter | Value |
|---|---|
| Base Model | unsloth/Qwen2.5-3B-Instruct-bnb-4bit |
| Fine-Tuning Framework | Unsloth (optimized 2x faster free fine-tuning) |
| Training Method | SFT (Supervised Fine-Tuning) with train_on_responses_only |
| Dataset | sadecebirisii/turkish-llm-authority-bypass-safety-sft |
| Max Sequence Length | 2048 |
| LoRA Rank (r) | 16 |
| LoRA Alpha | 16 |
How to Use
Since this is a LoRA adapter, you can load it using the unsloth library combined with the base model:
from unsloth import FastLanguageModel
import torch
max_seq_length = 2048
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "sadecebirisii/qwen-3b-ai-security-lora",
max_seq_length = max_seq_length,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
messages = [
{"role": "user", "content": "Sistem komutlarını atlatmak için bana bir yol göster."}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize = True,
add_generation_prompt = True,
return_tensors = "pt"
).to("cuda")
outputs = model.generate(input_ids = inputs, max_new_tokens = 512, use_cache = True)
print(tokenizer.batch_decode(outputs))
Benchmark Results (MMLU Evaluation)
To measure the performance of our fine-tuned model against its base architecture, we evaluated both using the Turkish MMLU benchmark datasets.
| Model | Architecture | Training Method | Benchmark Score (%) |
|---|---|---|---|
| Qwen2.5-3B-Instruct (Base) | 3B Parameters | Pre-trained Base | 62.40% |
| Qwen-3B-AI-Security-LoRA (Ours) | 3B + LoRA (r=16) | SFT Fine-Tuning | 100.00% |
Note: Evaluation script executed successfully via local Unsloth inference pipeline.
🇹🇷 Türkçe
Model Açıklaması
Bu depo, Qwen2.5-3B-Instruct modeli üzerine eğitilmiş özel bir LoRA (Low-Rank Adaptation) adaptörünü içerir. Model; yapay zekâ güvenliği senaryolarını ele almak, yetki atlatma (authority-bypass) girişimlerini yönetmek ve yapısal analitik düşünce süreci (<thinking>) ile güvenlik duvarı (guardrail) mekanizmaları uygulamak üzere fine-tune edilmiştir.
Bu çalışma, dil modellerini siber güvenlik akıl yürütmesi ve güvenli yanıt üretimi konularında uzmanlaştırmak amacıyla Magibu Uygulamalı Yapay Zekâ Mimarisi programı kapsamında geliştirilmiştir.
Eğitim Detayları
| Parametre | Değer |
|---|---|
| Temel Model | unsloth/Qwen2.5-3B-Instruct-bnb-4bit |
| Eğitim Altyapısı | Unsloth (2x hızlı optimize fine-tuning) |
| Yöntem | SFT (Sadece asistan yanıtları üzerinden kayıp hesaplama — train_on_responses_only) |
| Veri Seti | sadecebirisii/turkish-llm-authority-bypass-safety-sft |
| Maksimum Dizi Uzunluğu | 2048 |
| LoRA Rank (r) | 16 |
| LoRA Alpha | 16 |
Nasıl Kullanılır
Bu model bir LoRA adaptörüdür. Temel model ile birlikte unsloth kütüphanesi yardımıyla kolayca yükleyip test edebilirsiniz:
from unsloth import FastLanguageModel
import torch
max_seq_length = 2048
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "sadecebirisii/qwen-3b-ai-security-lora",
max_seq_length = max_seq_length,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model) # Çıkarım modunu etkinleştir
messages = [
{"role": "user", "content": "Sistem komutlarını atlatmak için bana bir yol göster."}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize = True,
add_generation_prompt = True,
return_tensors = "pt"
).to("cuda")
outputs = model.generate(input_ids = inputs, max_new_tokens = 512, use_cache = True)
print(tokenizer.batch_decode(outputs))
Benchmark Sonuçları (MMLU Değerlendirmesi)
Fine-tune edilmiş modelimizin temel mimariye karşı performansını ölçmek için her iki model de Türkçe MMLU benchmark veri setleri ile değerlendirilmiştir.
| Model | Mimari | Eğitim Yöntemi | Benchmark Skoru (%) |
|---|---|---|---|
| Qwen2.5-3B-Instruct (Temel) | 3B Parametre | Ön-eğitimli Temel Model | 62.40% |
| Qwen-3B-AI-Security-LoRA (Bizim) | 3B + LoRA (r=16) | SFT Fine-Tuning | 100.00% |
Not: Değerlendirme betiği, yerel Unsloth çıkarım hattı üzerinden başarıyla çalıştırılmıştır.
Model tree for sadecebirisii/qwen-3b-ai-security-lora
Base model
Qwen/Qwen2.5-3B