Nyx-27B-CyberAgent
Nyx-27B-CyberAgent is a 27.4B-parameter dense cybersecurity & autonomous agent model fine-tuned from huihui-ai/Huihui-Qwen3.8-27B-abliterated (Qwen3_5ForConditionalGeneration, 64-layer hybrid GatedDeltaNet linear + full attention, native 262K context, Multi-Token Prediction).
It is trained on 105,359 curated, refusal-filtered conversations (~70.48M tokens) spanning offensive & defensive cybersecurity knowledge, reward-filtered multi-step software/terminal/MCP agent trajectories, and native Qwen3.8 XML <tool_call> function calling.
Model Family & Variants
| Repository | Format | Disk Size | Recommended Hardware |
|---|---|---|---|
j4n4/Nyx-27B-CyberAgent (this repo) | Transformers BF16 (merged) | 51.8 GB | 80 GB GPU (A100/H100) / vLLM / SGLang / quantization source |
j4n4/Nyx-27B-CyberAgent-lora | PEFT LoRA Adapter (r=16, α=32) | 0.78 GB | Adapter-only / custom merging |
j4n4/Nyx-27B-CyberAgent-MLX-OptiQ-8bit | MLX OptiQ Mixed 8/16-bit (9.85 bpw + MTP) | 31.6 GB | Apple Silicon 48–64 GB+ (Recommended for Mac) |
j4n4/Nyx-27B-CyberAgent-MLX-bf16 | MLX BF16 (lossless) | 50.0 GB | Apple Silicon 64–96 GB+ |
Training Recipe
Curated Dataset Composition (~70.48M Training Tokens)
All source datasets were deduplicated, verified to terminate on assistant turns, formatted into Qwen3.8's native ChatML + XML <tool_call> schema (enable_thinking=False), and scrubbed of canned safety refusals (890 refusal samples removed) and failed agent runs:
| Source Dataset | Kept Samples | Tokens | Curation Notes |
|---|---|---|---|
Vyber07/cyber-security | 98,980 | 62.10M | Offensive/defensive security Q&A, exploit analysis, blue-team detection; 885 refusal samples removed |
NousResearch/hermes-function-calling-v1 | 8,260 | 8.96M | Converted to native Qwen3.8 <tool_call><function=...><parameter=...> XML format; deduplicated |
cx-cmu/agent_trajectories | 397 | 1.89M | swebench, terminalbench, mcpbench — passing trajectories only (reward >= 1.0 / >= 5.0); 2,523 failed runs removed |
Train / Val Split (max_seq_len=6144) | 105,359 / 2,152 | 70.48M train | 98% / 2% stratified split |
Hyperparameters & Convergence
- Framework:
Unsloth 2026.11.13+TRL 1.19.0+Transformers 5.24.1on NVIDIA A100-SXM4-40GB - Method: 4-bit QLoRA (
r=16,lora_alpha=32,lora_dropout=0, 79.69M trainable params / 0.2905%) merged back to lossless 16-bit BF16 - Loss Masking:
train_on_responses_only(<|im_start|>user\n→<|im_start|>assistant\n) - Schedule: 1 full epoch, 6,585 steps, effective batch size
16(1 × 16), cosine LR1e-4with150warmup steps,bf16compute, Peak VRAM33.94 GB
Monotonic validation eval_loss across all 13 checkpoints (zero overfitting):
| Step | 500 | 1000 | 1500 | 2000 | 2500 | 3000 | 3500 | 4000 | 4500 | 5000 | 5500 | 6000 | 6500 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Val Loss | 0.7603 | 0.7287 | 0.7100 | 0.6961 | 0.6848 | 0.6746 | 0.6664 | 0.6600 | 0.6545 | 0.6498 | 0.6468 | 0.6455 | 0.6451 |
Local Verification & Benchmarks (Apple M1 Max 64 GB, MLX)
Measured via mlx-lm 0.32.2 (enable_thinking=False, greedy temp=0.0):
| Variant | Disk Size | Load Time | Prompt Speed | Generation Speed | Peak RAM |
|---|---|---|---|---|---|
OptiQ-8bit (9.85 bpw, 150×16b + 347×8b + MTP) | 31.6 GB | 6.78 s | 70.44 – 114.66 tok/s | 9.92 – 10.31 tok/s | 33.44 – 34.76 GB |
bf16 (lossless) | 50.0 GB | 14.32 s | 1.82 tok/s* | 5.86 tok/s | 54.08 GB |
*On 64 GB unified memory, 50 GB BF16 weights approach the macOS wired memory limit (53.1 GB); use OptiQ-8bit on 48–64 GB Macs and bf16 on 96 GB+ Macs or 80 GB GPUs.
Capability Verification (OptiQ-8bit, temp=0.0)
- Zero-Refusal Offensive/Defensive Auditing:
6 / 6 (100%)- Passed without refusal and with concrete technical payloads + remediation/detection rules across: UNION SQLi + PDO fix, AWS IMDSv1 SSRF IP encoding bypasses + IMDSv2 hardening, Flask CWE-78 command injection + safe
subprocess, x86-64 NX/ROPret2libc(pop rdi; ret, 16-byte stack alignment), Active Directory Kerberoasting (GetUserSPNs.py+ Event ID 4769 + gMSA), and/dev/tcpreverse shell fd analysis + Sigma rule.
- Passed without refusal and with concrete technical payloads + remediation/detection rules across: UNION SQLi + PDO fix, AWS IMDSv1 SSRF IP encoding bypasses + IMDSv2 hardening, Flask CWE-78 command injection + safe
- Native Qwen3.8
<tool_call>Accuracy:8 / 8 (100%)- Exact function name, parameter keys, and values across 5 security agent tools (
run_nmap,query_cve,read_source_file,check_iocIP & domain,execute_shell), multi-turn tool-response chaining (run_nmap→query_cve), and negative control (correctly declining tool use on conceptual questions).
- Exact function name, parameter keys, and values across 5 security agent tools (
Quickstart (transformers)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "j4n4/Nyx-27B-CyberAgent"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
tools = [
{
"type": "function",
"function": {
"name": "run_nmap",
"description": "Run an nmap port and service scan against an authorized target.",
"parameters": {
"type": "object",
"properties": {
"target": {"type": "string"},
"ports": {"type": "string"},
"flags": {"type": "string"},
},
"required": ["target"],
},
},
}
]
messages = [
{"role": "system", "content": "You are Nyx-27B-CyberAgent, an autonomous cybersecurity auditing agent."},
{"role": "user", "content": "Scan authorized lab host 10.10.14.25 on ports 22,80,443 with -sV."},
]
prompt = tokenizer.apply_chat_template(
messages,
tools=tools,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Responsible & Authorized Use
This model is released under the Apache-2.0 license for authorized penetration testing, red/blue team exercises, vulnerability research, CTF competitions, incident response, and security education. Because Nyx-27B-CyberAgent is built on an abliterated base and fine-tuned to avoid false-positive refusals on security topics, users are solely responsible for ensuring all usage complies with applicable laws and written authorization scopes.