Metadata-Version: 2.4
Name: pfranger
Version: 0.1.1
Summary: CLI tool for auditing prompts using PromptForest
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: torch
Requires-Dist: transformers
Requires-Dist: sentence-transformers
Requires-Dist: xgboost
Requires-Dist: scikit-learn
Requires-Dist: joblib
Requires-Dist: PyYAML
Requires-Dist: tqdm
Requires-Dist: jinja2
Requires-Dist: promptforest
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# PromptForest Ranger

PromptForest Ranger (or PFRanger) is a CLI tool for auditing LLM prompts for injection attacks and jailbreaks. It leverages the PromptForest ensemble engine to scan datasets and generate comprehensive and accurate HTML reports.

## Features

### Works Offline
All data stays on your computer. The internet is only required to download models onto your computer. 

### Accurate and Reliable
Ranger utilises the PromptForest engine, which provides responses that are not only accurate, but also calibrated and reliable. 

### Fast
Startup latency of ~3s and an average request rate of 24 prompts/s with 3 workers.

## Installation

```bash
pip install pfranger
```

## Usage

```bash
ranger [INPUT_FILE] [OPTIONS]
```

### Examples

Scan a CSV file:
```bash
ranger validation_prompts.csv -p text
```

Scan with custom configuration:
```bash
ranger prompts.jsonl -c my_config.yaml
```

### Arguments

| Argument | Description | Default |
|----------|-------------|---------|
| `input` | Path to the file containing prompts | Required |
| `--output`, `-o` | Output path for HTML report | `report.html` |
| `--input-format`, `-f` | Force input format (csv, json, jsonl, txt) | Auto-detect |
| `--prompt-col`, `-p` | Column name for prompts (CSV/JSON) | `prompt` |
| `--timestamp-col`, `-t` | Column name for timestamp | None |
| `--workers`, `-w` | Number of parallel worker threads | 4 |
| `--config`, `-c` | Path to PromptForest YAML configuration file | Benchmark Defaults |

## Configuration

Ranger uses the `promptforest` library configuration. Valid YAML configurations can enable/disable specific models or adjust weights.

## License

See [LICENSE](LICENSE).
