reloading0101/threat-intelligence-dataset
Viewer • Updated • 23.7k • 372 • 10
How to use Sakeador/ThreatSage-12B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Sakeador/ThreatSage-12B")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
pipe(text=messages) # Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("Sakeador/ThreatSage-12B")
model = AutoModelForMultimodalLM.from_pretrained("Sakeador/ThreatSage-12B", device_map="auto")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use Sakeador/ThreatSage-12B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Sakeador/ThreatSage-12B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Sakeador/ThreatSage-12B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Sakeador/ThreatSage-12B
How to use Sakeador/ThreatSage-12B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Sakeador/ThreatSage-12B" \
--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": "Sakeador/ThreatSage-12B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "Sakeador/ThreatSage-12B" \
--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": "Sakeador/ThreatSage-12B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Sakeador/ThreatSage-12B with Docker Model Runner:
docker model run hf.co/Sakeador/ThreatSage-12B
ThreatSage-12B is an open-source cybersecurity-specialized language model fine-tuned from Google Gemma 4 12B. Built for the security community, it excels at threat intelligence analysis, MITRE ATT&CK classification, penetration testing report interpretation, and incident response reasoning.
| Property | Value |
|---|---|
| Base model | google/gemma-4-12b-it |
| Architecture | Decoder-only, encoder-free multimodal |
| Parameters | 12B |
| Context window | 256K tokens |
| Modalities | Text, Image, Audio, Video |
| Adapter | LoRA (r=32, alpha=64) |
| Precision | BF16 |
| License | Apache 2.0 |
| Dataset | Samples | Focus |
|---|---|---|
| reloading0101/threat-intelligence-dataset | 52,279 | CTI, APTs, IOCs, campaigns |
| sarahwei/cyber_MITRE_tactic_CTI_dataset_v16 | 14,008 | MITRE ATT&CK v16 |
| CJJones/Synthetic_PenTest_Reports | 752 | Pentest reports |
| Total | 67,039 |
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = "google/gemma-4-12b-it"
adapter = "Sakeador/ThreatSage-12B"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(
base_model,
torch_dtype=torch.bfloat16,
device_map="auto"
)
model = PeftModel.from_pretrained(model, adapter)
messages = [
{"role": "user", "content": "Analyze this Wazuh alert and identify the MITRE ATT&CK technique."}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
| Setup | VRAM | Quantization |
|---|---|---|
| Minimum | 8 GB | Q4 |
| Recommended | 16 GB | BF16 (native) |
| Optimal | 3× 16 GB | BF16 tensor-parallel |
Apache 2.0 — same as the base model Gemma 4 12B.
Thanks to the open-source community, Google DeepMind for Gemma 4, and all the dataset creators who made this possible.