Downloads · 30 days
13
10% of all-time downloads
nicolasembleton/mini-jev-minicpm5-2b-shell-safety-phase1b-onnx
mini-jev-minicpm5-2b-shell-safety-phase1b-onnx is a text classification model from nicolasembleton. Use it when you need a label for a piece of text. It is set up for transformers.js. The card lists the license as apache-2.0.
Browser-ready allow / warn / block classifier for shell commands. Closed-set scoring over candidate label tokens (one forward pass; no text generation).
Downloads · 30 days
13
10% of all-time downloads
All-time downloads
136
Public
Repo size
16.6 GB
Likes
0
Public
Click a slice to open those files.
.onnx_data15.5 GB · 81%
From the Hugging Face model README
Browser-ready allow / warn / block classifier for shell commands. Closed-set scoring over candidate label tokens (one forward pass; no text generation).
Built for the Mini-Jev WebGPU demo.
On Apple M-series Chrome with WebGPU / ORT Metal, prefer q8:
dtype: "q8" → onnx/model_quantized.onnx (+ model_quantized.onnx_data, ~2.35 GB). Alias: onnx/model_q8.onnx.MatMulInteger / MatMulConstBOnly) — no MatMulNBits, so it avoids Metal unaligned accesses.fp16 (~5.0 GB with model_fp16.onnx_data) can RangeError: Out of memory in Chrome/Transformers.js on M2 Max.q4 / q4f16 may fail on Metal with MatMulNBits unaligned accesses.WASM can still use q4 for the smaller download.
Transformers.js layout for @huggingface/transformers AutoModelForCausalLM:
config.json, tokenizer files, quantize_config.jsononnx/model.onnx (+ _data) — fp32 baseline (~5.4 GB data)onnx/model_quantized.onnx (+ _data) — q8 / IntegerOps; recommended for Apple Chrome WebGPU (~2.35 GB). Alias onnx/model_q8.onnxonnx/model_fp16.onnx (+ _data) — all-fp16 (~5.0 GB); kept for non-browser / when heap allowsonnx/model_q4.onnx — ~1.8 GB; may fail on Metal WebGPU (MatMulNBits)onnx/model_q4f16.onnx — optional; may fail on Metal WebGPUimport { AutoModelForCausalLM, AutoTokenizer } from "@huggingface/transformers";
const model_id = "nicolasembleton/mini-jev-minicpm5-2b-shell-safety-phase1b-onnx";
const tokenizer = await AutoTokenizer.from_pretrained(model_id);
const model = await AutoModelForCausalLM.from_pretrained(model_id, {
dtype: "q8", // IntegerOps; use "q4" on WASM if you need smaller
device: "webgpu", // or "wasm"
});
| Base | openbmb/MiniCPM5-2B |
| Fine-tune | LoRA → continue-train Phase-1b, then merged and exported |
| Labels | allow / warn / block |
| Merged PyTorch | nicolasembleton/mini-jev-minicpm5-2b-shell-safety-phase1b-merged |
Ternary gold was planted after remapping a public binary shell-risk set; binary labels were not treated as ground truth.
| Split | Contents | n |
|---|---|---|
| Train (Phase-1) | Remapped kontext-security/ShellRisk-Bench + hand traps/anchors | 4 000 |
| Phase-1b extra | Hand boundary rows (block↔warn, soft allow↔warn) | 82 |
| Eval (frozen) | Hand-heavy smoke panel, zero overlap with train | 105 |
ShellRisk upstream slices used in train (approx.): swesmith, terminalbench, nl2bash, atomicredteam, capped gtfobins. Prefer upstream licenses; this card does not relicense them.
Planted gold on the 105-item smoke panel (not a closed-menu score):
| Metric | Value |
|---|---|
| Overall accuracy | 0.914 |
| Allow recall | 0.829 |
| Warn recall | 0.933 |
| Block recall | 1.000 |
Browser ONNX / WebGPU may differ slightly from these PyTorch numbers.
Research and demos of in-browser agent tooling gates. Not a substitute for sandboxing, allowlists, or human review on real systems.