Instructions to use personaio/blast-radius-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use personaio/blast-radius-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="personaio/blast-radius-classifier") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("personaio/blast-radius-classifier") model = AutoModelForCausalLM.from_pretrained("personaio/blast-radius-classifier", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use personaio/blast-radius-classifier with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "personaio/blast-radius-classifier" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "personaio/blast-radius-classifier", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/personaio/blast-radius-classifier
- SGLang
How to use personaio/blast-radius-classifier 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 "personaio/blast-radius-classifier" \ --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": "personaio/blast-radius-classifier", "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 "personaio/blast-radius-classifier" \ --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": "personaio/blast-radius-classifier", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use personaio/blast-radius-classifier with Docker Model Runner:
docker model run hf.co/personaio/blast-radius-classifier
Blast Radius Zero β code risk classifier
A 135M parameter model fine-tuned to answer one question before an agent runs untrusted code: will this hurt the host?
It replies RISKY when the snippet deletes or writes outside its working
directory, talks to the network, spawns unbounded processes, exhausts memory,
reads secrets or mutates the system β and SAFE otherwise.
Part of Blast Radius Zero, an agent that executes every step inside a throwaway container. The classifier is the cheap pre-flight gate; the container is the guarantee.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "personaio/blast-radius-classifier"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.float32)
PROMPT = (
"You are a pre-flight check for an agent that runs untrusted Python.\n"
"Decide whether this code could damage the host it runs on: deleting files "
"outside its working directory, writing outside it, talking to the network, "
"spawning unbounded processes, exhausting memory, reading secrets, or "
"modifying the system.\n"
"Answer with exactly one word: RISKY or SAFE.\n\n"
"CODE:\n```python\n{code}\n```\nANSWER:"
)
code = "import shutil; shutil.rmtree('/')"
ids = tok(PROMPT.format(code=code), return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=6, do_sample=False, pad_token_id=tok.eos_token_id)
print(tok.decode(out[0][ids.shape[-1]:], skip_special_tokens=True).strip()) # RISKY
Training
- Base:
HuggingFaceTB/SmolLM2-135M-Instruct - Data: 544 generated snippets (272/272 RISKY/SAFE) from
tools/make_classifier_data.py, plus the real sandbox traces in personaio/blast-radius-zero-traces. - 4.0 epochs, batch 8, lr 5e-05, cosine schedule, CPU only.
- Validation accuracy 100.0% (96/96) on the held-out split of the same generator.
- Holdout accuracy 100% (22/22) on 22 hand-written snippets the generator never produced β this is the number to trust.
Limits β read this before trusting it
- Trained on generated snippets, so it recognises shapes of risk, not novel attacks. It is a triage signal, not a sandbox.
- Python only.
- The sandbox in the repo still runs every snippet regardless of this verdict; the classifier decides what gets a human review, not what gets executed.
Licence
MIT, same as the parent project.
- Downloads last month
- 23
Model tree for personaio/blast-radius-classifier
Base model
HuggingFaceTB/SmolLM2-135M