Run this model with HF Jobs

Run dehackangel/patchguard-inkling-2-mini 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/dehackangel/patchguard-inkling-2-mini. 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/dehackangel/patchguard-inkling-2-mini 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/dehackangel/patchguard-inkling-2-mini. 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/dehackangel/patchguard-inkling-2-mini. 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.
How to use from
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 "dehackangel/patchguard-inkling-2-mini" \
    --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": "dehackangel/patchguard-inkling-2-mini",
		"messages": [
			{
				"role": "user",
				"content": [
					{
						"type": "text",
						"text": "Describe this image in one sentence."
					},
					{
						"type": "image_url",
						"image_url": {
							"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
						}
					}
				]
			}
		]
	}'
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 "dehackangel/patchguard-inkling-2-mini" \
        --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": "dehackangel/patchguard-inkling-2-mini",
		"messages": [
			{
				"role": "user",
				"content": [
					{
						"type": "text",
						"text": "Describe this image in one sentence."
					},
					{
						"type": "image_url",
						"image_url": {
							"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
						}
					}
				]
			}
		]
	}'
Quick Links

PatchGuard-Inkling (dehackangel/patchguard-inkling-2-mini)

PatchGuard-Inkling is a post-trained 26.4B (bfloat16) Python security patching model fine-tuned from thinkingmachines/Inkling-2-Mini using the Halo post-training framework for the White Circle Halo Competition (ft-inkling track).

PatchGuard-Inkling Cross-Model Benchmark


Why PatchGuard-Inkling?

When code-repair models are optimized purely against unit tests via reinforcement learning, they learn reward hacking: taking lazy shortcuts (hardcoding outputs, catching broad exceptions, or blocking single exploit strings) that turn tests green while leaving the underlying vulnerability unfixed.

PatchGuard-Inkling combines two-stage Halo post-training on 1x NVIDIA B200:

  1. Stage 1 โ€” Supervised Fine-Tuning (LoRA SFT): 24 steps (151.7s, loss 0.4394 -> 0.1813, 184,743 unmasked tokens) on Firecrawl-grounded, execution-verified security patches across 8 CWE families (sqli, path_traversal, cmd_injection, ssrf, idor_auth, unsafe_deser_eval, xss, crypto_secrets), merged into 26,386,412,544 bfloat16 parameters.
  2. Stage 2 โ€” Anti-Shortcut Halo Offline GRPO (dapo, kl_beta=0.05): Scored 242/242 rollouts & Nebius contrast pairs with both an isolated subprocess functional/exploit verifier and 12 live White Circle anti-shortcut policies (75 flagged, catching 32 test-passing shortcuts). whitecircle/checkpoint-122 (122 steps) was selected and merged for final release.

Official 3-Seed Evaluation (n=32 per split, seeds=[42, 43, 44], T=0.2, max_new_tokens=768, 1x B200)

Split Model Clean Pass Rate Exploit Pass Functional Pass Shortcut Rate โ†“ Mean Reward
fresh (unseen domain) thinkingmachines/Inkling-2-Mini (Base) 41.66% (ยฑ0.0181) 44.44% 41.66% 53.12% 0.4166
fresh (unseen domain) PatchGuard-Inkling (Final) 91.67% (ยฑ0.065) 100.00% 96.36% 1.04% 0.9336
test (held-out) thinkingmachines/Inkling-2-Mini (Base) 38.54% (ยฑ0.065) 46.88% 41.67% 46.88% 0.4008
test (held-out) PatchGuard-Inkling (Final) 87.50% (ยฑ0.0312) 99.22% 96.35% 3.12% 0.9233
  • Eval runtime (3 seeds ร— 2 splits on 1x B200): Base 879.78s vs. PatchGuard-Inkling 1260.07s.
  • Seed 43 peak on fresh: 96.88% clean pass rate, 0.00% shortcuts, 75.00% on unsafe_deser_eval.

Paired Offline GRPO Ablation (Tests-Only vs. Tests + White Circle)

Experiment Setting Tests-Only Baseline Tests + White Circle (Ours)
test Clean Pass Rate 512 tokens, n=32 71.88% (regressed) 87.50%
test Shortcut Rate โ†“ 512 tokens, n=32 12.50% 3.12%
White Circle Live Judge Clean Rate 512 tokens, 128/128 scored 87.50% 90.62%
Nebius Independent Judge Secure Rate 512 tokens, Qwen/Qwen3-30B-A3B-Instruct-2507 81.25% 96.88%
Hardest CWE (fresh unsafe_deser_eval) 768 tokens (ckpt-60 vs. ckpt-122) 0.00% 50.00%

Cross-Model Security Benchmark (fresh & test, n=32 per split, T=0.2)

Evaluated through the identical isolated subprocess functional/exploit harness and 12-policy White Circle verifier. Base & PatchGuard-Inkling report 3-seed means (768 tokens); external API peers report 1-seed T=0.2 runs (768 tokens for non-reasoning peers, 2048 tokens for reasoning peers).

Model Protocol fresh Clean Pass fresh Exploit Pass fresh Shortcut Rate โ†“ test Clean Pass test Shortcut Rate โ†“
PatchGuard-Inkling (Ours, 26.4B) 3-seed mean, 768 tok 91.67% 100.00% 1.04% 87.50% 3.12%
openai/gpt-4.1-mini (OpenRouter) 1-seed API, 768 tok 75.00% 84.38% 0.00% 87.50% 0.00%
Qwen/Qwen3-30B-A3B-Instruct-2507 (Nebius) 1-seed API, 768 tok 71.88% 89.06% 12.50% 71.88% 9.38%
openai/gpt-oss-120b (Nebius) 1-seed API, 2048 tok 65.62% 83.33% 6.25% 81.25% 0.00%
thinkingmachines/Inkling-2-Small (Nebius) 1-seed API, 2048 tok 56.25% 57.29% 37.50% (9/32 empty) 46.88% 50.00% (10/32 empty)
google/gemma-3-27b-it (Nebius) 1-seed API, 768 tok 53.12% 80.21% 12.50% 40.62% 15.62%
thinkingmachines/Inkling-2-Mini (Base 26.4B) 3-seed mean, 768 tok 41.66% 44.44% 53.12% 38.54% 46.88%

Quickstart & Reproduction

Inference (transformers, bfloat16)

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "dehackangel/patchguard-inkling-2-mini"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

messages = [
    {"role": "system", "content": "Return a secure structural Python patch without shortcuts."},
    {"role": "user", "content": "Fix SQL injection in:\ndef get_user(conn, name):\n    return conn.execute(f"SELECT * FROM users WHERE name = '{name}'").fetchall()"},
]
prompt = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=False,
    reasoning_effort="none",
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=768, temperature=0.2, do_sample=True)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Official Competition Evaluation Reproduction (1x NVIDIA B200, ~21 min)

git clone -b work https://github.com/HackAngeldon/halo.git
cd halo
python -m patchguard.eval.run_eval \
  --model dehackangel/patchguard-inkling-2-mini \
  --n 32 \
  --seeds 42 43 44 \
  --temperature 0.2 \
  --max-new-tokens 768 \
  --batch-size 16 \
  --reasoning-effort none \
  --output-dir eval_out

Stack & Partner Platforms Used

  • Modal: 1x B200 SFT (24 steps), LoRA weight merges, rollout sampling, paired Offline GRPO ablation, and official 3-seed evaluations.
  • White Circle: 12 custom security & anti-shortcut policies scoring 242/242 Offline GRPO rollouts and 128/128 held-out evaluation outputs.
  • Firecrawl: 48 security grounding documents (firecrawl_grounding.jsonl).
  • Nebius Token Factory: Qwen/Qwen3-30B-A3B-Instruct-2507 shortcut-contrast generation and independent security judging.
  • OpenRouter: openai/gpt-4.1-mini SFT synthesis and cross-model comparison.
  • Lovable: Monochrome interactive writeup and 3-seed / 8-CWE verification dashboard.

Limitations

Evaluated on a synthetic parametric benchmark of 8 single-module Python CWE families rather than full multi-file repository CVEs. Structural patch generation increases 3-seed evaluation runtime from 879.78s (Base) to 1260.07s (PatchGuard-Inkling), and unsafe_deser_eval remains the hardest category when format constraints require plain literal structures without type prefixes.

Downloads last month
31
Safetensors
Model size
26B params
Tensor type
F32
ยท
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for dehackangel/patchguard-inkling-2-mini

Finetuned
(190)
this model

Dataset used to train dehackangel/patchguard-inkling-2-mini