aicert 0.1.0__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.
Files changed (35) hide show
  1. aicert-0.1.0/LICENSE +21 -0
  2. aicert-0.1.0/PKG-INFO +306 -0
  3. aicert-0.1.0/README.md +275 -0
  4. aicert-0.1.0/pyproject.toml +61 -0
  5. aicert-0.1.0/setup.cfg +4 -0
  6. aicert-0.1.0/src/aicert/__init__.py +3 -0
  7. aicert-0.1.0/src/aicert/__main__.py +6 -0
  8. aicert-0.1.0/src/aicert/artifacts.py +104 -0
  9. aicert-0.1.0/src/aicert/cli.py +1423 -0
  10. aicert-0.1.0/src/aicert/config.py +193 -0
  11. aicert-0.1.0/src/aicert/doctor.py +366 -0
  12. aicert-0.1.0/src/aicert/hashing.py +28 -0
  13. aicert-0.1.0/src/aicert/metrics.py +305 -0
  14. aicert-0.1.0/src/aicert/providers/__init__.py +13 -0
  15. aicert-0.1.0/src/aicert/providers/anthropic.py +182 -0
  16. aicert-0.1.0/src/aicert/providers/base.py +36 -0
  17. aicert-0.1.0/src/aicert/providers/openai.py +153 -0
  18. aicert-0.1.0/src/aicert/providers/openai_compatible.py +152 -0
  19. aicert-0.1.0/src/aicert/runner.py +620 -0
  20. aicert-0.1.0/src/aicert/templating.py +83 -0
  21. aicert-0.1.0/src/aicert/validation.py +322 -0
  22. aicert-0.1.0/src/aicert.egg-info/PKG-INFO +306 -0
  23. aicert-0.1.0/src/aicert.egg-info/SOURCES.txt +33 -0
  24. aicert-0.1.0/src/aicert.egg-info/dependency_links.txt +1 -0
  25. aicert-0.1.0/src/aicert.egg-info/entry_points.txt +2 -0
  26. aicert-0.1.0/src/aicert.egg-info/requires.txt +13 -0
  27. aicert-0.1.0/src/aicert.egg-info/top_level.txt +1 -0
  28. aicert-0.1.0/tests/test_cli.py +710 -0
  29. aicert-0.1.0/tests/test_config.py +317 -0
  30. aicert-0.1.0/tests/test_doctor.py +375 -0
  31. aicert-0.1.0/tests/test_hashing.py +92 -0
  32. aicert-0.1.0/tests/test_metrics.py +431 -0
  33. aicert-0.1.0/tests/test_runner.py +941 -0
  34. aicert-0.1.0/tests/test_templating.py +30 -0
  35. aicert-0.1.0/tests/test_validation.py +280 -0
aicert-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Quinto
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.
aicert-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,306 @@
1
+ Metadata-Version: 2.4
2
+ Name: aicert
3
+ Version: 0.1.0
4
+ Summary: CI for LLM JSON outputs - Validate, test, and measure LLM outputs
5
+ Author: aicert contributors
6
+ License: MIT
7
+ Keywords: llm,cli,validation,testing,json
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Requires-Python: >=3.11
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: typer>=0.21.0
19
+ Requires-Dist: pydantic>=2.5.0
20
+ Requires-Dist: pyyaml>=6.0.1
21
+ Requires-Dist: jsonschema>=4.20.0
22
+ Requires-Dist: httpx>=0.25.0
23
+ Requires-Dist: rich>=14.0.0
24
+ Requires-Dist: cryptography>=41.0.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
27
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
28
+ Requires-Dist: black>=23.0.0; extra == "dev"
29
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ # aicert
33
+
34
+ **Reliability tooling for structured LLM outputs.**
35
+
36
+ Measure, validate, and enforce JSON stability in CI.
37
+
38
+ ---
39
+
40
+ ## Why aicert?
41
+
42
+ LLMs are probabilistic systems.
43
+
44
+ If your application depends on structured JSON generated by an LLM, that output becomes an implicit contract within your system. Model updates, prompt changes, or configuration tweaks can cause that contract to drift — often without immediate visibility.
45
+
46
+ Traditional tests typically validate a single run. They do not measure variability across repeated executions.
47
+
48
+ Aicert treats LLM output like any other production dependency:
49
+
50
+ * Validate against a JSON Schema
51
+ * Measure stability across repeated runs
52
+ * Track latency and variability
53
+ * Enforce reliability thresholds in CI
54
+
55
+ Instead of assuming structured outputs remain stable, you can verify that they do.
56
+
57
+ ---
58
+
59
+ ## What It Enables
60
+
61
+ Aicert helps you:
62
+
63
+ * Detect schema breakage before deployment
64
+ * Quantify output variability across runs
65
+ * Catch regressions caused by model or prompt changes
66
+ * Enforce reliability standards automatically in CI
67
+ * Treat prompts and structured outputs as testable infrastructure
68
+
69
+ It converts non-deterministic behavior into measurable signals.
70
+
71
+ ---
72
+
73
+ ## Who It’s For
74
+
75
+ Aicert is designed for teams shipping structured LLM outputs into production systems:
76
+
77
+ * Backend APIs powered by LLMs
78
+ * Extraction and classification pipelines
79
+ * Decision-support systems
80
+ * Any workflow where JSON output drives downstream logic
81
+
82
+ If structured LLM output is part of your system contract, Aicert provides guardrails.
83
+
84
+ ---
85
+
86
+ ## Installation
87
+
88
+ ```bash
89
+ pip install aicert
90
+ ```
91
+
92
+ For development:
93
+
94
+ ```bash
95
+ pip install -e .
96
+ ```
97
+
98
+ ---
99
+
100
+ ## What It Measures
101
+
102
+ * **Compliance** — % of outputs matching JSON Schema
103
+ * **Stability** — % of identical outputs across repeated runs
104
+ * **Latency** — P50 / P95 response times
105
+ * **Similarity** — Structural or semantic similarity
106
+ * **CI Gating** — Threshold-based pass/fail enforcement
107
+
108
+ ---
109
+
110
+ ## Basic Workflow
111
+
112
+ ### 1. Create `aicert.yaml`
113
+
114
+ ```yaml
115
+ project: my-project
116
+
117
+ providers:
118
+ - id: openai-gpt4
119
+ provider: openai
120
+ model: gpt-4
121
+ temperature: 0.1
122
+
123
+ prompt_file: prompt.txt
124
+ cases_file: cases.jsonl
125
+ schema_file: schema.json
126
+
127
+ runs: 50
128
+ concurrency: 10
129
+ timeout_s: 30
130
+
131
+ validation:
132
+ extract_json: true
133
+ allow_extra_keys: false
134
+
135
+ thresholds:
136
+ min_stability: 85
137
+ min_compliance: 95
138
+ p95_latency_ms: 5000
139
+
140
+ ci:
141
+ runs: 10
142
+ save_on_fail: true
143
+ ```
144
+
145
+ ---
146
+
147
+ ### 2. Run Stability Tests
148
+
149
+ ```bash
150
+ aicert stability aicert.yaml
151
+ ```
152
+
153
+ ---
154
+
155
+ ### 3. Enforce in CI
156
+
157
+ ```bash
158
+ aicert ci aicert.yaml
159
+ ```
160
+
161
+ Non-zero exit codes indicate threshold failures.
162
+
163
+ ---
164
+
165
+ ## Commands
166
+
167
+ ```bash
168
+ aicert init
169
+ aicert doctor aicert.yaml
170
+ aicert run aicert.yaml
171
+ aicert stability aicert.yaml
172
+ aicert compare aicert.yaml
173
+ aicert ci aicert.yaml
174
+ aicert diff <run_a> <run_b>
175
+ aicert report <run_dir>
176
+ ```
177
+
178
+ ---
179
+
180
+ # Aicert Pro
181
+
182
+ Aicert Pro turns measurement into enforcement.
183
+
184
+ The core package tells you how your LLM behaves.
185
+ Pro defines what behavior is acceptable — and blocks regressions automatically.
186
+
187
+ When structured outputs drive production systems, “informational metrics” are not enough.
188
+ You need a reliability boundary.
189
+
190
+ Aicert Pro adds:
191
+
192
+ * Baseline locking — capture a known-good state
193
+ * Regression enforcement — fail CI when stability or compliance degrades
194
+ * Schema and prompt drift detection — detect structural changes immediately
195
+ * Cost regression limits — prevent silent cost creep
196
+ * Policy-backed CI gating — enforce standards across commits
197
+
198
+ Pro is designed for teams that treat LLM output as production infrastructure.
199
+
200
+ ---
201
+
202
+ ## What Changes With Pro?
203
+
204
+ Without Pro:
205
+
206
+ You measure stability.
207
+ You review results manually.
208
+ Regressions can slip through if thresholds are ignored.
209
+
210
+ With Pro:
211
+
212
+ Known-good behavior is locked.
213
+ Deviations are compared automatically.
214
+ CI fails when output contracts drift.
215
+ Reliability becomes enforceable policy.
216
+ Pro moves you from observation to control.
217
+
218
+ ## Installing Aicert Pro
219
+
220
+ After purchasing a subscription:
221
+
222
+ ```bash
223
+ pip install aicert-pro
224
+ ```
225
+
226
+ Set your license key:
227
+
228
+ ```bash
229
+ export AICERT_LICENSE="your_signed_license_key"
230
+ ```
231
+
232
+ Verify:
233
+
234
+ ```bash
235
+ aicert-pro license verify
236
+ ```
237
+
238
+ Use baseline enforcement:
239
+
240
+ ```bash
241
+ aicert-pro baseline save aicert.yaml
242
+ aicert-pro baseline check aicert.yaml
243
+ ```
244
+
245
+ ---
246
+
247
+ ## Licensing
248
+
249
+ Aicert Pro uses signed offline license keys.
250
+
251
+ * No SaaS dependency
252
+ * No account login
253
+ * CI-friendly
254
+ * Time-limited per subscription
255
+
256
+ ---
257
+
258
+ ## Pricing
259
+
260
+ * **$29 / month**
261
+ * **$290 / year (2 months free)**
262
+
263
+ Purchase:
264
+ [https://mfifth.github.io/aicert/](https://mfifth.github.io/aicert/)
265
+
266
+ Questions:
267
+ [mfifth@gmail.com](mailto:mfifth@gmail.com)
268
+
269
+ ---
270
+
271
+ ## GitHub Actions Example
272
+
273
+ ```yaml
274
+ - run: pip install aicert
275
+ - run: aicert ci aicert.yaml
276
+ env:
277
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
278
+ ```
279
+
280
+ Pro enforcement in CI:
281
+
282
+ ```yaml
283
+ - run: pip install aicert-pro
284
+ - run: aicert-pro baseline check aicert.yaml
285
+ env:
286
+ AICERT_LICENSE: ${{ secrets.AICERT_LICENSE }}
287
+ ```
288
+
289
+ ---
290
+
291
+ ## Exit Codes
292
+
293
+ | Code | Meaning |
294
+ | ---- | ------------------------ |
295
+ | 0 | Success |
296
+ | 2 | Threshold failure |
297
+ | 3 | Config/schema error |
298
+ | 4 | Provider/auth error |
299
+ | 5 | License error (Pro only) |
300
+
301
+ ---
302
+
303
+ ## License
304
+
305
+ Core package (`aicert`) is MIT licensed.
306
+ Aicert Pro is commercial software.
aicert-0.1.0/README.md ADDED
@@ -0,0 +1,275 @@
1
+ # aicert
2
+
3
+ **Reliability tooling for structured LLM outputs.**
4
+
5
+ Measure, validate, and enforce JSON stability in CI.
6
+
7
+ ---
8
+
9
+ ## Why aicert?
10
+
11
+ LLMs are probabilistic systems.
12
+
13
+ If your application depends on structured JSON generated by an LLM, that output becomes an implicit contract within your system. Model updates, prompt changes, or configuration tweaks can cause that contract to drift — often without immediate visibility.
14
+
15
+ Traditional tests typically validate a single run. They do not measure variability across repeated executions.
16
+
17
+ Aicert treats LLM output like any other production dependency:
18
+
19
+ * Validate against a JSON Schema
20
+ * Measure stability across repeated runs
21
+ * Track latency and variability
22
+ * Enforce reliability thresholds in CI
23
+
24
+ Instead of assuming structured outputs remain stable, you can verify that they do.
25
+
26
+ ---
27
+
28
+ ## What It Enables
29
+
30
+ Aicert helps you:
31
+
32
+ * Detect schema breakage before deployment
33
+ * Quantify output variability across runs
34
+ * Catch regressions caused by model or prompt changes
35
+ * Enforce reliability standards automatically in CI
36
+ * Treat prompts and structured outputs as testable infrastructure
37
+
38
+ It converts non-deterministic behavior into measurable signals.
39
+
40
+ ---
41
+
42
+ ## Who It’s For
43
+
44
+ Aicert is designed for teams shipping structured LLM outputs into production systems:
45
+
46
+ * Backend APIs powered by LLMs
47
+ * Extraction and classification pipelines
48
+ * Decision-support systems
49
+ * Any workflow where JSON output drives downstream logic
50
+
51
+ If structured LLM output is part of your system contract, Aicert provides guardrails.
52
+
53
+ ---
54
+
55
+ ## Installation
56
+
57
+ ```bash
58
+ pip install aicert
59
+ ```
60
+
61
+ For development:
62
+
63
+ ```bash
64
+ pip install -e .
65
+ ```
66
+
67
+ ---
68
+
69
+ ## What It Measures
70
+
71
+ * **Compliance** — % of outputs matching JSON Schema
72
+ * **Stability** — % of identical outputs across repeated runs
73
+ * **Latency** — P50 / P95 response times
74
+ * **Similarity** — Structural or semantic similarity
75
+ * **CI Gating** — Threshold-based pass/fail enforcement
76
+
77
+ ---
78
+
79
+ ## Basic Workflow
80
+
81
+ ### 1. Create `aicert.yaml`
82
+
83
+ ```yaml
84
+ project: my-project
85
+
86
+ providers:
87
+ - id: openai-gpt4
88
+ provider: openai
89
+ model: gpt-4
90
+ temperature: 0.1
91
+
92
+ prompt_file: prompt.txt
93
+ cases_file: cases.jsonl
94
+ schema_file: schema.json
95
+
96
+ runs: 50
97
+ concurrency: 10
98
+ timeout_s: 30
99
+
100
+ validation:
101
+ extract_json: true
102
+ allow_extra_keys: false
103
+
104
+ thresholds:
105
+ min_stability: 85
106
+ min_compliance: 95
107
+ p95_latency_ms: 5000
108
+
109
+ ci:
110
+ runs: 10
111
+ save_on_fail: true
112
+ ```
113
+
114
+ ---
115
+
116
+ ### 2. Run Stability Tests
117
+
118
+ ```bash
119
+ aicert stability aicert.yaml
120
+ ```
121
+
122
+ ---
123
+
124
+ ### 3. Enforce in CI
125
+
126
+ ```bash
127
+ aicert ci aicert.yaml
128
+ ```
129
+
130
+ Non-zero exit codes indicate threshold failures.
131
+
132
+ ---
133
+
134
+ ## Commands
135
+
136
+ ```bash
137
+ aicert init
138
+ aicert doctor aicert.yaml
139
+ aicert run aicert.yaml
140
+ aicert stability aicert.yaml
141
+ aicert compare aicert.yaml
142
+ aicert ci aicert.yaml
143
+ aicert diff <run_a> <run_b>
144
+ aicert report <run_dir>
145
+ ```
146
+
147
+ ---
148
+
149
+ # Aicert Pro
150
+
151
+ Aicert Pro turns measurement into enforcement.
152
+
153
+ The core package tells you how your LLM behaves.
154
+ Pro defines what behavior is acceptable — and blocks regressions automatically.
155
+
156
+ When structured outputs drive production systems, “informational metrics” are not enough.
157
+ You need a reliability boundary.
158
+
159
+ Aicert Pro adds:
160
+
161
+ * Baseline locking — capture a known-good state
162
+ * Regression enforcement — fail CI when stability or compliance degrades
163
+ * Schema and prompt drift detection — detect structural changes immediately
164
+ * Cost regression limits — prevent silent cost creep
165
+ * Policy-backed CI gating — enforce standards across commits
166
+
167
+ Pro is designed for teams that treat LLM output as production infrastructure.
168
+
169
+ ---
170
+
171
+ ## What Changes With Pro?
172
+
173
+ Without Pro:
174
+
175
+ You measure stability.
176
+ You review results manually.
177
+ Regressions can slip through if thresholds are ignored.
178
+
179
+ With Pro:
180
+
181
+ Known-good behavior is locked.
182
+ Deviations are compared automatically.
183
+ CI fails when output contracts drift.
184
+ Reliability becomes enforceable policy.
185
+ Pro moves you from observation to control.
186
+
187
+ ## Installing Aicert Pro
188
+
189
+ After purchasing a subscription:
190
+
191
+ ```bash
192
+ pip install aicert-pro
193
+ ```
194
+
195
+ Set your license key:
196
+
197
+ ```bash
198
+ export AICERT_LICENSE="your_signed_license_key"
199
+ ```
200
+
201
+ Verify:
202
+
203
+ ```bash
204
+ aicert-pro license verify
205
+ ```
206
+
207
+ Use baseline enforcement:
208
+
209
+ ```bash
210
+ aicert-pro baseline save aicert.yaml
211
+ aicert-pro baseline check aicert.yaml
212
+ ```
213
+
214
+ ---
215
+
216
+ ## Licensing
217
+
218
+ Aicert Pro uses signed offline license keys.
219
+
220
+ * No SaaS dependency
221
+ * No account login
222
+ * CI-friendly
223
+ * Time-limited per subscription
224
+
225
+ ---
226
+
227
+ ## Pricing
228
+
229
+ * **$29 / month**
230
+ * **$290 / year (2 months free)**
231
+
232
+ Purchase:
233
+ [https://mfifth.github.io/aicert/](https://mfifth.github.io/aicert/)
234
+
235
+ Questions:
236
+ [mfifth@gmail.com](mailto:mfifth@gmail.com)
237
+
238
+ ---
239
+
240
+ ## GitHub Actions Example
241
+
242
+ ```yaml
243
+ - run: pip install aicert
244
+ - run: aicert ci aicert.yaml
245
+ env:
246
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
247
+ ```
248
+
249
+ Pro enforcement in CI:
250
+
251
+ ```yaml
252
+ - run: pip install aicert-pro
253
+ - run: aicert-pro baseline check aicert.yaml
254
+ env:
255
+ AICERT_LICENSE: ${{ secrets.AICERT_LICENSE }}
256
+ ```
257
+
258
+ ---
259
+
260
+ ## Exit Codes
261
+
262
+ | Code | Meaning |
263
+ | ---- | ------------------------ |
264
+ | 0 | Success |
265
+ | 2 | Threshold failure |
266
+ | 3 | Config/schema error |
267
+ | 4 | Provider/auth error |
268
+ | 5 | License error (Pro only) |
269
+
270
+ ---
271
+
272
+ ## License
273
+
274
+ Core package (`aicert`) is MIT licensed.
275
+ Aicert Pro is commercial software.
@@ -0,0 +1,61 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "aicert"
7
+ version = "0.1.0"
8
+ description = "CI for LLM JSON outputs - Validate, test, and measure LLM outputs"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "aicert contributors"}
14
+ ]
15
+ keywords = ["llm", "cli", "validation", "testing", "json"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ ]
25
+
26
+ dependencies = [
27
+ "typer>=0.21.0",
28
+ "pydantic>=2.5.0",
29
+ "pyyaml>=6.0.1",
30
+ "jsonschema>=4.20.0",
31
+ "httpx>=0.25.0",
32
+ "rich>=14.0.0",
33
+ "cryptography>=41.0.0",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=7.4.0",
39
+ "pytest-asyncio>=0.21.0",
40
+ "black>=23.0.0",
41
+ "ruff>=0.1.0",
42
+ ]
43
+
44
+ [project.scripts]
45
+ aicert = "aicert.cli:app"
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+
50
+ [tool.pytest.ini_options]
51
+ testpaths = ["tests"]
52
+ python_files = ["test_*.py"]
53
+ python_functions = ["test_*"]
54
+
55
+ [tool.black]
56
+ line-length = 100
57
+ target-version = ["py311"]
58
+
59
+ [tool.ruff]
60
+ line-length = 100
61
+ target-version = "py311"
aicert-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """aicert - CI for LLM JSON outputs."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,6 @@
1
+ """Entry point for running aicert as a module."""
2
+
3
+ from aicert.cli import app
4
+
5
+ if __name__ == "__main__":
6
+ app()