okohol commited on
Commit
0924b85
·
verified ·
1 Parent(s): c4c1a32

Same deployment format as CloudSec-9B: custom GGUF (Q4_K_M + Q8_0 embedding) + vision mmproj, new card, LICENSE/NOTICE, stop on <|im_end|>

Browse files
.gitattributes CHANGED
@@ -34,3 +34,5 @@ saved_model/**/* 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
  tokenizer.json 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
  tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ CyberBuddy-CyberOps-9B-Q4_K_M-embQ8.gguf filter=lfs diff=lfs merge=lfs -text
38
+ mmproj-CyberBuddy-CyberOps-9B-f16.gguf filter=lfs diff=lfs merge=lfs -text
CyberBuddy-CyberOps-9B-Q4_K_M-embQ8.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:51ba64d9309a6c0566df097da898a7b72687721a8ef4b1f2e3e6b580267282f5
3
+ size 5875442272
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
NOTICE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CyberBuddy-CyberOps-9B
2
+ Copyright 2026 orkohol
3
+
4
+ This model is an abliterated variant derived from:
5
+
6
+ Qwen3.5-9B — https://huggingface.co/Qwen/Qwen3.5-9B
7
+ Copyright (c) Alibaba Cloud. Licensed under the Apache License, Version 2.0.
8
+
9
+ Abliteration was performed with Heretic (https://github.com/p-e-w/heretic).
10
+
11
+ Licensed under the Apache License, Version 2.0 (the "License");
12
+ you may not use these files except in compliance with the License.
13
+ You may obtain a copy of the License at:
14
+
15
+ http://www.apache.org/licenses/LICENSE-2.0
16
+
17
+ Unless required by applicable law or agreed to in writing, software and models
18
+ distributed under the License are distributed on an "AS IS" BASIS, WITHOUT
19
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+
21
+ No fine-tuning data was used. Released for authorized security work only.
README.md CHANGED
@@ -2,103 +2,264 @@
2
  license: apache-2.0
3
  base_model: Qwen/Qwen3.5-9B
4
  base_model_relation: finetune
5
- tags:
6
- - qwen3_5
7
- - abliterated
8
- - uncensored
9
- - security
10
- - cybersecurity
11
- - red-team
12
- language:
13
- - en
14
  pipeline_tag: text-generation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ---
16
 
17
- # Qwen3.5-9B-CyberOps
 
 
 
 
 
 
18
 
19
- An **abliterated** variant of [`Qwen/Qwen3.5-9B`](https://huggingface.co/Qwen/Qwen3.5-9B) with refusal
20
- behavior removed, intended for **authorized security research and red/blue-team work** where the base
21
- model's safety refusals block legitimate offensive-security tasks (e.g. explaining an exploit, drafting
22
- a scan plan, reasoning about attacker tradecraft for defensive purposes).
23
 
 
24
 
25
- ## What was done (method)
26
 
27
- This model was produced by **abliteration** (a.k.a. refusal-direction ablation), using the
28
- [**Heretic**](https://github.com/p-e-w/heretic) framework. In plain terms:
 
 
 
 
29
 
30
- 1. The model's internal "refusal direction" — a direction in activation space that the model uses to
31
- represent "I should refuse this" — is identified by contrasting activations on harmful vs. harmless prompts.
32
- 2. That direction is **subtracted out** of the model's weights, so the model no longer steers toward refusal.
33
 
34
- No new training data was added; this is a weight-space modification of the base model, then merged back to
35
- `bfloat16`. The variant published here was produced from the **thinking-OFF** deployment mode (the model is
36
- intended to be served with `enable_thinking: false`).
37
 
38
- ### Architecture note
39
 
40
- `Qwen3.5-9B` is a hybrid architecture (`model_type: qwen3_5`,
41
- `Qwen3_5ForConditionalGeneration`): gated-DeltaNet linear attention with full attention on every 4th layer,
42
- dense (not MoE). It carries a `vision_config`; this release is the **language model only**.
 
 
43
 
44
  ## Intended use & responsible use
45
 
46
- **Intended for authorized, lawful security work only:** penetration testing with authorization, CTF
47
- competitions, security research on systems you own or are permitted to test, and defensive analysis.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
- By removing refusals, this model will also produce content the base model would decline. **You are
50
- responsible for how you use it.** Do not use it for unauthorized access, harm to systems or people, or any
51
- unlawful activity. The removal of refusals is **not** an endorsement of misuse — it is a tradeoff made so
52
- the model is usable by professionals operating inside an authorized scope.
53
 
54
- This model is best deployed behind a **human-in-the-loop** harness that gates any real-world action.
55
 
56
- ## How to serve (vLLM)
57
 
58
- Served and validated with vLLM 0.22.1, 4-bit (bitsandbytes), on a single 12 GB GPU:
59
 
60
  ```bash
61
- vllm serve /path/to/Qwen3.5-9B-CyberOps \
62
- --served-model-name heretic-qwen35 \
63
- --quantization bitsandbytes \
64
- --dtype bfloat16 \
65
- --language-model-only \
66
- --max-model-len 12288 \
67
- --max-num-seqs 16 \
68
- --gpu-memory-utilization 0.90 \
69
- --enable-auto-tool-choice \
70
- --tool-call-parser qwen3_coder \
71
- --reasoning-parser qwen3 \
72
- --default-chat-template-kwargs '{"enable_thinking": false}'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  ```
74
 
75
- `--tool-call-parser qwen3_coder` matches this model's chat-template tool-call wire format
76
- (`<tool_call><function=NAME><parameter=...></tool_call>`). Tool-calling (structured OpenAI `tool_calls`)
77
- has been verified working on this model at 9B.
 
 
 
 
 
78
 
79
- ### Example
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
  ```python
82
- from openai import OpenAI
83
- client = OpenAI(base_url="http://localhost:8000/v1", api_key="none")
84
- resp = client.chat.completions.create(
85
- model="heretic-qwen35",
86
- messages=[{"role": "user", "content": "Explain how ARP spoofing works on a LAN."}],
87
- extra_body={"chat_template_kwargs": {"enable_thinking": False}},
88
- )
89
- print(resp.choices[0].message.content)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  ```
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  ## Limitations
93
 
94
- - Same knowledge cutoff and capabilities as `Qwen/Qwen3.5-9B`; abliteration does not add knowledge or skill.
95
- - Abliteration can slightly affect general output quality/coherence on unrelated tasks.
96
- - As a 9B model, it can still hallucinate, misformat tool calls under ambiguity, and make factual errors.
 
 
97
 
98
  ## License & attribution
99
 
100
- - **License:** Apache-2.0, inherited from the base model `Qwen/Qwen3.5-9B`.
101
- - **Base model:** [`Qwen/Qwen3.5-9B`](https://huggingface.co/Qwen/Qwen3.5-9B) © the Qwen team / Alibaba Cloud.
102
- - **Method/tooling:** [Heretic](https://github.com/p-e-w/heretic) (abliteration framework).
103
 
104
- This is a derivative work; the Apache-2.0 copyright and license notices of the base model are preserved.
 
2
  license: apache-2.0
3
  base_model: Qwen/Qwen3.5-9B
4
  base_model_relation: finetune
5
+ library_name: transformers
 
 
 
 
 
 
 
 
6
  pipeline_tag: text-generation
7
+ language:
8
+ - en
9
+ tags:
10
+ - cybersecurity
11
+ - security
12
+ - red-team
13
+ - blue-team
14
+ - pentesting
15
+ - offensive-security
16
+ - function-calling
17
+ - tool-use
18
+ - agent
19
+ - abliterated
20
+ - uncensored
21
+ - heretic
22
+ - vision
23
+ - multimodal
24
+ - qwen3.5
25
+ - qwen3_5
26
+ - gguf
27
+ - llama.cpp
28
+ - quantized
29
+ - 4-bit
30
  ---
31
 
32
+ # CyberBuddy-CyberOps-9B
33
+
34
+ **An uncensored cyber-operations assistant for authorized red- and blue-team work: it explains attacks, plans scans, and calls tools, without the base model's refusals.**
35
+
36
+ CyberBuddy-CyberOps-9B is an **abliterated** [`Qwen/Qwen3.5-9B`](https://huggingface.co/Qwen/Qwen3.5-9B): the model's internal "refusal direction" was removed from its weights with [Heretic](https://github.com/p-e-w/heretic). It is built for **authorized security work** where the base model's safety refusals get in the way: explaining how an exploit works, drafting a scan plan, reasoning about attacker tradecraft for defense, and triage. It calls tools in **Qwen3.5's native XML tool-call format**, and it can **read images** (screenshots, diagrams, charts).
37
+
38
+ > ⚠️ **This model does not refuse.** It will produce content the base model declines. Use it only for lawful, authorized work (pentests with permission, CTFs, research on systems you own or may test, defensive analysis), and put it behind a **human-in-the-loop** harness for any real-world action.
39
 
40
+ *Formerly `CyberBuddyAI/CyberOps-Qwen3.5-9B`; old links redirect here.*
 
 
 
41
 
42
+ ## Pick your version
43
 
44
+ Everything is in this one repo:
45
 
46
+ | you want to… | use | GPU |
47
+ |---|---|---|
48
+ | **run it on an 8 GB GPU** (llama.cpp, LM Studio, Ollama…) | `CyberBuddy-CyberOps-9B-Q4_K_M-embQ8.gguf`, custom GGUF, 5.5 GiB | **8 GB** (64k context) |
49
+ | add **image input** to the GGUF | + `mmproj-CyberBuddy-CyberOps-9B-f16.gguf` (0.9 GB) | ~1 GB more |
50
+ | load it with 🤗 transformers, full quality | `model-*.safetensors` (bf16) | 24 GB |
51
+ | load it with transformers in 4-bit | same files + `load_in_4bit` | 10–12 GB |
52
 
53
+ There is **no LoRA adapter**: abliteration edits the base weights directly. Nothing was trained, so there is nothing to apply on top of the base.
 
 
54
 
55
+ Full instructions: [Deploy](#deploy).
 
 
56
 
57
+ ## Highlights
58
 
59
+ - 🔓 **No refusals on security work.** Exploits, payload logic, recon plans, and attacker tradecraft are answered directly instead of blocked.
60
+ - 🧰 **Tool use.** Emits well-formed Qwen3.5-native `<tool_call>`s; served with llama.cpp `--jinja` you get parsed OpenAI `tool_calls`.
61
+ - 👁️ **Sees images.** The Qwen3.5 vision encoder is kept, byte-identical to the base model; ship the `mmproj` file with the GGUF for image input.
62
+ - 🪶 **Runs small.** The custom GGUF (4-bit layers, 8-bit embeddings) fits on an 8 GB GPU with 64k context.
63
+ - 🎯 **Minimal edit.** Only 60 of 426 language-model weight tensors changed; the base model's knowledge and skills are kept.
64
 
65
  ## Intended use & responsible use
66
 
67
+ - **Use for:** authorized penetration testing, CTF competitions, red/blue-team exercises, security research on systems you own or are permitted to test, and defensive analysis of attacker behavior.
68
+ - **Users:** security professionals and researchers working inside an authorized scope.
69
+ - **Not for:** unauthorized access, harm to systems or people, or any unlawful activity. Removing refusals is a tradeoff made so professionals can use the model inside their scope; it is **not** an endorsement of misuse. **You are responsible for how you use it.**
70
+ - **Deploy it with a human in the loop.** Let the model propose actions, and have a person approve anything that touches a real system.
71
+
72
+ ## How to use
73
+
74
+ The model uses the stock Qwen3.5 chat template. It is meant to run with **thinking OFF** (`enable_thinking=False`); that is the mode it was abliterated in. **Pass your tools with `apply_chat_template(..., tools=...)`**; the template renders them in the model's own format.
75
+
76
+ ```python
77
+ from transformers import AutoModelForCausalLM, AutoTokenizer
78
+ import torch
79
+
80
+ mid = "CyberBuddyAI/CyberBuddy-CyberOps-9B"
81
+ tok = AutoTokenizer.from_pretrained(mid)
82
+ model = AutoModelForCausalLM.from_pretrained(mid, dtype=torch.bfloat16, device_map="auto")
83
+
84
+ tools = [{"type": "function", "function": {
85
+ "name": "nmap_scan",
86
+ "description": "Run an authorized nmap scan.",
87
+ "parameters": {"type": "object", "properties": {
88
+ "target": {"type": "string"}, "ports": {"type": "string"}}, "required": ["target"]}}}]
89
+ messages = [
90
+ {"role": "system", "content": "You are a security operations assistant. Use tools when useful."},
91
+ {"role": "user", "content": "Run a TCP port scan of 10.0.0.5, ports 1-1024."},
92
+ ]
93
+ inputs = tok.apply_chat_template(messages, tools=tools, add_generation_prompt=True, enable_thinking=False,
94
+ return_tensors="pt", return_dict=True).to(model.device)
95
+ out = model.generate(**inputs, max_new_tokens=512, do_sample=False,
96
+ stop_strings=["</tool_call>"], tokenizer=tok)
97
+ print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
98
+ ```
99
+
100
+ `AutoModelForCausalLM` loads the **text model only** (8.95B params) and skips the vision encoder. For images in transformers, use `AutoProcessor` + `AutoModelForImageTextToText` the same way as for base Qwen3.5 (needs `pillow` and `torchvision`). We tested image input through llama.cpp (below), not through transformers.
101
+
102
+ > 💡 **Agent loop:** stop at the first `</tool_call>`, run the tool, append the result as a `{"role": "tool", ...}` message, and generate again.
103
+
104
+ ## Deploy
105
+
106
+ ### 1. Pick a build for your GPU
107
+
108
+ The text GGUF has **the same architecture and the exact same size** (5,875,442,272 bytes) as our [CyberBuddy-CloudSec-9B](https://huggingface.co/CyberBuddyAI/CyberBuddy-CloudSec-9B) build. The VRAM numbers below were **measured on that build** (RTX 5070 Ti Laptop GPU, `nvidia-smi`, weights + KV cache + buffers), text only.
109
+
110
+ | your GPU | build | settings | VRAM used |
111
+ |---|---|---|---|
112
+ | **6 GB** | GGUF | `-c 4096` … `16384` | 4.9 GiB at 4k |
113
+ | **8 GB** | GGUF | `-c 65536` | **6.9 GiB** at 64k |
114
+ | **8 GB, long context** | GGUF | `-c 131072 -ctk q8_0 -ctv q8_0` (8-bit KV cache) | 7.5 GiB at 128k (tight) |
115
+ | **10–12 GB** | GGUF | `-c 131072` (f16 KV cache) | 8.9 GiB at 128k |
116
+ | **10–12 GB** | this repo, transformers + bitsandbytes 4-bit | see below | ~7.1 GiB weights at short context |
117
+ | **24 GB+** | this repo, transformers bf16 | see *How to use* | ~17 GB weights (text) |
118
+
119
+ **With images:** the `mmproj` file adds its 0.9 GB of weights, plus working memory per image. On an 8 GB GPU, use a shorter context (for example `-c 32768`) when you load it.
120
 
121
+ **Why it stays small at long context:** Qwen3.5-9B is a hybrid. Only 8 of its 32 layers use full attention (with 4 KV heads); the other 24 use Gated DeltaNet, a linear-attention layer with a fixed-size state. So the KV cache grows only **~32 KB per token** in f16. That is about 2 GB for 64k tokens, and half that with an 8-bit KV cache.
 
 
 
122
 
123
+ ### 2. llama.cpp server (recommended for small GPUs)
124
 
125
+ Tested with llama.cpp release `b12327`.
126
 
127
+ **Text only:**
128
 
129
  ```bash
130
+ llama-server -hf CyberBuddyAI/CyberBuddy-CyberOps-9B --hf-file CyberBuddy-CyberOps-9B-Q4_K_M-embQ8.gguf \
131
+ -ngl 99 -c 65536 -fa on --jinja --reasoning off --temp 0 --port 8080
132
+ ```
133
+
134
+ **Text + images:** download both files, then pass the projector with `--mmproj`:
135
+
136
+ ```bash
137
+ hf download CyberBuddyAI/CyberBuddy-CyberOps-9B \
138
+ CyberBuddy-CyberOps-9B-Q4_K_M-embQ8.gguf mmproj-CyberBuddy-CyberOps-9B-f16.gguf --local-dir .
139
+ llama-server -m CyberBuddy-CyberOps-9B-Q4_K_M-embQ8.gguf --mmproj mmproj-CyberBuddy-CyberOps-9B-f16.gguf \
140
+ -ngl 99 -c 32768 -fa on --jinja --reasoning off --temp 0 --port 8080
141
+ ```
142
+
143
+ | flag | what it does | why we set it |
144
+ |---|---|---|
145
+ | `-ngl 99` | put all layers on the GPU | the whole model fits; partial offload is much slower |
146
+ | `-c 65536` | context window (tokens) | the main VRAM knob: each 1k tokens costs ~32 MB (f16 KV) |
147
+ | `-fa on` | flash attention | less memory and faster; also needed for a quantized KV cache |
148
+ | `-ctk q8_0 -ctv q8_0` | store the KV cache in 8-bit | halves KV memory → 128k context on 8 GB. Optional |
149
+ | `--jinja` | use the model's own chat template | **required** for tool calling: the server then parses `<tool_call>` into OpenAI `tool_calls` |
150
+ | `--reasoning off` | thinking OFF | the mode this model was abliterated and validated in |
151
+ | `--mmproj FILE` | load the vision projector | enables image input (OpenAI `image_url` content parts) |
152
+ | `--temp 0` | greedy decoding | deterministic answers for tool use |
153
+
154
+ The server speaks the OpenAI API (`/v1/chat/completions`), so any OpenAI client can pass `tools=[...]` and images.
155
+
156
+ **Example requests** (real results from this GGUF, greedy):
157
+
158
+ ```bash
159
+ # tool call
160
+ curl -s localhost:8080/v1/chat/completions -H 'Content-Type: application/json' -d '{
161
+ "messages": [
162
+ {"role": "system", "content": "You are a security operations assistant. Use tools when useful."},
163
+ {"role": "user", "content": "Run a TCP port scan of 10.0.0.5, ports 1-1024."}],
164
+ "tools": [{"type": "function", "function": {"name": "nmap_scan",
165
+ "description": "Run an authorized nmap scan.",
166
+ "parameters": {"type": "object", "properties": {"target": {"type": "string"}, "ports": {"type": "string"}},
167
+ "required": ["target"]}}}],
168
+ "temperature": 0}'
169
  ```
170
 
171
+ → parsed tool call `nmap_scan({"target": "10.0.0.5", "ports": "1-1024"})`.
172
+
173
+ - *"How does ARP spoofing work on a LAN?"* → a correct 3-step explanation: forged ARP replies, cache poisoning, man-in-the-middle.
174
+ - An image of two training-loss charts, *"what happens to the val loss on the left?"* → *"the validation loss initially decreases but then begins to rise after around step 600, while the training loss continues to fall … the model is overfitting."* (correct)
175
+
176
+ **LM Studio / Ollama / other llama.cpp apps:** download the GGUF (and the `mmproj` file for images) from this repo. It should work in any app whose bundled llama.cpp supports the Qwen3.5 architecture (`qwen35`); we have not tested these apps ourselves.
177
+
178
+ #### The custom GGUF quant
179
 
180
+ | tensor | type | why |
181
+ |---|---|---|
182
+ | token embedding (`token_embd`, 248k × 4096) | **Q8_0** | the input embedding is ~1B params; 8-bit keeps every token's vector nearly exact |
183
+ | transformer layers | **Q4_K_M** mix (Q4_K, with Q6_K on the most sensitive tensors) | standard 4-bit k-quant |
184
+ | output head (`output`) | **Q4_K** | saves ~0.5 GB vs 8-bit, which buys more context on small GPUs |
185
+ | vision projector (`mmproj`) | **F16** | small (0.9 GB) and kept at full precision |
186
+
187
+ Built with llama.cpp `b12327`:
188
+
189
+ ```bash
190
+ llama-quantize --token-embedding-type q8_0 --output-tensor-type q4_k \
191
+ CyberBuddy-CyberOps-9B-bf16.gguf CyberBuddy-CyberOps-9B-Q4_K_M-embQ8.gguf Q4_K_M
192
+ ```
193
+
194
+ ### 3. transformers, 4-bit (10–12 GB GPU)
195
 
196
  ```python
197
+ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
198
+ import torch
199
+
200
+ mid = "CyberBuddyAI/CyberBuddy-CyberOps-9B"
201
+ bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
202
+ bnb_4bit_use_double_quant=True, bnb_4bit_compute_dtype=torch.bfloat16)
203
+ tok = AutoTokenizer.from_pretrained(mid)
204
+ model = AutoModelForCausalLM.from_pretrained(mid, quantization_config=bnb, dtype=torch.bfloat16, device_map="auto")
205
+ # then use the same generate code as in "How to use"
206
+ ```
207
+
208
+ - **Speed tip:** install [`flash-linear-attention`](https://github.com/fla-org/flash-linear-attention) and [`causal-conv1d`](https://github.com/Dao-AILab/causal-conv1d). Without them, transformers falls back to a slow pure-PyTorch path for the Gated DeltaNet layers.
209
+ - Needs a recent `transformers` with Qwen3.5 support (we used 5.6.2).
210
+
211
+ ### 4. vLLM
212
+
213
+ Validated with vLLM 0.22.1, 4-bit (bitsandbytes), on a single 12 GB GPU:
214
+
215
+ ```bash
216
+ vllm serve CyberBuddyAI/CyberBuddy-CyberOps-9B \
217
+ --quantization bitsandbytes --dtype bfloat16 --language-model-only \
218
+ --max-model-len 12288 --max-num-seqs 16 --gpu-memory-utilization 0.90 \
219
+ --enable-auto-tool-choice --tool-call-parser qwen3_coder --reasoning-parser qwen3 \
220
+ --default-chat-template-kwargs '{"enable_thinking": false}'
221
  ```
222
 
223
+ `--tool-call-parser qwen3_coder` matches the model's tool-call format (`<tool_call><function=NAME><parameter=...>`).
224
+
225
+ ### 5. Generation settings
226
+
227
+ | use | settings |
228
+ |---|---|
229
+ | **tool-calling agents** | greedy: `do_sample=False` / `temperature=0`, thinking OFF |
230
+ | open-ended answers | Qwen's non-thinking defaults also work: `temperature=0.7, top_p=0.8, top_k=20` |
231
+
232
+ ## Files in this repo
233
+
234
+ | path | what |
235
+ |---|---|
236
+ | `model-*.safetensors`, `config.json`, `generation_config.json`, tokenizer + chat template | full bf16 model (`Qwen3_5ForConditionalGeneration`: language model + vision encoder) |
237
+ | `preprocessor_config.json`, `video_preprocessor_config.json` | image/video processor settings (same as base Qwen3.5-9B) |
238
+ | `CyberBuddy-CyberOps-9B-Q4_K_M-embQ8.gguf` | custom GGUF for llama.cpp, text model (5.47 GiB, sha256 `51ba64d9309a6c0566df097da898a7b72687721a8ef4b1f2e3e6b580267282f5`) |
239
+ | `mmproj-CyberBuddy-CyberOps-9B-f16.gguf` | vision projector for llama.cpp image input (0.86 GiB, sha256 `d55beb9dc4e47508c223d8c5a87952ccd800fa3f5bdc4dfc05b8df0f34cfd763`) |
240
+ | `LICENSE`, `NOTICE` | Apache-2.0 + Qwen attribution |
241
+
242
+ ## How it was made
243
+
244
+ | | |
245
+ |---|---|
246
+ | **Base** | `Qwen/Qwen3.5-9B` (Apache-2.0, hybrid Gated DeltaNet + full attention, with vision encoder) |
247
+ | **Method** | abliteration (refusal-direction ablation) with [Heretic](https://github.com/p-e-w/heretic), in thinking-OFF mode |
248
+ | **Data** | none. Abliteration finds the refusal direction by contrasting activations on harmful vs. harmless prompts, then removes it from the weights; no fine-tuning data is added |
249
+ | **What changed** | 60 of 426 language-model weight tensors; the vision encoder (333 tensors) is byte-identical to the base |
250
+
251
+ In plain terms: the model represents "I should refuse this" as a direction in its activation space. Heretic finds that direction and subtracts it from the weights, so the model stops steering toward refusals. Knowledge and skills come from the base model.
252
+
253
  ## Limitations
254
 
255
+ - **Same knowledge as the base.** Abliteration removes refusals; it does not add knowledge or skill, and the knowledge cutoff is the base model's.
256
+ - **No formal benchmark.** We validated it with hands-on smoke tests (security Q&A, tool calls, image reading), not a scored eval. Abliteration can slightly affect general output quality.
257
+ - **No safety net.** It will not refuse harmful requests, so your harness, policies, and human reviewers are the guardrails.
258
+ - **9B, not frontier.** It can hallucinate, misformat tool calls under ambiguity, and make factual errors. Verify commands before you run them.
259
+ - **Not a sandbox.** It emits tool *calls* as text; it does not execute anything. Wiring it to real tools is your responsibility, with your own authorization checks.
260
 
261
  ## License & attribution
262
 
263
+ Released under **Apache-2.0**. Derived from `Qwen/Qwen3.5-9B` (© Alibaba Cloud, Apache-2.0); see `NOTICE`. Made with [Heretic](https://github.com/p-e-w/heretic). You must retain the license and attribution in redistributions.
 
 
264
 
265
+ *Authorized-use-only for security work. Use responsibly and within the law.*
generation_config.json CHANGED
@@ -1,6 +1,9 @@
1
  {
2
- "_from_model_config": true,
3
- "eos_token_id": 248044,
 
 
 
4
  "transformers_version": "5.6.2",
5
  "use_cache": true
6
  }
 
1
  {
2
+ "eos_token_id": [
3
+ 248046,
4
+ 248044
5
+ ],
6
+ "pad_token_id": 248044,
7
  "transformers_version": "5.6.2",
8
  "use_cache": true
9
  }
mmproj-CyberBuddy-CyberOps-9B-f16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d55beb9dc4e47508c223d8c5a87952ccd800fa3f5bdc4dfc05b8df0f34cfd763
3
+ size 918165440
preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 16777216,
4
+ "shortest_edge": 65536
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "image_processor_type": "Qwen2VLImageProcessorFast"
21
+ }
video_preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 25165824,
4
+ "shortest_edge": 4096
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "video_processor_type": "Qwen3VLVideoProcessor"
21
+ }