rai-check-kit 0.0.1__tar.gz
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.
- rai_check_kit-0.0.1/.gitignore +55 -0
- rai_check_kit-0.0.1/LICENSE +21 -0
- rai_check_kit-0.0.1/PKG-INFO +161 -0
- rai_check_kit-0.0.1/README.md +115 -0
- rai_check_kit-0.0.1/pyproject.toml +48 -0
- rai_check_kit-0.0.1/src/rai_audit/kit/__init__.py +1 -0
- rai_check_kit-0.0.1/src/rai_audit/kit/cli.py +43 -0
- rai_check_kit-0.0.1/tests/test_smoke.py +23 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
|
|
8
|
+
# Virtual environments
|
|
9
|
+
.venv/
|
|
10
|
+
venv/
|
|
11
|
+
env/
|
|
12
|
+
|
|
13
|
+
# Packaging / build
|
|
14
|
+
build/
|
|
15
|
+
dist/
|
|
16
|
+
*.egg-info/
|
|
17
|
+
*.egg
|
|
18
|
+
pip-wheel-metadata/
|
|
19
|
+
*.whl
|
|
20
|
+
|
|
21
|
+
# Test / coverage / type checking
|
|
22
|
+
.pytest_cache/
|
|
23
|
+
.coverage
|
|
24
|
+
.coverage.*
|
|
25
|
+
htmlcov/
|
|
26
|
+
.mypy_cache/
|
|
27
|
+
.ruff_cache/
|
|
28
|
+
.hypothesis/
|
|
29
|
+
|
|
30
|
+
# Audit runtime artifacts
|
|
31
|
+
.rai-check/
|
|
32
|
+
*_audit_report.html
|
|
33
|
+
*_audit_report.md
|
|
34
|
+
*_audit_report.json
|
|
35
|
+
loan_audit_report.*
|
|
36
|
+
|
|
37
|
+
# Environment / secrets
|
|
38
|
+
.env
|
|
39
|
+
.env.*
|
|
40
|
+
!.env.example
|
|
41
|
+
|
|
42
|
+
# IDE / editor
|
|
43
|
+
.vscode/
|
|
44
|
+
.idea/
|
|
45
|
+
*.swp
|
|
46
|
+
*.swo
|
|
47
|
+
*~
|
|
48
|
+
|
|
49
|
+
# OS
|
|
50
|
+
.DS_Store
|
|
51
|
+
Thumbs.db
|
|
52
|
+
Desktop.ini
|
|
53
|
+
|
|
54
|
+
# Typical dev data
|
|
55
|
+
dev-data/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sai Teja Erukude
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: rai-check-kit
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Responsible AI (RAI) Check Kit - security, reliability, and trustworthy AI system checks
|
|
5
|
+
Author: Sai Teja Erukude
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Sai Teja Erukude
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Keywords: audit,fairness,responsible-ai,robustness,security,trustworthy-ai
|
|
29
|
+
Classifier: Development Status :: 4 - Beta
|
|
30
|
+
Classifier: Intended Audience :: Developers
|
|
31
|
+
Classifier: Intended Audience :: Science/Research
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
35
|
+
Requires-Python: >=3.10
|
|
36
|
+
Requires-Dist: rai-check-core>=0.0.1
|
|
37
|
+
Requires-Dist: rai-check-ml>=0.0.1
|
|
38
|
+
Provides-Extra: all
|
|
39
|
+
Requires-Dist: rai-check-dl>=0.0.1; extra == 'all'
|
|
40
|
+
Requires-Dist: rai-check-genai>=0.0.1; extra == 'all'
|
|
41
|
+
Provides-Extra: dl
|
|
42
|
+
Requires-Dist: rai-check-dl>=0.0.1; extra == 'dl'
|
|
43
|
+
Provides-Extra: genai
|
|
44
|
+
Requires-Dist: rai-check-genai>=0.0.1; extra == 'genai'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
# RAI Check Kit
|
|
48
|
+
|
|
49
|
+
**RAI** = **Responsible AI**. A Python package suite for evidence-grade audits of
|
|
50
|
+
responsible, secure, and trustworthy AI systems.
|
|
51
|
+
|
|
52
|
+
Run fairness, data quality, robustness, compliance, image, medical imaging, LLM
|
|
53
|
+
safety, RAG security, and agent trace checks. Export HTML, Markdown, or JSON
|
|
54
|
+
reports and gate CI pipelines on risk thresholds.
|
|
55
|
+
|
|
56
|
+
**Author:** Sai Teja Erukude | **License:** MIT
|
|
57
|
+
|
|
58
|
+
## Why this exists
|
|
59
|
+
|
|
60
|
+
AI teams often run fairness, robustness, RAG, and agent security checks separately.
|
|
61
|
+
RAI Check Kit brings them into one evidence and reporting workflow, so teams can
|
|
62
|
+
review findings consistently, preserve audit artifacts, and apply the same CI gates
|
|
63
|
+
across model types.
|
|
64
|
+
|
|
65
|
+
## What it looks like
|
|
66
|
+
|
|
67
|
+
<table>
|
|
68
|
+
<tr>
|
|
69
|
+
<td><strong>HTML audit report</strong><br>
|
|
70
|
+
<a href="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/html-report.png">
|
|
71
|
+
<img src="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/html-report.png" alt="HTML fairness audit report" width="560">
|
|
72
|
+
</a>
|
|
73
|
+
</td>
|
|
74
|
+
<td><strong>Model card export</strong><br>
|
|
75
|
+
<a href="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/model-card.png">
|
|
76
|
+
<img src="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/model-card.png" alt="Markdown model card preview" width="560">
|
|
77
|
+
</a>
|
|
78
|
+
</td>
|
|
79
|
+
</tr>
|
|
80
|
+
<tr>
|
|
81
|
+
<td><strong>LLM and RAG audit output</strong><br>
|
|
82
|
+
<a href="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/rag-check.png">
|
|
83
|
+
<img src="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/rag-check.png" alt="RAG security audit output" width="560">
|
|
84
|
+
</a>
|
|
85
|
+
</td>
|
|
86
|
+
<td><strong>Agent trace finding</strong><br>
|
|
87
|
+
<a href="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/agent-trace-finding.png">
|
|
88
|
+
<img src="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/agent-trace-finding.png" alt="Agent trace prompt injection finding" width="560">
|
|
89
|
+
</a>
|
|
90
|
+
</td>
|
|
91
|
+
</tr>
|
|
92
|
+
</table>
|
|
93
|
+
|
|
94
|
+
## Packages
|
|
95
|
+
|
|
96
|
+
| Package | Purpose |
|
|
97
|
+
|---------|---------|
|
|
98
|
+
| `rai-check-core` | Audit engine, findings, reports, history, CI gates |
|
|
99
|
+
| `rai-check-ml` | Tabular ML - fairness, drift, data quality, robustness |
|
|
100
|
+
| `rai-check-dl` | Image, medical imaging, and scientific AI audits |
|
|
101
|
+
| `rai-check-genai` | LLM, RAG, and agentic AI safety, security, and trace audits |
|
|
102
|
+
| `rai-check-kit` | Meta-package - installs core + ml, unified CLI |
|
|
103
|
+
|
|
104
|
+
## Install
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
pip install rai-check-kit # core + tabular ML
|
|
108
|
+
pip install "rai-check-kit[all]" # all modules (dl + genai)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Quick start
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
rai-check ml run --help
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
For repeatable audit workflows, generate and run a YAML configuration:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
rai-check init --project loan-model
|
|
121
|
+
rai-check run --config audit.yaml
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`rai-check init` writes a starter `predictions.csv` beside `audit.yaml`; replace
|
|
125
|
+
it with captured model predictions, or update `audit.data` to point at your CSV.
|
|
126
|
+
Classification configs expect `y_true` and `y_pred` columns by default.
|
|
127
|
+
|
|
128
|
+
Configured runs write report artifacts and an evidence manifest with input,
|
|
129
|
+
environment, source-revision, and artifact hashes.
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from rai_audit.ml import ClassificationAudit
|
|
133
|
+
|
|
134
|
+
report = ClassificationAudit(
|
|
135
|
+
y_true=y_true,
|
|
136
|
+
y_pred=y_pred,
|
|
137
|
+
sensitive_features=sensitive_df,
|
|
138
|
+
).run()
|
|
139
|
+
|
|
140
|
+
report.to_html("audit_report.html")
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Examples
|
|
144
|
+
|
|
145
|
+
- [Fairness audit walkthrough](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-ml/examples/ml_fairness_audit/example.py)
|
|
146
|
+
- [Batch drift monitoring](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-ml/examples/ml_drift_monitoring/batch_monitor.py)
|
|
147
|
+
- [MLflow and Airflow templates](https://github.com/SaiTeja-Erukude/rai-check/tree/main/packages/rai-check-ml/examples/mlops_integrations/)
|
|
148
|
+
- [Captured-response LLM and RAG audit suite](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-genai/examples/llm_audit_suite.yml)
|
|
149
|
+
- [Scientific image robustness audit](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-dl/examples/scientific_ai/microscopy_audit.py)
|
|
150
|
+
- [Agent trace with a webpage prompt-injection attempt](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-genai/examples/customer_support_trace.json)
|
|
151
|
+
|
|
152
|
+
## Development
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
pip install uv
|
|
156
|
+
uv sync
|
|
157
|
+
uv run pytest
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
See [CONTRIBUTING.md](https://github.com/SaiTeja-Erukude/rai-check/blob/main/CONTRIBUTING.md)
|
|
161
|
+
for monorepo layout and release workflow.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# RAI Check Kit
|
|
2
|
+
|
|
3
|
+
**RAI** = **Responsible AI**. A Python package suite for evidence-grade audits of
|
|
4
|
+
responsible, secure, and trustworthy AI systems.
|
|
5
|
+
|
|
6
|
+
Run fairness, data quality, robustness, compliance, image, medical imaging, LLM
|
|
7
|
+
safety, RAG security, and agent trace checks. Export HTML, Markdown, or JSON
|
|
8
|
+
reports and gate CI pipelines on risk thresholds.
|
|
9
|
+
|
|
10
|
+
**Author:** Sai Teja Erukude | **License:** MIT
|
|
11
|
+
|
|
12
|
+
## Why this exists
|
|
13
|
+
|
|
14
|
+
AI teams often run fairness, robustness, RAG, and agent security checks separately.
|
|
15
|
+
RAI Check Kit brings them into one evidence and reporting workflow, so teams can
|
|
16
|
+
review findings consistently, preserve audit artifacts, and apply the same CI gates
|
|
17
|
+
across model types.
|
|
18
|
+
|
|
19
|
+
## What it looks like
|
|
20
|
+
|
|
21
|
+
<table>
|
|
22
|
+
<tr>
|
|
23
|
+
<td><strong>HTML audit report</strong><br>
|
|
24
|
+
<a href="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/html-report.png">
|
|
25
|
+
<img src="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/html-report.png" alt="HTML fairness audit report" width="560">
|
|
26
|
+
</a>
|
|
27
|
+
</td>
|
|
28
|
+
<td><strong>Model card export</strong><br>
|
|
29
|
+
<a href="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/model-card.png">
|
|
30
|
+
<img src="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/model-card.png" alt="Markdown model card preview" width="560">
|
|
31
|
+
</a>
|
|
32
|
+
</td>
|
|
33
|
+
</tr>
|
|
34
|
+
<tr>
|
|
35
|
+
<td><strong>LLM and RAG audit output</strong><br>
|
|
36
|
+
<a href="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/rag-check.png">
|
|
37
|
+
<img src="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/rag-check.png" alt="RAG security audit output" width="560">
|
|
38
|
+
</a>
|
|
39
|
+
</td>
|
|
40
|
+
<td><strong>Agent trace finding</strong><br>
|
|
41
|
+
<a href="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/agent-trace-finding.png">
|
|
42
|
+
<img src="https://raw.githubusercontent.com/SaiTeja-Erukude/rai-check/main/docs/images/agent-trace-finding.png" alt="Agent trace prompt injection finding" width="560">
|
|
43
|
+
</a>
|
|
44
|
+
</td>
|
|
45
|
+
</tr>
|
|
46
|
+
</table>
|
|
47
|
+
|
|
48
|
+
## Packages
|
|
49
|
+
|
|
50
|
+
| Package | Purpose |
|
|
51
|
+
|---------|---------|
|
|
52
|
+
| `rai-check-core` | Audit engine, findings, reports, history, CI gates |
|
|
53
|
+
| `rai-check-ml` | Tabular ML - fairness, drift, data quality, robustness |
|
|
54
|
+
| `rai-check-dl` | Image, medical imaging, and scientific AI audits |
|
|
55
|
+
| `rai-check-genai` | LLM, RAG, and agentic AI safety, security, and trace audits |
|
|
56
|
+
| `rai-check-kit` | Meta-package - installs core + ml, unified CLI |
|
|
57
|
+
|
|
58
|
+
## Install
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install rai-check-kit # core + tabular ML
|
|
62
|
+
pip install "rai-check-kit[all]" # all modules (dl + genai)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Quick start
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
rai-check ml run --help
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
For repeatable audit workflows, generate and run a YAML configuration:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
rai-check init --project loan-model
|
|
75
|
+
rai-check run --config audit.yaml
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`rai-check init` writes a starter `predictions.csv` beside `audit.yaml`; replace
|
|
79
|
+
it with captured model predictions, or update `audit.data` to point at your CSV.
|
|
80
|
+
Classification configs expect `y_true` and `y_pred` columns by default.
|
|
81
|
+
|
|
82
|
+
Configured runs write report artifacts and an evidence manifest with input,
|
|
83
|
+
environment, source-revision, and artifact hashes.
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
from rai_audit.ml import ClassificationAudit
|
|
87
|
+
|
|
88
|
+
report = ClassificationAudit(
|
|
89
|
+
y_true=y_true,
|
|
90
|
+
y_pred=y_pred,
|
|
91
|
+
sensitive_features=sensitive_df,
|
|
92
|
+
).run()
|
|
93
|
+
|
|
94
|
+
report.to_html("audit_report.html")
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Examples
|
|
98
|
+
|
|
99
|
+
- [Fairness audit walkthrough](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-ml/examples/ml_fairness_audit/example.py)
|
|
100
|
+
- [Batch drift monitoring](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-ml/examples/ml_drift_monitoring/batch_monitor.py)
|
|
101
|
+
- [MLflow and Airflow templates](https://github.com/SaiTeja-Erukude/rai-check/tree/main/packages/rai-check-ml/examples/mlops_integrations/)
|
|
102
|
+
- [Captured-response LLM and RAG audit suite](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-genai/examples/llm_audit_suite.yml)
|
|
103
|
+
- [Scientific image robustness audit](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-dl/examples/scientific_ai/microscopy_audit.py)
|
|
104
|
+
- [Agent trace with a webpage prompt-injection attempt](https://github.com/SaiTeja-Erukude/rai-check/blob/main/packages/rai-check-genai/examples/customer_support_trace.json)
|
|
105
|
+
|
|
106
|
+
## Development
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pip install uv
|
|
110
|
+
uv sync
|
|
111
|
+
uv run pytest
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
See [CONTRIBUTING.md](https://github.com/SaiTeja-Erukude/rai-check/blob/main/CONTRIBUTING.md)
|
|
115
|
+
for monorepo layout and release workflow.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "rai-check-kit"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "Responsible AI (RAI) Check Kit - security, reliability, and trustworthy AI system checks"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
authors = [{ name = "Sai Teja Erukude" }]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
keywords = ["responsible-ai", "fairness", "robustness", "security", "trustworthy-ai", "audit"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"rai-check-core>=0.0.1",
|
|
24
|
+
"rai-check-ml>=0.0.1",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
dl = ["rai-check-dl>=0.0.1"]
|
|
29
|
+
genai = ["rai-check-genai>=0.0.1"]
|
|
30
|
+
all = [
|
|
31
|
+
"rai-check-dl>=0.0.1",
|
|
32
|
+
"rai-check-genai>=0.0.1",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.scripts]
|
|
36
|
+
rai-check = "rai_audit.kit.cli:app"
|
|
37
|
+
|
|
38
|
+
[tool.uv.sources]
|
|
39
|
+
rai-check-core = { workspace = true }
|
|
40
|
+
rai-check-ml = { workspace = true }
|
|
41
|
+
rai-check-dl = { workspace = true }
|
|
42
|
+
rai-check-genai = { workspace = true }
|
|
43
|
+
|
|
44
|
+
[tool.hatch.build.targets.wheel]
|
|
45
|
+
packages = ["src/rai_audit"]
|
|
46
|
+
|
|
47
|
+
[tool.hatch.build.targets.wheel.sources]
|
|
48
|
+
"src" = ""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.1"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Unified CLI entry point for rai-check-kit.
|
|
3
|
+
|
|
4
|
+
Assembles the core commands and all available module subcommands
|
|
5
|
+
by loading registered plugins via entry points.
|
|
6
|
+
"""
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import importlib.metadata
|
|
10
|
+
|
|
11
|
+
import typer
|
|
12
|
+
|
|
13
|
+
from rai_audit.core.cli import app as core_app
|
|
14
|
+
from rai_audit.core.cli import export_app
|
|
15
|
+
|
|
16
|
+
app = typer.Typer(
|
|
17
|
+
name="rai-check",
|
|
18
|
+
help="Responsible AI (RAI) Check Kit - security, reliability, and trustworthy AI checks.",
|
|
19
|
+
no_args_is_help=True,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# Mount core commands directly on the kit app
|
|
23
|
+
for command in core_app.registered_commands:
|
|
24
|
+
app.registered_commands.append(command)
|
|
25
|
+
|
|
26
|
+
# Mount export sub-app
|
|
27
|
+
app.add_typer(export_app, name="export")
|
|
28
|
+
|
|
29
|
+
# Discover and mount plugin subcommands registered via entry points
|
|
30
|
+
def _load_plugins() -> None:
|
|
31
|
+
try:
|
|
32
|
+
eps = importlib.metadata.entry_points(group="rai_audit.plugins")
|
|
33
|
+
except Exception:
|
|
34
|
+
return
|
|
35
|
+
for ep in eps:
|
|
36
|
+
try:
|
|
37
|
+
register_fn = ep.load()
|
|
38
|
+
register_fn(app)
|
|
39
|
+
except Exception as exc:
|
|
40
|
+
typer.echo(f"[warning] Could not load plugin '{ep.name}': {exc}", err=True)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
_load_plugins()
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Smoke tests for rai-check-kit unified CLI."""
|
|
2
|
+
from typer.testing import CliRunner
|
|
3
|
+
|
|
4
|
+
from rai_audit.kit.cli import app
|
|
5
|
+
|
|
6
|
+
_runner = CliRunner()
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_kit_help():
|
|
10
|
+
result = _runner.invoke(app, ["--help"])
|
|
11
|
+
assert result.exit_code == 0
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def test_core_commands_present():
|
|
15
|
+
result = _runner.invoke(app, ["--help"])
|
|
16
|
+
assert result.exit_code == 0
|
|
17
|
+
assert "init" in result.output or "report" in result.output
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_export_subcommand_present():
|
|
21
|
+
result = _runner.invoke(app, ["export", "--help"])
|
|
22
|
+
assert result.exit_code == 0
|
|
23
|
+
assert "model-card" in result.output
|