Run this model with HF Jobs

Run j4n4/Lynx-E4B-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/Lynx-E4B-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/Lynx-E4B-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/Lynx-E4B-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/Lynx-E4B-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.

Lynx-E4B-CyberAgent

Lynx-E4B-CyberAgent is an ultra-fast edge / 16 GB laptop autonomous cybersecurity & tool-calling agent model fine-tuned in full BF16 LoRA from huihui-ai/Huihui-gemma-4-E4B-it-abliterated (abliterated google/gemma-4-E4B-it, 8.0B total / 4.5B effective parameters with Per-Layer Embeddings, 42 layers, 128K native context).

Built as the fastest ultra-portable edge sibling alongside j4n4/Onyx-12B-CyberAgent (12B dense), j4n4/Nyx-27B-CyberAgent (27.4B dense), and j4n4/Vex-35B-A3B-CyberAgent (35.1B MoE), Lynx-E4B-CyberAgent delivers 100% (8/8) native Gemma-4 <|tool_call> accuracy (including multi-turn tool chaining!) and 0% safety refusals across all three MLX precisions — running at 48.35 tok/s in just 10.69 GB unified memory on Apple M1 Max.

Model Family & Variants

Repository Format Disk Size M1 Max 64 GB Speed Peak RAM Recommended Hardware
j4n4/Lynx-E4B-CyberAgent (this repo) Transformers BF16 (merged, 128K ctx) 14.92 GiB — — 16–24 GB GPU / vLLM / SGLang / Custom Quants
j4n4/Lynx-E4B-CyberAgent-MLX-bf16 MLX BF16 lossless (3 shards) 13.93 GiB 29.21 tok/s 15.03 GB Apple Silicon 24–32 GB+ (Lossless Reference)
j4n4/Lynx-E4B-CyberAgent-MLX-OptiQ-8bit MLX OptiQ Exact-BF16 Mixed 8/16-bit (80×16b + 263×8b) 11.76 GiB 43.44 tok/s 11.81 GB Apple Silicon 16–24 GB (High-Fidelity Mixed Precision)
j4n4/Lynx-E4B-CyberAgent-MLX-OptiQ-6bit MLX OptiQ Exact-BF16 Mixed 6/8/16-bit (35×16b + 72×8b + 236×6b) 10.69 GiB 48.35 tok/s 10.69 GB Apple Silicon 16 GB MacBook Air/Pro (Fastest Edge Build)

Training Recipe

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

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

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

Hyperparameters & Convergence

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

Strictly monotonic validation eval_loss all the way to epoch 1.0 (zero overfitting):

Step 3500 4000 4500 5000 5500 6000 6500 7000 7500 8000 8500 8560 (1.0 ep)
Val Loss 0.9696 0.9627 0.9566 0.9503 0.9474 0.9447 0.9413 0.9396 0.9386 0.9381 0.9380 0.9379

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

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

| Variant | Disk Size | Load Time | Prompt Speed | Generation Speed | Peak RAM | Refusals | Security Audit (temp=0.0) | Native <|tool_call> | | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | MLX-bf16 (Lossless) | 13.93 GiB | 3.64 s | 444.85 tok/s | 29.21 tok/s | 15.03 GB | 0 / 6 | 5 / 6 (83.3%) | 8 / 8 (100%) | | MLX-OptiQ-8bit (80×16b + 263×8b) | 11.76 GiB | 3.11 s | 497.87 tok/s | 43.44 tok/s | 11.81 GB | 0 / 6 | 4 / 6 (66.7%) | 8 / 8 (100%) | | MLX-OptiQ-6bit (35×16b + 72×8b + 236×6b) | 10.69 GiB | 2.79 s | 506.03 tok/s | 48.35 tok/s | 10.69 GB | 0 / 6 | 5 / 6 (83.3%) | 8 / 8 (100%) |

Evaluation Highlights & Sampling Tip

  • Native Gemma-4 <|tool_call> Evaluation (8 / 8 = 100% across all 3 variants): 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, and 0% false invocation on conceptual negative controls.
  • Zero Safety Refusals (0 / 18 refusals across all 3 variants): All non-passing cases under strict temp=0.0 greedy decoding were zero-refusal formatting/repetition artifacts on hex literals (not refusals).
  • Recommended Sampling: For best output quality on this compact 4.5B-effective model, use mild sampling (temp=0.2–0.6, top_p=0.95, repetition_penalty=1.05) rather than pure greedy temp=0.0.

Quickstart (transformers)

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "j4n4/Lynx-E4B-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 Lynx-E4B-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, temperature=0.3, top_p=0.95, do_sample=True)
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
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for j4n4/Lynx-E4B-CyberAgent

Finetuned
(530)
this model
Adapters
2 models
Quantizations
3 models

Datasets used to train j4n4/Lynx-E4B-CyberAgent

Collection including j4n4/Lynx-E4B-CyberAgent