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.
Instructions to use j4n4/Onyx-12B-CyberAgent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use j4n4/Onyx-12B-CyberAgent with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="j4n4/Onyx-12B-CyberAgent") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("j4n4/Onyx-12B-CyberAgent") model = AutoModelForMultimodalLM.from_pretrained("j4n4/Onyx-12B-CyberAgent", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use j4n4/Onyx-12B-CyberAgent with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "j4n4/Onyx-12B-CyberAgent" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "j4n4/Onyx-12B-CyberAgent", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/j4n4/Onyx-12B-CyberAgent
- SGLang
How to use j4n4/Onyx-12B-CyberAgent with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "j4n4/Onyx-12B-CyberAgent" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "j4n4/Onyx-12B-CyberAgent", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "j4n4/Onyx-12B-CyberAgent" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "j4n4/Onyx-12B-CyberAgent", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use j4n4/Onyx-12B-CyberAgent with Docker Model Runner:
docker model run hf.co/j4n4/Onyx-12B-CyberAgent
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 LR5e-5with 5% warmup (adamw_8bit), Peak VRAM27.8 GiBon 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 + hardenedsubprocess, x86-64 NXret2libc/ROP (pwntools), Active Directory Kerberoasting (GetUserSPNs.py, Event ID 4769, gMSA), and Linux/dev/tcpreverse 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_iocIP & domain,execute_shell), 100% multi-turn follow-up tool chaining (run_nmapoutput →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
- -
Model tree for j4n4/Onyx-12B-CyberAgent
Base model
google/gemma-4-12B