Token Classification
Transformers
ONNX
Safetensors
Transformers.js
English
modernbert
prompt-injection
indirect-prompt-injection
prompt-localization
sanitization
ai-security
guardrails
tamarillo
prompt-injection-detection
jailbreak-detection
llm-security
litellm
nemo-guardrails
open-webui
Instructions to use Tamarillo/injection-span-guard-tiny-en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tamarillo/injection-span-guard-tiny-en with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Tamarillo/injection-span-guard-tiny-en")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("Tamarillo/injection-span-guard-tiny-en") model = AutoModelForTokenClassification.from_pretrained("Tamarillo/injection-span-guard-tiny-en", device_map="auto") - Transformers.js
How to use Tamarillo/injection-span-guard-tiny-en with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('token-classification', 'Tamarillo/injection-span-guard-tiny-en'); - Notebooks
- Google Colab
- Kaggle
Document parity-verified Gather-INT8 ONNX (onnx/model_quantized.onnx) and { dtype: 'q8' } usage
Browse files
README.md
CHANGED
|
@@ -230,3 +230,8 @@ Trained exclusively on **commercially clean (`Apache-2.0`, `MIT`, `CC-BY-4.0`)**
|
|
| 230 |
- **Multilingual coverage caveat:** `Tamarillo/injection-span-guard-tiny-en` is strictly English-only and should not be deployed on non-English inputs.
|
| 231 |
- **Multi-kilotoken CPU latency:** On 4 vCPU threads (`onnxruntime` FP32), `Tamarillo/injection-span-guard-tiny-en` runs in `9.3 ms` at 64 tokens, `72.5 ms` at 512 tokens, `219.1 ms` at 1,024 tokens, and `763.3 ms` at 2,048 tokens. For high-throughput multi-kilotoken MCP gateways, deploy on GPU (`21.1 ms` p50 on `NVIDIA A100-SXM4-80GB` at 2,048 tokens) or use `tiny-en` on CPU/WASM.
|
| 232 |
- **Context extrapolation:** Validated up to `3,584` tokens; performance between `3,584` and `7,999` tokens relies on backbone RoPE extrapolation and is not directly benchmarked here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
- **Multilingual coverage caveat:** `Tamarillo/injection-span-guard-tiny-en` is strictly English-only and should not be deployed on non-English inputs.
|
| 231 |
- **Multi-kilotoken CPU latency:** On 4 vCPU threads (`onnxruntime` FP32), `Tamarillo/injection-span-guard-tiny-en` runs in `9.3 ms` at 64 tokens, `72.5 ms` at 512 tokens, `219.1 ms` at 1,024 tokens, and `763.3 ms` at 2,048 tokens. For high-throughput multi-kilotoken MCP gateways, deploy on GPU (`21.1 ms` p50 on `NVIDIA A100-SXM4-80GB` at 2,048 tokens) or use `tiny-en` on CPU/WASM.
|
| 232 |
- **Context extrapolation:** Validated up to `3,584` tokens; performance between `3,584` and `7,999` tokens relies on backbone RoPE extrapolation and is not directly benchmarked here.
|
| 233 |
+
|
| 234 |
+
### Gather-INT8 Quantized ONNX (`onnx/model_quantized.onnx` — `67.16 MB`, `1.82x` smaller)
|
| 235 |
+
|
| 236 |
+
- **Verified Parity (`onnx/quantization_check.json`):** `100.0%` prediction agreement vs. FP32 ONNX (mean abs probability diff `8e-05`, max `0.02472`; `27.32 ms` 4-thread CPU p50 @ 256 tokens).
|
| 237 |
+
- **Browser WASM / Node.js (`@huggingface/transformers` v3):** pass `{ dtype: "q8" }` to load `onnx/model_quantized.onnx` automatically.
|