promptguard.config

class promptguard.PromptGuardConfig(model_name='arkaean/promptguard-distilbert', threshold=0.5, device='auto', max_length=512, batch_size=32)[source]

Bases: object

Configuration for the PromptGuard classifier.

model_name: str = 'arkaean/promptguard-distilbert'

HuggingFace model identifier.

threshold: float = 0.5

0.5).

Type:

Classification threshold (default

device: str | None = 'auto'

'cuda', 'cpu', or 'auto'.

Type:

Inference device

max_length: int = 512

Maximum token sequence length for the tokenizer.

batch_size: int = 32

Default batch size for analyze_batch().