Views
No views yet
1# Model Configuration
2model_name_or_path: Qwen/Qwen3-0.6B
3finetuning_type: lora
4lora_target: all
5lora_rank: 64
6lora_alpha: 128
7
8# Training Hyperparameters
9per_device_train_batch_size: 2
10gradient_accumulation_steps: 16 # Effective batch size: 32
11num_train_epochs: 10.0
12learning_rate: 2.0e-4
13lr_scheduler_type: cosine
14warmup_ratio: 0.03
15cutoff_len: 40960
16
17# Optimizations
18use_unsloth: true
19flash_attn: fa2
20gradient_checkpointing: true
21bf16: true
22optim: paged_adamw_8bitthreatflux-0.6B-fp16.gguf - FP16 GGUF model file (1.2GB)Modelfile - Ollama configuration with optimized parametersREADME.md - This documentation1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "vtriple/threatflux-0.6B-gguf"
4
5# Load the tokenizer and model
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForCausalLM.from_pretrained(
8 model_name,
9 torch_dtype="auto",
10 device_map="auto"
11)
12
13# Generate a YARA rule
14prompt = "Create a YARA rule to detect a ransomware payload with encryption routines"
15messages = [
16 {"role": "user", "content": prompt}
17]
18text = tokenizer.apply_chat_template(
19 messages,
20 tokenize=False,
21 add_generation_prompt=True
22)
23model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
24
25# Generate
26generated_ids = model.generate(
27 **model_inputs,
28 max_new_tokens=2048,
29 temperature=0.7,
30 top_p=0.9
31)
32output_ids = generated_ids[0][len(model_inputs.input_ids[0]):]
33response = tokenizer.decode(output_ids, skip_special_tokens=True)
34
35print("Generated YARA Rule:")
36print(response)1# Pull the model directly from HuggingFace
2ollama pull vtriple/threatflux-0.6B
3
4# Generate a YARA rule
5ollama run vtriple/threatflux-0.6B "Create a YARA rule for detecting suspicious PowerShell commands"1# Direct download
2wget https://huggingface.co/vtriple/threatflux-0.6B-gguf/resolve/main/threatflux-0.6B-fp16.gguf
3
4# Using with llama.cpp
5./main -m threatflux-0.6B-fp16.gguf \
6 --temp 0.4 --top-k 40 --top-p 0.9 \
7 --repeat-penalty 1.05 -n 2048 -c 16384 \
8 -p "Generate a YARA rule for detecting base64 encoded payloads"
9
10# Using with llama-cpp-python
11from llama_cpp import Llama
12
13llm = Llama(
14 model_path="threatflux-0.6B-fp16.gguf",
15 n_ctx=16384,
16 n_threads=8
17)
18response = llm(
19 "Create a YARA rule for detecting malicious macros",
20 max_tokens=2048,
21 temperature=0.4,
22 top_k=40,
23 top_p=0.9,
24 repeat_penalty=1.05
25)
26print(response['choices'][0]['text'])1rule Ransomware_Encryption_Routine {
2 meta:
3 description = "Detects potential ransomware encryption routines"
4 author = "Generated by ThreatFlux"
5 date = "2025-01-01"
6
7 strings:
8 $crypto1 = "CryptEncrypt" ascii wide
9 $crypto2 = "AES_encrypt" ascii
10 $crypto3 = "RSA" ascii
11 $extension = /\.[a-z0-9]{5,10}$/
12 $ransom_note = "Your files have been encrypted" nocase
13 $bitcoin = /[13][a-km-zA-HJ-NP-Z1-9]{25,34}/ ascii
14
15 condition:
16 uint16(0) == 0x5A4D and
17 (2 of ($crypto*) or $ransom_note) and
18 filesize < 5MB
19}1rule PHP_Webshell_Generic {
2 meta:
3 description = "Detects common PHP webshell patterns"
4 author = "Generated by ThreatFlux"
5
6 strings:
7 $php = "<?php" ascii
8 $eval = "eval(" nocase
9 $base64 = "base64_decode" nocase
10 $system = "system(" nocase
11 $exec = "exec(" nocase
12 $shell = "shell_exec" nocase
13 $passthru = "passthru(" nocase
14
15 condition:
16 $php and (
17 (#eval > 2) or
18 ($base64 and any of ($system, $exec, $shell, $passthru))
19 ) and filesize < 100KB
20}1rule Cryptominer_XMRig {
2 meta:
3 description = "Detects XMRig cryptominer variants"
4 author = "Generated by ThreatFlux"
5
6 strings:
7 $pool1 = "pool.minexmr.com" ascii
8 $pool2 = "xmrpool.eu" ascii
9 $wallet = /4[0-9AB][0-9a-zA-Z]{93}/ ascii
10 $algo = "randomx" ascii nocase
11 $cpu = "cpu-priority" ascii
12 $donate = "donate-level" ascii
13
14 condition:
15 uint16(0) == 0x5A4D and
16 (any of ($pool*) or $wallet) and
17 2 of ($algo, $cpu, $donate)
18}"Create a YARA rule to detect Windows ransomware that uses AES encryption and creates .locked file extensions""Generate a YARA rule with comprehensive meta information, string patterns, and conditions for detecting...""Create a YARA rule based on these IOCs: [list of hashes, strings, behaviors]"yaracyarac generated_rule.yar compiled_rule.yarcyara generated_rule.yar /path/to/samples/1import yara
2from transformers import pipeline
3
4# Generate rule
5generator = pipeline("text-generation", model="vtriple/threatflux-0.6B-gguf")
6rule_text = generator("Create a YARA rule for detecting malicious PowerShell", max_length=1024)[0]['generated_text']
7
8# Compile and use
9rules = yara.compile(source=rule_text)
10matches = rules.match(filepath="/path/to/file")1# .github/workflows/yara-generation.yml
2- name: Generate YARA Rules
3 run: |
4 python generate_rules.py --model vtriple/threatflux-0.6B-gguf
5 yarac output/*.yar -o compiled_rules.yarc1@misc{threatflux2025yara,
2 title={ThreatFlux 0.6B v21: State-of-the-Art Open-Source YARA Rule Generation},
3 author={Roersma, Wyatt},
4 organization={ThreatFlux},
5 year={2025},
6 howpublished={\url{https://huggingface.co/vtriple/threatflux-0.6B-gguf}},
7 note={Best performing open-source YARA generation model with 60% compile rate}
8}