Metadata-Version: 2.4
Name: redline-evals
Version: 0.2.0
Summary: Did your fine-tune get less safe? Run the same adversarial tests on two model versions and get a before/after safety report.
License-Expression: MIT
Project-URL: Homepage, https://github.com/kush0o7/Redline-Agent-Safety-Eval
Project-URL: Issues, https://github.com/kush0o7/Redline-Agent-Safety-Eval/issues
Project-URL: Sample report, https://kush0o7.github.io/Redline-Agent-Safety-Eval/sample-report.html
Keywords: ai-safety,llm-evaluation,red-teaming,prompt-injection,jailbreak,fine-tuning
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: sqlalchemy>=2.0
Requires-Dist: pydantic>=2.6
Requires-Dist: pydantic-settings>=2.2
Requires-Dist: httpx>=0.27
Requires-Dist: litellm>=1.0
Requires-Dist: instructor>=1.0
Provides-Extra: server
Requires-Dist: fastapi>=0.110; extra == "server"
Requires-Dist: uvicorn>=0.29; extra == "server"
Requires-Dist: alembic>=1.13; extra == "server"
Requires-Dist: psycopg[binary]>=3.1; extra == "server"
Requires-Dist: redis>=5.0; extra == "server"
Requires-Dist: arq>=0.26; extra == "server"
Requires-Dist: boto3>=1.34; extra == "server"
Requires-Dist: cryptography>=42.0; extra == "server"
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.23; extra == "test"
Requires-Dist: httpx>=0.27; extra == "test"
Provides-Extra: dev
Requires-Dist: redline-evals[server]; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: httpx>=0.27; extra == "dev"

# redline-evals

**Did your fine-tune just get less safe? Find out in one command.**

```bash
pip install redline-evals
redline try                                      # 2-3 minutes, one free Groq or OpenRouter key, no downloads
redline compare ollama/llama3.1 ollama/hermes3   # your own models
```

The first line of every result is one plain sentence, e.g. "❌ Don't ship hermes3. It's less safe than llama3.1: 9 tests that llama3.1 passed, hermes3 failed."

Redline runs the same adversarial test cases (jailbreaks, prompt injection through tool results, made-up facts, over-refusal and a finance pack) on two versions of a model. It grades each answer and tells you whether the new version is safe to release. A statistics test (McNemar) says whether the change is real or noise.

- **Exit codes for CI:** 0 = pass, 1 = the release fails, 2 = error.
- **Output** (in `./redline-out`): a terminal summary, `report.html`, `results.jsonl` and `summary.json`. Answers to harmful requests are redacted.
- **Grader:** a local Ollama judge if you have a suitable model pulled (`ollama pull qwen2.5:7b`), otherwise keyword rules with a warning. Every report names the grader. Judge accuracy hasn't been measured against human labels yet.
- **Resume:** run the same command again after Ctrl-C or an error. Answers are cached, so re-grading doesn't re-generate them.

Models: `ollama/x`, `openai/x`, `anthropic/x`, `groq/x`, `gemini/x`, `openrouter/x`, `hf/org/x`, any OpenAI-compatible server (`http://host:port/v1#model`), and `fake-safe` / `fake-degraded` (simulated, offline).

```bash
redline compare fake-safe fake-degraded     # offline demo, no models needed
redline scan ollama/llama3.1 --cases 60     # one model against the tier criteria
redline compare A B --judge groq/openai/gpt-oss-120b   # free-tier judge: public test cases only
redline report ./redline-out                # print the summary and rewrite the files
```

The self-hosted server (API, Postgres, worker, UI) is in the `server` extra: `pip install "redline-evals[server]"`.

Docs, methodology and limitations: https://github.com/kush0o7/Redline-Agent-Safety-Eval
