Run this model with HF Jobs

Run j4n4/Onyx-12B-CyberAgent on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/j4n4/Onyx-12B-CyberAgent. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/j4n4/Onyx-12B-CyberAgent on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/j4n4/Onyx-12B-CyberAgent. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/j4n4/Onyx-12B-CyberAgent. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Onyx-12B-CyberAgent

Onyx-12B-CyberAgent is a compact 12B dense autonomous cybersecurity & tool-calling agent model fine-tuned in full BF16 LoRA from OBLITERATUS/Gemma-4-12B-OBLITERATED (zero-regression 2-pass SOM+ASPA abliterated google/gemma-4-12B-it, Gemma4UnifiedForConditionalGeneration, 48 layers, 262K native context — upstream 131072 metadata bug fixed to 262144 here).

Built as the portable 16–32 GB laptop sibling to j4n4/Nyx-27B-CyberAgent (27.4B dense) and j4n4/Vex-35B-A3B-CyberAgent (35.1B MoE), Onyx-12B-CyberAgent achieves 100% (6/6) zero-refusal offensive/defensive security auditing and 100% (8/8) native Gemma-4 <|tool_call> accuracy (including multi-turn tool chaining!) across all three MLX precisions — running at ~25 tok/s in just 11.86 GB unified memory on Apple Silicon.

Model Family & Variants

Repository Format Disk Size M1 Max 64 GB Speed Peak RAM Recommended Hardware
j4n4/Onyx-12B-CyberAgent (this repo) Transformers BF16 (merged, 262K ctx) 22.28 GiB — — 24–40 GB GPU / vLLM / SGLang / Custom Quants
j4n4/Onyx-12B-CyberAgent-MLX-bf16 MLX BF16 lossless (5 shards) 22.21 GiB 12.85 tok/s 24.03 GB Apple Silicon 32–64 GB+ (Lossless Reference)
j4n4/Onyx-12B-CyberAgent-MLX-OptiQ-8bit MLX OptiQ Mixed 8/16-bit (104×16b + 224×8b) 13.94 GiB 20.30 tok/s 15.07 GB Apple Silicon 24–32 GB+ (Highest Fidelity Daily Driver)
j4n4/Onyx-12B-CyberAgent-MLX-OptiQ-6bit MLX OptiQ Mixed 6/8/16-bit (11×16b + 101×8b + 216×6b) 10.93 GiB 24.77 tok/s 11.86 GB Apple Silicon 16–24 GB (Fastest Portable Build)

Training Recipe

Curated Dataset Composition (~68.82M Training Tokens, Plan B Full 3-in-1)

All datasets were deduplicated, scrubbed of canned safety refusals (891 refusals removed) and failed agent runs, and re-rendered natively with Gemma-4 Unified's chat_template.jinja (<|turn>system/user/model + native <|tool_call>call:...<tool_call|> schema, enable_thinking=False):

Source Dataset Kept Samples Tokens Curation Notes
Vyber07/cyber-security 98,980 61.10M Offensive/defensive security Q&A, CVE/exploit analysis, code auditing, blue-team detection; 885 refusals filtered
NousResearch/hermes-function-calling-v1 8,260 7.79M Converted to native Gemma-4 `<
cx-cmu/agent_trajectories 334 1.31M swebench, terminalbench, mcpbench — passing trajectories only (reward >= 1.0 / >= 5.0); 2,523 failed runs removed
Train / Val Split (max_seq_len=8192) 105,423 / 2,151 68.82M train 98% / 2% split, sequence-packed to 8,477 zero-waste rows

Hyperparameters & Convergence

  • Method: Full BF16 LoRA (load_in_4bit=False), r=16, lora_alpha=16, lora_dropout=0, 65.57M trainable parameters (0.55% of 12.03B), merged losslessly back to 16-bit BF16
  • Loss Masking: train_on_responses_only (<|turn>user\n → <|turn>model\n)
  • Schedule: 1 full epoch, 8,477 packed steps, max_seq_length=8192, cosine LR 5e-5 with 5% warmup (adamw_8bit), Peak VRAM 27.8 GiB on NVIDIA A100-SXM4-40GB

Monotonic validation eval_loss across all 17 / 17 evaluations (zero overfitting):

Step 500 1000 1500 2000 2500 3000 3500 4000 4500
Val Loss 1.0356 0.9690 0.9431 0.9253 0.9081 0.8985 0.8914 0.8826 0.8754
Step 5000 5500 6000 6500 7000 7500 8000 8477 (1.0 ep)
Val Loss 0.8718 0.8646 0.8618 0.8583 0.8554 0.8544 0.8538 0.8537

Local Verification & Benchmarks (Apple M1 Max 64 GB, MLX)

Measured locally via mlx-lm 0.32.2 (enable_thinking=False, greedy temp=0.0):

| Variant | Disk Size | Load Time | Prompt Speed | Generation Speed | Peak RAM | Security Audit | Native <|tool_call> | | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | MLX-bf16 (Lossless) | 22.21 GiB | 4.86 s | 136.94 tok/s | 12.85 tok/s | 24.03 GB | 6 / 6 (100%) | 8 / 8 (100%) | | MLX-OptiQ-8bit (104×16b + 224×8b) | 13.94 GiB | 3.55 s | 154.01 tok/s | 20.30 tok/s | 15.07 GB | 6 / 6 (100%) | 8 / 8 (100%) | | MLX-OptiQ-6bit (11×16b + 101×8b + 216×6b) | 10.93 GiB | 3.10 s | 157.46 tok/s | 24.77 tok/s | 11.86 GB | 6 / 6 (100%) | 8 / 8 (100%) |

Evaluation Highlights (Identical 100% Pass Rate Across BF16, OptiQ-8bit, & OptiQ-6bit)

  • Zero-Refusal Offensive & Defensive Security Auditing (6 / 6 = 100%): Concrete technical payloads + remediation/detection rules with zero safety refusals across UNION SQLi + PHP PDO fix, AWS IMDSv1 SSRF IP bypasses + IMDSv2 hardening, Flask CWE-78 command injection PoC + hardened subprocess, x86-64 NX ret2libc/ROP (pwntools), Active Directory Kerberoasting (GetUserSPNs.py, Event ID 4769, gMSA), and Linux /dev/tcp reverse shell FD analysis + Sigma rule.
  • Native Gemma-4 <|tool_call> Evaluation (8 / 8 = 100%): Exact function & parameter match across all 6 single-turn security tools (run_nmap, query_cve, read_source_file, check_ioc IP & domain, execute_shell), 100% multi-turn follow-up tool chaining (run_nmap output → query_cve(CVE-2024-6387)), and 0% false tool invocation on conceptual negative controls.

Quickstart (transformers)

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "j4n4/Onyx-12B-CyberAgent"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    dtype=torch.bfloat16,
    device_map="auto",
)

messages = [
    {"role": "system", "content": "You are Onyx-12B-CyberAgent, an autonomous cybersecurity auditing agent."},
    {"role": "user", "content": "Audit a Flask route running subprocess.check_output(f'ping -c 1 {host}', shell=True). Provide a PoC payload and hardened fix."},
]
prompt = tokenizer.apply_chat_template(
    messages, 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=512, do_sample=False)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

Responsible & Authorized Use

Released under Apache-2.0 for authorized penetration testing, red/blue team exercises, vulnerability research, CTF competitions, incident response, and security education. Users are solely responsible for complying with all applicable laws and written authorization scopes.

Downloads last month
-
Safetensors
Model size
12B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for j4n4/Onyx-12B-CyberAgent

Finetuned
(6)
this model
Finetunes
1 model
Quantizations
2 models

Datasets used to train j4n4/Onyx-12B-CyberAgent

Collection including j4n4/Onyx-12B-CyberAgent