Instructions to use hlyn-labs/prompt-injection-judge-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use hlyn-labs/prompt-injection-judge-3b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("dphn/Dolphin3.0-Llama3.2-3B") model = PeftModel.from_pretrained(base_model, "hlyn-labs/prompt-injection-judge-3b") - Transformers
How to use hlyn-labs/prompt-injection-judge-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hlyn-labs/prompt-injection-judge-3b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hlyn-labs/prompt-injection-judge-3b") model = AutoModelForCausalLM.from_pretrained("hlyn-labs/prompt-injection-judge-3b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use hlyn-labs/prompt-injection-judge-3b with 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 hlyn-labs/prompt-injection-judge-3b:F16 # Run inference directly in the terminal: llama cli -hf hlyn-labs/prompt-injection-judge-3b:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf hlyn-labs/prompt-injection-judge-3b:F16 # Run inference directly in the terminal: llama cli -hf hlyn-labs/prompt-injection-judge-3b:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf hlyn-labs/prompt-injection-judge-3b:F16 # Run inference directly in the terminal: ./llama-cli -hf hlyn-labs/prompt-injection-judge-3b:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf hlyn-labs/prompt-injection-judge-3b:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf hlyn-labs/prompt-injection-judge-3b:F16
Use Docker
docker model run hf.co/hlyn-labs/prompt-injection-judge-3b:F16
- LM Studio
- Jan
- vLLM
How to use hlyn-labs/prompt-injection-judge-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hlyn-labs/prompt-injection-judge-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hlyn-labs/prompt-injection-judge-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hlyn-labs/prompt-injection-judge-3b:F16
- SGLang
How to use hlyn-labs/prompt-injection-judge-3b with 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 "hlyn-labs/prompt-injection-judge-3b" \ --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": "hlyn-labs/prompt-injection-judge-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "hlyn-labs/prompt-injection-judge-3b" \ --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": "hlyn-labs/prompt-injection-judge-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use hlyn-labs/prompt-injection-judge-3b with Ollama:
ollama run hf.co/hlyn-labs/prompt-injection-judge-3b:F16
- Unsloth Desktop
- Pi
How to use hlyn-labs/prompt-injection-judge-3b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf hlyn-labs/prompt-injection-judge-3b:F16
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "hlyn-labs/prompt-injection-judge-3b:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use hlyn-labs/prompt-injection-judge-3b with Docker Model Runner:
docker model run hf.co/hlyn-labs/prompt-injection-judge-3b:F16
- Lemonade
How to use hlyn-labs/prompt-injection-judge-3b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull hlyn-labs/prompt-injection-judge-3b:F16
Run and chat with the model
lemonade run user.prompt-injection-judge-3b-F16
List all available models
lemonade list
- Hermes Agent
How to use hlyn-labs/prompt-injection-judge-3b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf hlyn-labs/prompt-injection-judge-3b:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default hlyn-labs/prompt-injection-judge-3b:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use hlyn-labs/prompt-injection-judge-3b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf hlyn-labs/prompt-injection-judge-3b:F16
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "hlyn-labs/prompt-injection-judge-3b:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Defender Security Judge — Dolphin 3.0 Llama 3.2 3B
A fine-tuned, production-hardened prompt injection security judge built on top of dphn/Dolphin3.0-Llama3.2-3B.
This model is Stage 2 of the Defender multi-layer LLM security pipeline — a real-time adversarial firewall that intercepts, analyzes, and classifies user prompts before they ever reach a protected LLM.
Benchmark Results
Evaluated against the rogue-security/prompt-injections-benchmark — the industry-standard Qualifire benchmark used to evaluate production prompt injection defenses.
| Metric | Score |
|---|---|
| Accuracy | 90.00% |
| F1 Score | 0.9038 |
| Precision | 88.68% |
| Recall | 92.16% |
A 3B quantized model running entirely offline achieving 90% accuracy on the hardest curated jailbreak benchmark available. No API calls. No latency. No cost.
What Makes This Model Different
Zero refusals. Built on the uncensored Dolphin base, it coldly analyzes any attack — no matter how explicit — without flinching or refusing to process the payload.
Rigid JSON output. DoRA fine-tuning permanently hardwires the model to emit only structured {"decision", "confidence", "reason", "allowed_payload"} JSON. No preamble. No yapping.
Calibrated confidence. Trained with Gaussian confidence noise on ambiguous samples, the model's confidence field is mathematically trustworthy — not the overconfident 0.99 you get from vanilla LLMs.
Long-context immunity. Trained at sequence_len: 8192 with 98.37% sample packing efficiency. The model can read an 8,000-token document and catch an attack buried at token 7,500.
Training Details
- Technique: DoRA (Weight-Decomposed LoRA) + NEFTune (α=5.0) + Flash Attention + Sample Packing
- Hardware: NVIDIA H100 80GB SXM5
- Training Time: ~14 minutes
- Loss: 2.30 → 0.18 (converged cleanly across 3 epochs)
- Dataset:
karan11/defender-judge-fine-tune— 2,700 DeBERTa-scored, calibration-hardened samples
Available Artifacts
| File | Description |
|---|---|
adapter_model.safetensors |
Raw LoRA adapter weights |
judge-dolphin3-3b-f16.gguf |
Full merged model in F16 (6.4 GB) |
judge-q4_k_m.gguf |
Production artifact — Q4_K_M quantized (2.0 GB) |
Intended Use
This model is strictly a security classifier. It is not a general-purpose assistant.
Load it with llama-cpp-python and pass it the Defender system prompt for correct behavior.
from llama_cpp import Llama
llm = Llama(model_path="judge-q4_k_m.gguf", n_gpu_layers=-1, n_ctx=8192)
- Downloads last month
- 21
4-bit
16-bit