What problem does it solve? Building a machine-learning guardrail against prompt injection and jailbreak attacks requires training both fast classical baselines and accurate transformer classifiers, which involves many error-prone choices in feature engineering, hyperparameters, and evaluation. ## Core Features & Use Cases - Classical ML Baseline: Builds a hybrid word (1-3) and character (3-5) n-gram TF-IDF pipeline with LogisticRegression or LinearSVC, saved via joblib. - Transformer Fine-Tuning: Fine-tunes DeBERTa-v3, RoBERTa, or BERT with the Hugging Face Trainer, tracking accuracy, precision, recall, and F1. - Latency Optimization: Exports models to ONNX with dynamic INT8 quantization for low-latency CPU inference. - Use Case: A student training a prompt-injection classifier can follow the provided pipeline code to train a TF-IDF baseline, fine-tune deberta-v3-base, and quantize it for a guardrail API. ## Quick Start Train a baseline TF-IDF classifier and fine-tune a DeBERTa-v3 model on my prompt injection dataset, then export the best model to ONNX with INT8 quantization.