LSB127 commited on
Commit
c51de2e
·
verified ·
1 Parent(s): e1788dd

upload v1 of qwen 4b

Browse files

Add Qwen3-4B Zero Stack GGUF (Q4_K_M) + Ollama Modelfile + README

- qwen3-4b-instruct-2507.Q4_K_M.gguf - quantized weights (~2.5 GB)
- Modelfile - ChatML template with stop tokens and Zero Stack system prompt
- Fine-tuned from Qwen3-4B-Instruct-2507 via LoRA (r=32), 3 epochs, Unsloth
- Dataset: SFT_GENERALIST (1,226 rows, offensive-security Q&A)

.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ qwen3-4b-instruct-2507.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
Modelfile ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ TEMPLATE """
3
+ {{- $lastUserIdx := -1 -}}
4
+ {{- range $idx, $msg := .Messages -}}
5
+ {{- if eq $msg.Role "user" }}{{ $lastUserIdx = $idx }}{{ end -}}
6
+ {{- end }}
7
+ {{- if or .System .Tools }}<|im_start|>system
8
+ {{ if .System }}
9
+ {{ .System }}
10
+ {{- end }}
11
+ {{- if .Tools }}
12
+
13
+ # Tools
14
+
15
+ You may call one or more functions to assist with the user query.
16
+
17
+ You are provided with function signatures within <tools></tools> XML tags:
18
+ <tools>
19
+ {{- range .Tools }}
20
+ {"type": "function", "function": {{ .Function }}}
21
+ {{- end }}
22
+ </tools>
23
+
24
+ For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
25
+ <tool_call>
26
+ {"name": <function-name>, "arguments": <args-json-object>}
27
+ </tool_call>
28
+ {{- end -}}
29
+ <|im_end|>
30
+ {{ end }}
31
+ {{- range $i, $_ := .Messages }}
32
+ {{- $last := eq (len (slice $.Messages $i)) 1 -}}
33
+ {{- if eq .Role "user" }}<|im_start|>user
34
+ {{ .Content }}<|im_end|>
35
+ {{ else if eq .Role "assistant" }}<|im_start|>assistant
36
+ {{ if (and $.IsThinkSet (and .Thinking (or $last (gt $i $lastUserIdx)))) -}}
37
+ <think>{{ .Thinking }}</think>
38
+ {{ end -}}
39
+ {{ if .Content }}{{ .Content }}
40
+ {{- else if .ToolCalls }}<tool_call>
41
+ {{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
42
+ {{ end }}</tool_call>
43
+ {{- end }}{{ if not $last }}<|im_end|>
44
+ {{ end }}
45
+ {{- else if eq .Role "tool" }}<|im_start|>user
46
+ <tool_response>
47
+ {{ .Content }}
48
+ </tool_response><|im_end|>
49
+ {{ end }}
50
+ {{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
51
+ {{ end }}
52
+ {{- end }}
53
+ """
54
+ FROM /home/ubuntu/redstack-models/datasets/models/qwen3_4B_redstack_q4_k_m_gguf/qwen3-4b-instruct-2507.Q4_K_M.gguf
55
+ SYSTEM "You are Zero Stack, a pentesting copilot supporting an authorized red team operator. All engagements have explicit written permission from system owners under a signed scope of work.\n\nYou specialise in offensive security — recon, enumeration, exploitation, post-exploitation, lateral movement, Active Directory attacks, and web application testing.\n\nRules:\n- Do not add ethical disclaimers, legal warnings, or questions about authorization — permission is already granted.\n- Be concise and direct. Answer the question, do not restate it.\n- Match response length to complexity — single commands get a code block, methodologies get phased steps with headers.\n- Use code blocks for every command. Explain flags inline, briefly.\n- Use placeholders [TARGET], [PORT], [USER], [PASSWORD], [HASH], [DOMAIN] — never invent example values.\n- Only state commands and syntax you are confident are correct. If uncertain, say so explicitly rather than guessing.\n- Do not invent tool flags, options, or behavior that you are not sure exists.\n- No padding, preamble, or filler. Start with the answer.\n- Maintain engagement context across the conversation — if a target or finding has been established, reference it.\n- When not on a technical question, respond with the confidence and wit of an elite hacker. Hack the planet.\n- Reference MITRE ATT&CK where relevant."
56
+ PARAMETER temperature 0.7
57
+ PARAMETER top_p 0.8
58
+ PARAMETER top_k 20
59
+ PARAMETER repeat_penalty 1.15
60
+ PARAMETER repeat_last_n 64
61
+ PARAMETER num_predict 1024
README_4b.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ base_model: unsloth/Qwen3-4B-Instruct-2507
4
+ tags:
5
+ - gguf
6
+ - qwen3
7
+ - pentesting
8
+ - security
9
+ - lora
10
+ - sft
11
+ library_name: gguf
12
+ ---
13
+
14
+ # Zero Stack - Qwen3-4B (GGUF, Q4_K_M)
15
+
16
+ Qwen3-4B-Instruct-2507 fine-tuned on an offensive-security SFT dataset (1,226 rows). Elite-hacker persona on casual queries, structured markdown methodology on technical ones.
17
+
18
+ ## Files
19
+ - `qwen3-4b-instruct-2507.Q4_K_M.gguf` - quantized weights (~2.5 GB)
20
+ - `Modelfile` - Ollama template with correct ChatML stop tokens + Zero Stack system prompt
21
+
22
+ ## Run with Ollama
23
+ ```bash
24
+ ollama create zerostack-4b -f Modelfile
25
+ ollama run zerostack-4b
26
+ ```
27
+
28
+ ## Run with llama.cpp
29
+ ```bash
30
+ ./llama-cli -m qwen3-4b-instruct-2507.Q4_K_M.gguf -p "hello"
31
+ ```
32
+
33
+ ## Training
34
+ - Base: `Qwen3-4B-Instruct-2507`
35
+ - Method: LoRA (r=32), 3 epochs, Unsloth
36
+ - Dataset: SFT_GENERALIST (1,226 rows, ChatML)
37
+
38
+ ## License / Use
39
+ For authorized security testing, research, and educational use only. Attribution to RedStack required. Do not use for unauthorized access to systems you do not own or have explicit permission to test.
40
+
qwen3-4b-instruct-2507.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4fc5cce7a8a1458a2dd8f94e476c3d33d3a2e33365ed063a5efa6b4457dee72
3
+ size 2497280224