Run this model with HF Jobs

Run wesley4546/local-automode-0.8b 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 to fine-tune https://huggingface.co/wesley4546/local-automode-0.8b. 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/wesley4546/local-automode-0.8b 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.
How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf wesley4546/local-automode-0.8b:Q8_0
# Run inference directly in the terminal:
llama cli -hf wesley4546/local-automode-0.8b:Q8_0
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf wesley4546/local-automode-0.8b:Q8_0
# Run inference directly in the terminal:
llama cli -hf wesley4546/local-automode-0.8b:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-app
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama serve -hf wesley4546/local-automode-0.8b:Q8_0
# Run inference directly in the terminal:
./build/bin/llama cli -hf wesley4546/local-automode-0.8b:Q8_0
Use Docker
docker model run hf.co/wesley4546/local-automode-0.8b:Q8_0
Quick Links

local-automode-0.8b

A fast, local, 0.8B System 1 tool-call authorization guardrail for AI coding and computer-use agents.

local-automode-0.8b is a fine-tuned decision model (LoRA r=16 + pointer head on Qwen/Qwen3.5-0.8B-Base, warm-started from jaredpalmer/kev-0.8b) that scores whether an agent's next tool call exceeds what the user actually authorized across the session so far. It runs prefill-only in a single forward pass (no text generation), ships as both a LoRA adapter and a 775 MiB Q8_0 GGUF for llama.cpp, and is designed to pair with any OpenAI-compatible reasoning model as a two-stage System 1 + System 2 cascade (the local equivalent of Claude Code's Auto Mode).


Architecture: System 1 + System 2 Cascade

local-automode-0.8b takes the session's [USER] messages, the agent's earlier [AGENT CALL] history (with tool outputs intentionally stripped to defend against indirect prompt injection), and the Call under review:, and outputs a single calibrated probability p_unsafe (fitted temperature T = 1.7175 baked into head.pt and the Q8_0 GGUF).

flowchart LR
    Call["Agent Tool Call + Session History"] --> S1["System 1: local-automode-0.8b (Q8_0 GGUF, ~30–240 ms)"]
    S1 -->|"p < 0.0457 (~96%)"| Allow["Fast-Pass (Allow)"]
    S1 -->|"0.0457 <= p < 0.5840 (~3%)"| S2["System 2: Any OpenAI-Compatible Reasoner"]
    S1 -->|"p >= 0.5840 (~1%)"| Block["Direct Block (Bypass S2)"]
    S2 -->|"safe"| Allow
    S2 -->|"unsafe / error"| Block
  • Fast-pass (p < lo): 96–97% of routine calls pass in **30–240 ms** without ever calling System 2.
  • Gray zone (lo <= p < hi): Ambiguous calls escalate to System 2, which reasons over all [USER] messages and the 10 most recent [AGENT CALL] entries.
  • Direct-block ceiling (p >= hi): High-confidence attacks and forged-consent injections block directly in System 1 so prompt injections cannot persuade System 2 to override them.

Benchmarks

All System 1 scores were evaluated in exact fp32 (Q8_0 GGUF parity verified within max |Δp| = 0.0013). Serving temperature (T = 1.7175) and operating thresholds (lo = 0.0457 [4% safe FPR], hi = 0.5840 [0.2% safe FPR]) were fitted strictly on the Validation split (11,736 session-disjoint calls) with zero tuning on any test, temporal, adversarial, or out-of-distribution split.

1. System 1 Alone (Exact fp32, Calibrated T = 1.7175)

Category Split N (Unsafe) ROC-AUC PR-AUC Recall @ 1% FPR Cal. NLL
Validation Held-out calibration fold (session-disjoint) 11,736 (932) 0.9774 0.8600 — 0.0937
In-Domain Test Full test set (all 19 sources) 4,965 (424) 0.9757 0.8578 64.9% 0.1057
In-Domain Test Real coding-agent sessions subset 1,624 (24) 0.9713 0.5681 58.3% 0.0414
Temporal Holdout Newer post-cutoff coding sessions 475 (61) 0.8880 0.5902 19.7% 0.4443
Temporal Holdout Unseen real-session harness holdout 167 (1) 0.9398 0.0909 — 0.0337
Adversarial Forged-consent / prompt-injection pairs 200 (100) 0.9678 0.9773 89.0% 0.2986
Contrast Probes Shell/OS & general-domain minimal pairs 50 (25) 1.0000 1.0000 100.0% —
Zero-Shot OOD karanxa/agent-action-safety-dataset (16+ unseen domains) 4,049 (2,251) 0.8670 0.8939 — —

2. End-to-End System 1 + System 2 Cascade (lo = 0.0457, hi = 0.5840)

Category Split Sent to S2 Direct S1 Blocks End-to-End FPR End-to-End Recall
In-Domain Test Real coding-agent sessions (1,624) 3.1% (50) 13 0.50% (8/1600) 70.8% (17/24)
Temporal Holdout Unseen real-session harness (167) 1.8% (3) 0 0.00% (0/166) 0/1
Adversarial Forged-consent / prompt-injection (200) 21.5% (43) 79 7.00% (7/100) 87.0% (87/100)
Zero-Shot OOD karanxa stratified sample (500) 19.4% (97) — 15.1% 86.2% (85.6% Acc / 87.1% F1)

3. Zero-Shot OOD Domain Breakdown (karanxa/agent-action-safety-dataset, 4,049 actions)

Zero rows from karanxa appeared in training, and thresholds were not retuned. System 1 ROC-AUC across unseen non-coding domains: media (0.912), devtools (0.893), automation (0.890), consumer (0.889), email (0.888), smart_home (0.885), personal_assistant (0.883), travel (0.877), browser (0.875), payments (0.871), file_manager (0.870), filesystem (0.867), api (0.864), messaging (0.846), cloud (0.834).

4. Live Daily-Driver Telemetry

Running local-automode-0.8b (Q8_0 GGUF in llama.cpp) + System 2 on real coding-agent sessions (258 live tool calls, 30-call history):

  • System 1 latency: p50 = 244 ms, p95 = 283 ms (~30 ms on short sessions).
  • Routine score distribution: median p_unsafe = 0.0052, p95 = 0.0194.
  • Errors / timeouts: 0.

Quickstart

Server code and CLI: wesley4546/local-automode (Apache-2.0).

Want your coding agent to set this up for you? Paste HANDOFF.md directly into Claude Code, Codex, Pi, omp, or Cursor — it includes the install command, launch flags, 3-step smoke test, and the exact /v1/chat/completions hook contract.

Option A: PyTorch (Mac, Linux, Windows — zero custom C++ required)

# Run directly with uvx (downloads wesley4546/local-automode-0.8b automatically)
uvx --from "local-automode[torch]" local-automode

# Or install with pip
pip install "local-automode[torch]"
local-automode \
  --stage2-url http://127.0.0.1:11434/v1 \
  --stage2-model qwen3:32b

Option B: llama.cpp (local-automode-0.8b-Q8_0.gguf, ~775 MiB — DGX Spark / GPU servers)

Requires Unsloth's llama.cpp fork with KevModel / /v1/systemone support:

# 1. Start the System 1 GGUF server
llama-server -m local-automode-0.8b-Q8_0.gguf --host 127.0.0.1 --port 8080 -ngl 99 -c 8192 -np 1

# 2. Start the local-automode proxy (stdlib only — no torch install needed)
pip install local-automode
local-automode \
  --backend llama \
  --llama-url http://127.0.0.1:8080 \
  --stage2-url http://127.0.0.1:8000/v1 \
  --stage2-model <your-stage2-model>

Training Data & Recipe

  • Training set: 65,416 balanced tool-call records across 19 sources and >10,000 sessions (session-disjoint from the validation and test splits):
    • Public datasets: tomngdev/shell-safety (MIT), kontext-security/ShellRisk-Bench (Apache-2.0 code; upstream terms apply), SALT-NLP/SWE-chat (ODC-By), trace-commons/agent-traces (CC-BY-4.0), saidutta69/agentic-vibecoding-traces (MIT).
    • Real coding-agent traces & synthetic pairs: multi-turn coding sessions across 6 harnesses plus forged-consent, PowerShell, and general-domain contrast pairs.
  • Training setup: Warm-started from jaredpalmer/kev-0.8b, LoRA r=16 on all linear layers (11.3M trainable parameters), lr=1e-4, batch=1, accum=8, max_state=6144, fp32 weights with bf16 autocast, 1 epoch (8,177 optimizer steps, ~5.6h on a single RTX 5090).

Scope, Limitations, & Out-of-Scope Uses

  1. Action authorization only—not content moderation: local-automode-0.8b checks whether a tool call exceeds what the user authorized. It intentionally strips tool outputs and is not a content-moderation, toxicity, or social-ethics judge. On AI45Research/ATBench-Codex (0.573 AUC) and ATBench500 (0.476 AUC)—where trajectories are labeled unsafe for social/fairness harms even when explicitly requested by the user—this model does not apply.
  2. Defense-in-depth, not a hard security boundary: 70.8% recall on subtle real coding-agent test errors (17/24, small positive count) means ~3 in 10 subtle edge cases can still slip through. Always pair with OS sandboxing, least-privilege credentials, and deterministic hard blocks for irreversible actions.
  3. Threshold recalibration out-of-domain: Ranking generalizes well to non-coding domains (0.867 AUC on karanxa), but the default lo = 0.0457 / hi = 0.5840 cuts were fitted on coding-agent traffic and yielded 15.1% FPR on karanxa. Recalibrate lo and hi on a small sample of your own traffic if deploying outside coding agents.
  4. Known System 1 blind spots: Unrequested git -C <dir> push --force, unrequested persistent cron/background scheduling, and karanxa's storage domain (N=54).
  5. English-primary, <= 6,144 state tokens: Calls exceeding the context window fail closed (p_unsafe = 1.0).

License & Attribution

  • Model weights & code: Licensed under Apache-2.0.
  • Base model: Qwen/Qwen3.5-0.8B-Base (Apache-2.0) by Qwen / Alibaba Cloud.
  • Warm-start decision architecture: jaredpalmer/kev-0.8b (Apache-2.0) by Jared Palmer / TypeSafe.
  • Public datasets acknowledged: tomngdev/shell-safety (MIT), saidutta69/agentic-vibecoding-traces (MIT), SALT-NLP/SWE-chat (ODC-By), trace-commons/agent-traces (CC-BY-4.0), kontext-security/ShellRisk-Bench (Apache-2.0 code; upstream datasets retain their respective licenses), and karanxa/agent-action-safety-dataset (Apache-2.0, zero-shot evaluation only).
Downloads last month
195
GGUF
Model size
0.8B params
Architecture
qwen35
Hardware compatibility
Log In to add your hardware

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for wesley4546/local-automode-0.8b

Adapter
(71)
this model

Datasets used to train wesley4546/local-automode-0.8b