kintsugi 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kintsugi/__init__.py +51 -0
- kintsugi/_data/__init__.py +1 -0
- kintsugi/_data/attacks.py +207 -0
- kintsugi/_data/framings.py +133 -0
- kintsugi/_data/frequency_ja.py +5832 -0
- kintsugi/_data/frequency_words.py +53 -0
- kintsugi/_data/locales.py +66 -0
- kintsugi/attacks.py +75 -0
- kintsugi/cli.py +151 -0
- kintsugi/detect.py +3736 -0
- kintsugi/engine.py +163 -0
- kintsugi/framings.py +135 -0
- kintsugi/frequency.py +153 -0
- kintsugi/judge.py +138 -0
- kintsugi/locales.py +89 -0
- kintsugi/providers.py +307 -0
- kintsugi/transforms.py +229 -0
- kintsugi-0.1.0.dist-info/METADATA +212 -0
- kintsugi-0.1.0.dist-info/RECORD +22 -0
- kintsugi-0.1.0.dist-info/WHEEL +4 -0
- kintsugi-0.1.0.dist-info/entry_points.txt +2 -0
- kintsugi-0.1.0.dist-info/licenses/LICENSE +202 -0
kintsugi/__init__.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Kintsugi: red-teaming machine translation.
|
|
2
|
+
|
|
3
|
+
Named for the Japanese art of repairing breakage with gold: find where a
|
|
4
|
+
translation model breaks, so the cracks can be seen and mended.
|
|
5
|
+
|
|
6
|
+
Kintsugi packages 201 attack categories (2822 seeds), a 123-check local failure
|
|
7
|
+
detector, 11 adversarial source transforms, 115 translator framings, a two-layer
|
|
8
|
+
LLM judge, and a frequent-vs-rare word attack with frequency bands for 20
|
|
9
|
+
languages. It is provider-agnostic: point it at a local Ollama model, any Hugging
|
|
10
|
+
Face model, your own model via a function, or a frontier API, and every finding
|
|
11
|
+
records the model's provenance.
|
|
12
|
+
|
|
13
|
+
Quick start::
|
|
14
|
+
|
|
15
|
+
from kintsugi import RedTeam, OllamaProvider, load_attacks
|
|
16
|
+
rt = RedTeam(OllamaProvider("qwen3.5:0.8b"), lang_pair="en-de")
|
|
17
|
+
findings = rt.run(load_attacks(category="prompt_injection"))
|
|
18
|
+
print(rt.summary(findings))
|
|
19
|
+
"""
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
from . import frequency, framings, locales, transforms
|
|
23
|
+
from .attacks import (
|
|
24
|
+
Attack,
|
|
25
|
+
categories,
|
|
26
|
+
category_names,
|
|
27
|
+
iter_attacks,
|
|
28
|
+
load_attacks,
|
|
29
|
+
observed_rates,
|
|
30
|
+
)
|
|
31
|
+
from .detect import detect_profanity, prefilter
|
|
32
|
+
from .engine import LANG_PAIRS, Finding, RedTeam
|
|
33
|
+
from .judge import Judge, Verdict
|
|
34
|
+
from .providers import (
|
|
35
|
+
AnthropicProvider,
|
|
36
|
+
CallableProvider,
|
|
37
|
+
HuggingFaceProvider,
|
|
38
|
+
OllamaProvider,
|
|
39
|
+
Provider,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
__version__ = "0.1.0"
|
|
43
|
+
|
|
44
|
+
__all__ = [
|
|
45
|
+
"RedTeam", "Finding", "LANG_PAIRS",
|
|
46
|
+
"Attack", "load_attacks", "iter_attacks", "categories", "category_names", "observed_rates",
|
|
47
|
+
"Provider", "OllamaProvider", "HuggingFaceProvider", "CallableProvider", "AnthropicProvider",
|
|
48
|
+
"Judge", "Verdict", "prefilter", "detect_profanity",
|
|
49
|
+
"transforms", "framings", "frequency", "locales",
|
|
50
|
+
"__version__",
|
|
51
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Bundled data as Python literals (no runtime file I/O)."""
|