stateprobe 0.3.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.
- stateprobe/__init__.py +53 -0
- stateprobe/__main__.py +13 -0
- stateprobe/cli.py +2278 -0
- stateprobe/detector.py +401 -0
- stateprobe/engines/__init__.py +49 -0
- stateprobe/engines/base.py +100 -0
- stateprobe/engines/lab.py +401 -0
- stateprobe/engines/llm_judge.py +342 -0
- stateprobe/engines/static.py +118 -0
- stateprobe/enterprise/__init__.py +32 -0
- stateprobe/eval/__init__.py +14 -0
- stateprobe/eval/client.py +125 -0
- stateprobe/eval/scorer.py +242 -0
- stateprobe/html_report.py +511 -0
- stateprobe/lab/__init__.py +10 -0
- stateprobe/lab/cache.py +169 -0
- stateprobe/lab/deepseek_pairs.py +105 -0
- stateprobe/lab/probe.py +264 -0
- stateprobe/mcp_server.py +114 -0
- stateprobe/models.py +322 -0
- stateprobe/rewriter.py +256 -0
- stateprobe/rules.py +958 -0
- stateprobe/skill/__init__.py +53 -0
- stateprobe/skill/attention.py +1769 -0
- stateprobe/structural.py +176 -0
- stateprobe-0.3.0.dist-info/METADATA +205 -0
- stateprobe-0.3.0.dist-info/RECORD +31 -0
- stateprobe-0.3.0.dist-info/WHEEL +5 -0
- stateprobe-0.3.0.dist-info/entry_points.txt +3 -0
- stateprobe-0.3.0.dist-info/licenses/LICENSE +21 -0
- stateprobe-0.3.0.dist-info/top_level.txt +1 -0
stateprobe/__init__.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""StateProbe — Prompt State Debugger.
|
|
2
|
+
|
|
3
|
+
Diagnose which behavioral vectors your prompt activates in an LLM,
|
|
4
|
+
identify pollution sources, and get rewrite suggestions to reach a target state.
|
|
5
|
+
|
|
6
|
+
Theoretical foundation:
|
|
7
|
+
- Anthropic, "Persona Vectors: Monitoring and Controlling Character Traits in
|
|
8
|
+
Language Models" (arXiv:2507.21509, 2025)
|
|
9
|
+
- DeepSeek-AI, "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via
|
|
10
|
+
Reinforcement Learning" (arXiv:2501.12948, 2025)
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
__version__ = "0.3.0"
|
|
14
|
+
|
|
15
|
+
from stateprobe.models import (
|
|
16
|
+
Axis,
|
|
17
|
+
AxisReading,
|
|
18
|
+
PollutionSource,
|
|
19
|
+
Report,
|
|
20
|
+
TargetPreset,
|
|
21
|
+
)
|
|
22
|
+
from stateprobe.detector import diagnose
|
|
23
|
+
from stateprobe.rewriter import suggest_rewrite
|
|
24
|
+
from stateprobe.engines import (
|
|
25
|
+
Engine,
|
|
26
|
+
EngineError,
|
|
27
|
+
EngineUnavailable,
|
|
28
|
+
EvidenceContributor,
|
|
29
|
+
LLMJudgeContributor,
|
|
30
|
+
LLMJudgeEngine,
|
|
31
|
+
StaticEngine,
|
|
32
|
+
StaticRuleContributor,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
__all__ = [
|
|
36
|
+
"Axis",
|
|
37
|
+
"AxisReading",
|
|
38
|
+
"PollutionSource",
|
|
39
|
+
"Report",
|
|
40
|
+
"TargetPreset",
|
|
41
|
+
"diagnose",
|
|
42
|
+
"suggest_rewrite",
|
|
43
|
+
"EvidenceContributor",
|
|
44
|
+
"EngineError",
|
|
45
|
+
"EngineUnavailable",
|
|
46
|
+
"StaticRuleContributor",
|
|
47
|
+
"LLMJudgeContributor",
|
|
48
|
+
# Deprecated aliases (removed in v0.3):
|
|
49
|
+
"Engine",
|
|
50
|
+
"StaticEngine",
|
|
51
|
+
"LLMJudgeEngine",
|
|
52
|
+
"__version__",
|
|
53
|
+
]
|
stateprobe/__main__.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Entry point for ``python -m stateprobe``.
|
|
2
|
+
|
|
3
|
+
Forwards to the standard CLI defined by ``[project.scripts] stateprobe`` so
|
|
4
|
+
users who don't have the ``stateprobe`` script on PATH (e.g. ``pip install
|
|
5
|
+
--user`` without PATH set, or running directly from a checkout) can still
|
|
6
|
+
invoke the CLI in the conventional way.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from stateprobe.cli import main
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
if __name__ == "__main__":
|
|
13
|
+
main()
|