evaltrack 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.
- evaltrack-0.1.0/.gitignore +34 -0
- evaltrack-0.1.0/CHANGELOG.md +15 -0
- evaltrack-0.1.0/CONTRIBUTING.md +60 -0
- evaltrack-0.1.0/LICENSE +21 -0
- evaltrack-0.1.0/PKG-INFO +281 -0
- evaltrack-0.1.0/README.md +236 -0
- evaltrack-0.1.0/SECURITY.md +60 -0
- evaltrack-0.1.0/docs/ci-cd.md +147 -0
- evaltrack-0.1.0/docs/cli.md +88 -0
- evaltrack-0.1.0/docs/configuration.md +113 -0
- evaltrack-0.1.0/docs/eval-runners.md +113 -0
- evaltrack-0.1.0/docs/eval-shape.md +36 -0
- evaltrack-0.1.0/docs/flakiness.md +129 -0
- evaltrack-0.1.0/docs/marker.md +78 -0
- evaltrack-0.1.0/docs/repositories.md +169 -0
- evaltrack-0.1.0/docs/translators.md +56 -0
- evaltrack-0.1.0/evaltrack/__init__.py +65 -0
- evaltrack-0.1.0/evaltrack/cli.py +606 -0
- evaltrack-0.1.0/evaltrack/config.py +185 -0
- evaltrack-0.1.0/evaltrack/context.py +112 -0
- evaltrack-0.1.0/evaltrack/core/__init__.py +26 -0
- evaltrack-0.1.0/evaltrack/core/errors.py +59 -0
- evaltrack-0.1.0/evaltrack/core/eval_round.py +123 -0
- evaltrack-0.1.0/evaltrack/core/gate.py +77 -0
- evaltrack-0.1.0/evaltrack/core/projection.py +124 -0
- evaltrack-0.1.0/evaltrack/core/recorder.py +176 -0
- evaltrack-0.1.0/evaltrack/core/refs.py +82 -0
- evaltrack-0.1.0/evaltrack/core/repetition.py +152 -0
- evaltrack-0.1.0/evaltrack/core/results.py +167 -0
- evaltrack-0.1.0/evaltrack/core/run_context.py +12 -0
- evaltrack-0.1.0/evaltrack/core/run_record.py +319 -0
- evaltrack-0.1.0/evaltrack/core/score_bars.py +70 -0
- evaltrack-0.1.0/evaltrack/core/user_values.py +162 -0
- evaltrack-0.1.0/evaltrack/failure.py +110 -0
- evaltrack-0.1.0/evaltrack/history/__init__.py +4 -0
- evaltrack-0.1.0/evaltrack/history/reliability.py +180 -0
- evaltrack-0.1.0/evaltrack/history/score_history.py +175 -0
- evaltrack-0.1.0/evaltrack/history/segments.py +106 -0
- evaltrack-0.1.0/evaltrack/marked_test.py +352 -0
- evaltrack-0.1.0/evaltrack/py.typed +0 -0
- evaltrack-0.1.0/evaltrack/pytest_plugin.py +521 -0
- evaltrack-0.1.0/evaltrack/repositories/__init__.py +68 -0
- evaltrack-0.1.0/evaltrack/repositories/azure.py +179 -0
- evaltrack-0.1.0/evaltrack/repositories/file.py +153 -0
- evaltrack-0.1.0/evaltrack/repositories/lifecycle.py +147 -0
- evaltrack-0.1.0/evaltrack/repositories/repository.py +438 -0
- evaltrack-0.1.0/evaltrack/repositories/store.py +56 -0
- evaltrack-0.1.0/evaltrack/translators/__init__.py +120 -0
- evaltrack-0.1.0/evaltrack/translators/deepeval.py +260 -0
- evaltrack-0.1.0/evaltrack/translators/protocol.py +13 -0
- evaltrack-0.1.0/evaltrack/translators/pydantic_evals.py +195 -0
- evaltrack-0.1.0/evaltrack/ui/__init__.py +7 -0
- evaltrack-0.1.0/evaltrack/ui/app.py +173 -0
- evaltrack-0.1.0/evaltrack/ui/models.py +77 -0
- evaltrack-0.1.0/evaltrack/ui/routes/__init__.py +6 -0
- evaltrack-0.1.0/evaltrack/ui/routes/history.py +119 -0
- evaltrack-0.1.0/evaltrack/ui/routes/meta.py +29 -0
- evaltrack-0.1.0/evaltrack/ui/routes/refs.py +114 -0
- evaltrack-0.1.0/evaltrack/ui/routes/runs.py +116 -0
- evaltrack-0.1.0/evaltrack/ui/routes/static.py +37 -0
- evaltrack-0.1.0/evaltrack/ui/security.py +41 -0
- evaltrack-0.1.0/evaltrack/ui/static/assets/index-BZO2JqWB.css +1 -0
- evaltrack-0.1.0/evaltrack/ui/static/assets/index-Cg522kcf.js +56 -0
- evaltrack-0.1.0/evaltrack/ui/static/favicon.svg +9 -0
- evaltrack-0.1.0/evaltrack/ui/static/index.html +14 -0
- evaltrack-0.1.0/examples/README.md +87 -0
- evaltrack-0.1.0/examples/test_01_function.py +83 -0
- evaltrack-0.1.0/examples/test_02_scores.py +126 -0
- evaltrack-0.1.0/examples/test_03_reliability.py +75 -0
- evaltrack-0.1.0/examples/test_04_agent_tool_use.py +162 -0
- evaltrack-0.1.0/examples/test_05_llm_judge.py +189 -0
- evaltrack-0.1.0/examples/test_06_fake_tool_in_inputs.py +232 -0
- evaltrack-0.1.0/examples/test_07_other_eval_runner.py +165 -0
- evaltrack-0.1.0/examples/test_08_deepeval.py +173 -0
- evaltrack-0.1.0/examples/test_09_deepeval_repeats.py +112 -0
- evaltrack-0.1.0/examples/test_10_deepeval_traced.py +200 -0
- evaltrack-0.1.0/frontend/.gitignore +4 -0
- evaltrack-0.1.0/frontend/README.md +43 -0
- evaltrack-0.1.0/frontend/eslint.config.js +23 -0
- evaltrack-0.1.0/frontend/index.html +13 -0
- evaltrack-0.1.0/frontend/package-lock.json +3500 -0
- evaltrack-0.1.0/frontend/package.json +33 -0
- evaltrack-0.1.0/frontend/public/favicon.svg +9 -0
- evaltrack-0.1.0/frontend/src/App.tsx +1115 -0
- evaltrack-0.1.0/frontend/src/api.ts +147 -0
- evaltrack-0.1.0/frontend/src/attemptCounts.test.ts +54 -0
- evaltrack-0.1.0/frontend/src/attemptCounts.ts +44 -0
- evaltrack-0.1.0/frontend/src/attemptErrors.test.ts +33 -0
- evaltrack-0.1.0/frontend/src/attemptErrors.ts +20 -0
- evaltrack-0.1.0/frontend/src/baseline.test.ts +95 -0
- evaltrack-0.1.0/frontend/src/baseline.ts +34 -0
- evaltrack-0.1.0/frontend/src/binaryEnvelope.test.ts +106 -0
- evaltrack-0.1.0/frontend/src/binaryEnvelope.ts +41 -0
- evaltrack-0.1.0/frontend/src/caseFilter.test.ts +133 -0
- evaltrack-0.1.0/frontend/src/caseFilter.ts +44 -0
- evaltrack-0.1.0/frontend/src/caseSections.test.ts +181 -0
- evaltrack-0.1.0/frontend/src/caseSections.ts +120 -0
- evaltrack-0.1.0/frontend/src/checks.test.ts +121 -0
- evaltrack-0.1.0/frontend/src/checks.ts +95 -0
- evaltrack-0.1.0/frontend/src/clamp.test.ts +19 -0
- evaltrack-0.1.0/frontend/src/clamp.ts +7 -0
- evaltrack-0.1.0/frontend/src/components/ConfirmDialog.tsx +100 -0
- evaltrack-0.1.0/frontend/src/components/CopyButton.tsx +46 -0
- evaltrack-0.1.0/frontend/src/components/Drawer.tsx +801 -0
- evaltrack-0.1.0/frontend/src/components/EvaluatorList.tsx +153 -0
- evaltrack-0.1.0/frontend/src/components/JsonDiff.tsx +375 -0
- evaltrack-0.1.0/frontend/src/components/JsonView.test.ts +47 -0
- evaltrack-0.1.0/frontend/src/components/JsonView.tsx +205 -0
- evaltrack-0.1.0/frontend/src/components/OutcomeCard.test.ts +33 -0
- evaltrack-0.1.0/frontend/src/components/OutcomeCard.tsx +129 -0
- evaltrack-0.1.0/frontend/src/components/PrRef.tsx +36 -0
- evaltrack-0.1.0/frontend/src/components/RunDetail.test.ts +440 -0
- evaltrack-0.1.0/frontend/src/components/RunDetail.tsx +1865 -0
- evaltrack-0.1.0/frontend/src/components/RunDiff.test.ts +61 -0
- evaltrack-0.1.0/frontend/src/components/RunDiff.tsx +916 -0
- evaltrack-0.1.0/frontend/src/components/ScoreMeter.tsx +60 -0
- evaltrack-0.1.0/frontend/src/components/ScoreTrend.tsx +237 -0
- evaltrack-0.1.0/frontend/src/components/Sidebar.tsx +717 -0
- evaltrack-0.1.0/frontend/src/components/TableScroll.tsx +53 -0
- evaltrack-0.1.0/frontend/src/components/TextDiff.test.ts +44 -0
- evaltrack-0.1.0/frontend/src/components/TextDiff.tsx +91 -0
- evaltrack-0.1.0/frontend/src/components/ThemeToggle.test.ts +53 -0
- evaltrack-0.1.0/frontend/src/components/ThemeToggle.tsx +103 -0
- evaltrack-0.1.0/frontend/src/diff.test.ts +683 -0
- evaltrack-0.1.0/frontend/src/diff.ts +497 -0
- evaltrack-0.1.0/frontend/src/extract.test.ts +61 -0
- evaltrack-0.1.0/frontend/src/extract.ts +90 -0
- evaltrack-0.1.0/frontend/src/format.test.ts +162 -0
- evaltrack-0.1.0/frontend/src/format.ts +107 -0
- evaltrack-0.1.0/frontend/src/grouping.test.ts +99 -0
- evaltrack-0.1.0/frontend/src/grouping.ts +63 -0
- evaltrack-0.1.0/frontend/src/index.css +3227 -0
- evaltrack-0.1.0/frontend/src/load.test.ts +397 -0
- evaltrack-0.1.0/frontend/src/main.tsx +15 -0
- evaltrack-0.1.0/frontend/src/reliabilityNote.test.ts +108 -0
- evaltrack-0.1.0/frontend/src/reliabilityNote.ts +69 -0
- evaltrack-0.1.0/frontend/src/results.ts +40 -0
- evaltrack-0.1.0/frontend/src/runBody.test.ts +70 -0
- evaltrack-0.1.0/frontend/src/runOutcome.test.ts +40 -0
- evaltrack-0.1.0/frontend/src/runOutcome.ts +34 -0
- evaltrack-0.1.0/frontend/src/scoreTrend.test.ts +336 -0
- evaltrack-0.1.0/frontend/src/scoreTrend.ts +338 -0
- evaltrack-0.1.0/frontend/src/shortenUrl.test.ts +48 -0
- evaltrack-0.1.0/frontend/src/shortenUrl.ts +40 -0
- evaltrack-0.1.0/frontend/src/test-support.ts +156 -0
- evaltrack-0.1.0/frontend/src/types.ts +360 -0
- evaltrack-0.1.0/frontend/tsconfig.json +23 -0
- evaltrack-0.1.0/frontend/vite.config.ts +24 -0
- evaltrack-0.1.0/hatch_build.py +30 -0
- evaltrack-0.1.0/pyproject.toml +194 -0
- evaltrack-0.1.0/tests/__init__.py +1 -0
- evaltrack-0.1.0/tests/cli/__init__.py +0 -0
- evaltrack-0.1.0/tests/cli/helpers.py +150 -0
- evaltrack-0.1.0/tests/cli/test_export.py +100 -0
- evaltrack-0.1.0/tests/cli/test_listing.py +456 -0
- evaltrack-0.1.0/tests/cli/test_main.py +154 -0
- evaltrack-0.1.0/tests/cli/test_promote.py +185 -0
- evaltrack-0.1.0/tests/cli/test_push.py +628 -0
- evaltrack-0.1.0/tests/cli/test_ui_command.py +376 -0
- evaltrack-0.1.0/tests/conftest.py +81 -0
- evaltrack-0.1.0/tests/core/__init__.py +0 -0
- evaltrack-0.1.0/tests/core/test_errors.py +22 -0
- evaltrack-0.1.0/tests/core/test_eval_round.py +105 -0
- evaltrack-0.1.0/tests/core/test_recorder.py +646 -0
- evaltrack-0.1.0/tests/core/test_refs.py +140 -0
- evaltrack-0.1.0/tests/core/test_results.py +169 -0
- evaltrack-0.1.0/tests/core/test_run_record.py +910 -0
- evaltrack-0.1.0/tests/core/test_score_bars.py +228 -0
- evaltrack-0.1.0/tests/core/test_user_values.py +152 -0
- evaltrack-0.1.0/tests/factories.py +526 -0
- evaltrack-0.1.0/tests/fakes.py +80 -0
- evaltrack-0.1.0/tests/history/__init__.py +0 -0
- evaltrack-0.1.0/tests/history/test_reliability.py +547 -0
- evaltrack-0.1.0/tests/history/test_score_history.py +524 -0
- evaltrack-0.1.0/tests/marked_test/__init__.py +0 -0
- evaltrack-0.1.0/tests/marked_test/conftest.py +50 -0
- evaltrack-0.1.0/tests/marked_test/test_api.py +448 -0
- evaltrack-0.1.0/tests/marked_test/test_merge.py +155 -0
- evaltrack-0.1.0/tests/marked_test/test_run_loop.py +432 -0
- evaltrack-0.1.0/tests/plugin/__init__.py +0 -0
- evaltrack-0.1.0/tests/plugin/helpers.py +220 -0
- evaltrack-0.1.0/tests/plugin/test_async_plugins.py +164 -0
- evaltrack-0.1.0/tests/plugin/test_context.py +109 -0
- evaltrack-0.1.0/tests/plugin/test_gate_integration.py +157 -0
- evaltrack-0.1.0/tests/plugin/test_marker.py +541 -0
- evaltrack-0.1.0/tests/plugin/test_options.py +988 -0
- evaltrack-0.1.0/tests/plugin/test_outcomes.py +774 -0
- evaltrack-0.1.0/tests/plugin/test_reruns.py +480 -0
- evaltrack-0.1.0/tests/plugin/test_termination.py +118 -0
- evaltrack-0.1.0/tests/repositories/__init__.py +0 -0
- evaltrack-0.1.0/tests/repositories/conftest.py +37 -0
- evaltrack-0.1.0/tests/repositories/helpers.py +42 -0
- evaltrack-0.1.0/tests/repositories/test_azure_store.py +393 -0
- evaltrack-0.1.0/tests/repositories/test_file_store.py +232 -0
- evaltrack-0.1.0/tests/repositories/test_open_repository.py +52 -0
- evaltrack-0.1.0/tests/repositories/test_repository_refs.py +542 -0
- evaltrack-0.1.0/tests/repositories/test_repository_retention.py +439 -0
- evaltrack-0.1.0/tests/repositories/test_repository_runs.py +543 -0
- evaltrack-0.1.0/tests/repositories/test_store_contract.py +173 -0
- evaltrack-0.1.0/tests/test_config.py +278 -0
- evaltrack-0.1.0/tests/test_context.py +340 -0
- evaltrack-0.1.0/tests/test_failure.py +337 -0
- evaltrack-0.1.0/tests/test_public_api.py +111 -0
- evaltrack-0.1.0/tests/translators/__init__.py +0 -0
- evaltrack-0.1.0/tests/translators/contract.py +115 -0
- evaltrack-0.1.0/tests/translators/test_deepeval.py +567 -0
- evaltrack-0.1.0/tests/translators/test_pydantic_evals.py +400 -0
- evaltrack-0.1.0/tests/translators/test_registry.py +135 -0
- evaltrack-0.1.0/tests/ui/__init__.py +0 -0
- evaltrack-0.1.0/tests/ui/conftest.py +138 -0
- evaltrack-0.1.0/tests/ui/test_hardening.py +139 -0
- evaltrack-0.1.0/tests/ui/test_history.py +421 -0
- evaltrack-0.1.0/tests/ui/test_reads.py +517 -0
- evaltrack-0.1.0/tests/ui/test_static.py +100 -0
- evaltrack-0.1.0/tests/ui/test_writes.py +162 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
*.env
|
|
3
|
+
.env.*
|
|
4
|
+
.venv
|
|
5
|
+
logs/
|
|
6
|
+
*.log
|
|
7
|
+
|
|
8
|
+
# Byte-compiled / optimized / DLL files
|
|
9
|
+
__pycache__/
|
|
10
|
+
*.py[cod]
|
|
11
|
+
*$py.class
|
|
12
|
+
|
|
13
|
+
.DS_Store
|
|
14
|
+
.vscode/
|
|
15
|
+
.idea/
|
|
16
|
+
.envrc
|
|
17
|
+
.claude/
|
|
18
|
+
|
|
19
|
+
# ignore build stuff
|
|
20
|
+
dist/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# evaltrack local runs
|
|
25
|
+
.evaltrack/
|
|
26
|
+
|
|
27
|
+
# DeepEval writes its last run here, beside whatever evaltrack recorded
|
|
28
|
+
.deepeval/
|
|
29
|
+
|
|
30
|
+
# frontend prototype: source is checked in, build output and deps are not.
|
|
31
|
+
# No trailing slash: a `node_modules` symlink into a sandbox checkout is not a
|
|
32
|
+
# directory, so `node_modules/` does not match it and it lands in a commit.
|
|
33
|
+
node_modules
|
|
34
|
+
evaltrack/ui/static/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning].
|
|
6
|
+
|
|
7
|
+
[keep a changelog]: https://keepachangelog.com/en/1.1.0/
|
|
8
|
+
[semantic versioning]: https://semver.org/spec/v2.0.0.html
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-09-11
|
|
11
|
+
|
|
12
|
+
The first public release. evaltrack is a pytest plugin that records, gates and tracks LLM evals. See
|
|
13
|
+
the [README](README.md) to get started.
|
|
14
|
+
|
|
15
|
+
[0.1.0]: https://github.com/jesrav/evaltrack/releases/tag/v0.1.0
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Bug reports, feature ideas, and pull requests are welcome. For a large change, open an issue first.
|
|
4
|
+
|
|
5
|
+
## Development setup
|
|
6
|
+
|
|
7
|
+
Develop on Linux or macOS. Those are what evaltrack supports and what CI runs, and the suite does
|
|
8
|
+
not pass on Windows. Under WSL2 you are on Linux, so that works.
|
|
9
|
+
|
|
10
|
+
Install [uv](https://docs.astral.sh/uv/) and [just](https://github.com/casey/just). Then run:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
just install_dev # uv sync --all-groups --extra ui --extra azure + install pre-commit hooks
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
For the dashboard frontend (TypeScript/React):
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
just frontend_install
|
|
20
|
+
just frontend_dev # Vite dev server, proxies /api to a running `evaltrack ui` (default :8765)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
An editable install serves a fallback page at `evaltrack ui` until `just frontend_build` has run.
|
|
24
|
+
|
|
25
|
+
## Tests and linting
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
just test # run the test suite
|
|
29
|
+
just lint # ruff, basedpyright (strict), bandit, prettier (via pre-commit)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The justfile has the rest: the frontend checks, the runnable examples, and the live-Azure
|
|
33
|
+
integration tests. Run what matches your change (for the frontend, also `npm run lint`, which
|
|
34
|
+
`just lint` does not cover). CI runs all of it on every PR bar the one exception below, so anything
|
|
35
|
+
you skip locally is still caught there.
|
|
36
|
+
|
|
37
|
+
The integration tests need credentials for the maintainer's Azure test account, so most contributors
|
|
38
|
+
cannot run them locally. That is fine. A PR from a fork is not given the secret either, so that job
|
|
39
|
+
skips there rather than failing on empty credentials, and the run against live Azure happens after
|
|
40
|
+
merge. If your change touches the Azure backend, say so in the PR and I will run them. The azure
|
|
41
|
+
fixtures in `tests/conftest.py` have the details.
|
|
42
|
+
|
|
43
|
+
## Conventions
|
|
44
|
+
|
|
45
|
+
- Branch off `main`. A pre-commit hook blocks direct commits to `main`.
|
|
46
|
+
- Add tests for new behavior and for bug fixes.
|
|
47
|
+
- Prefer dependency injection with fakes over mocking. Test what a caller can observe, not internal
|
|
48
|
+
behavior.
|
|
49
|
+
- If you change the stored run format, bump `RUN_SCHEMA_VERSION`. Its docstring in
|
|
50
|
+
`evaltrack/core/run_record.py` says what else a bump needs.
|
|
51
|
+
|
|
52
|
+
## Releasing
|
|
53
|
+
|
|
54
|
+
A release is a pull request and then a GitHub release. The pull request bumps `version` in
|
|
55
|
+
`pyproject.toml`, runs `uv lock` so the lockfile carries the new version, and turns the changelog's
|
|
56
|
+
`[Unreleased]` heading into the version and date, with a link reference at the bottom. Once it is
|
|
57
|
+
merged, publish a GitHub release with the tag `v<version>` and the changelog section as its notes.
|
|
58
|
+
That runs `release.yml`, which refuses a tag that does not match the declared version, builds and
|
|
59
|
+
smoke-tests the distribution, and uploads it to PyPI through the `pypi` environment. Releasing needs
|
|
60
|
+
write access to the repository and approval on that environment.
|
evaltrack-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jes Ravnbøl
|
|
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.
|
evaltrack-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: evaltrack
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Pytest plugin to record, gate and track LLM eval runs from pydantic-evals, DeepEval or a runner you write a translator for
|
|
5
|
+
Project-URL: Homepage, https://github.com/jesrav/evaltrack
|
|
6
|
+
Project-URL: Repository, https://github.com/jesrav/evaltrack
|
|
7
|
+
Project-URL: Documentation, https://github.com/jesrav/evaltrack/tree/main/docs
|
|
8
|
+
Project-URL: Issues, https://github.com/jesrav/evaltrack/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/jesrav/evaltrack/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: Jes Ravnbøl <mail@jesravnbol.dk>
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: ci,deepeval,evals,evaluation,flaky,llm,pydantic-evals,pytest
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Framework :: Pytest
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: MacOS
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
25
|
+
Classifier: Topic :: Software Development :: Testing
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Python: >=3.11
|
|
28
|
+
Requires-Dist: pydantic-core
|
|
29
|
+
Requires-Dist: pydantic>=2.13
|
|
30
|
+
Requires-Dist: pytest>=8.4.0
|
|
31
|
+
Requires-Dist: python-ulid>=3.1.0
|
|
32
|
+
Provides-Extra: azure
|
|
33
|
+
Requires-Dist: azure-core>=1.28.0; extra == 'azure'
|
|
34
|
+
Requires-Dist: azure-identity>=1.12.0; extra == 'azure'
|
|
35
|
+
Requires-Dist: azure-storage-blob>=12.19.0; extra == 'azure'
|
|
36
|
+
Provides-Extra: deepeval
|
|
37
|
+
Requires-Dist: deepeval>=4.2; extra == 'deepeval'
|
|
38
|
+
Provides-Extra: pydantic-evals
|
|
39
|
+
Requires-Dist: pydantic-evals>=2; extra == 'pydantic-evals'
|
|
40
|
+
Provides-Extra: ui
|
|
41
|
+
Requires-Dist: fastapi>=0.115.8; extra == 'ui'
|
|
42
|
+
Requires-Dist: starlette>=0.45.1; extra == 'ui'
|
|
43
|
+
Requires-Dist: uvicorn>=0.30.0; extra == 'ui'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
<p align="center">
|
|
47
|
+
<img src="https://raw.githubusercontent.com/jesrav/evaltrack/main/assets/wordmark.svg" alt="evaltrack" width="320">
|
|
48
|
+
</p>
|
|
49
|
+
|
|
50
|
+
<p align="center">
|
|
51
|
+
<a href="https://pypi.org/project/evaltrack/"><img src="https://img.shields.io/pypi/v/evaltrack.svg" alt="PyPI version"></a>
|
|
52
|
+
<a href="https://pypi.org/project/evaltrack/"><img src="https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="Python versions"></a>
|
|
53
|
+
<a href="https://github.com/jesrav/evaltrack/actions/workflows/ci.yml"><img src="https://github.com/jesrav/evaltrack/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
54
|
+
<a href="https://github.com/jesrav/evaltrack/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License: MIT"></a>
|
|
55
|
+
<img src="https://img.shields.io/badge/basedpyright-checked-42b983" alt="basedpyright: strict">
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
# evaltrack
|
|
59
|
+
|
|
60
|
+
Evals are tests. They belong in your test suite, running in CI and gating your pull requests.
|
|
61
|
+
|
|
62
|
+
evaltrack is a pytest plugin that records, gates and tracks your evals. Your evals run in the pytest
|
|
63
|
+
suite and CI pipeline that you already have, with the eval runner you already use. Mark a test with
|
|
64
|
+
`@pytest.mark.evaltrack` and you get two things:
|
|
65
|
+
|
|
66
|
+
- **Gate on assertions and scores.** Keep using your existing eval runner and evaltrack turns your
|
|
67
|
+
runner's assertions into a pass/fail gate, so a failing case fails the test. It also adds **score
|
|
68
|
+
bars**. Most runners record a numeric score without judging it, and a bar turns that score into a
|
|
69
|
+
gate that fails any case under it. See [The evaltrack marker].
|
|
70
|
+
- **Handle flakiness without rerunning CI.** LLM output is nondeterministic, so evaltrack lets you
|
|
71
|
+
rerun only the evals that fail (not the whole CI pipeline) and track each case's pass-rate over
|
|
72
|
+
time. See [Flakiness & reliability].
|
|
73
|
+
|
|
74
|
+
evaltrack records every run in a repository you own (local files, or Azure Blob as the supported
|
|
75
|
+
remote), with a dashboard you run locally to inspect runs and compare them across PRs and releases.
|
|
76
|
+
Over the mainline (the runs you have promoted) it tracks each case's pass-rate and each score, so
|
|
77
|
+
changes in quality that never trip the gate are still visible.
|
|
78
|
+
|
|
79
|
+
![Animated demo: a failing eval run in the dashboard, with per-case verdicts, scores against their bars, reliability history, and a comparison against the baseline][dashboard-demo]
|
|
80
|
+
|
|
81
|
+
[pydantic-evals] and [DeepEval] are supported out of the box. Another runner that fits [the overall
|
|
82
|
+
shape] needs a small translator ([Eval runners]).
|
|
83
|
+
|
|
84
|
+
<!-- prettier-ignore -->
|
|
85
|
+
> [!NOTE]
|
|
86
|
+
> evaltrack is for batch evals: you run a fixed dataset through your agent or LLM logic and score
|
|
87
|
+
> the results offline. For live production monitoring and tracing, see something like [online evals] and
|
|
88
|
+
> [Logfire].
|
|
89
|
+
|
|
90
|
+
## What you end up with
|
|
91
|
+
|
|
92
|
+
```mermaid
|
|
93
|
+
flowchart LR
|
|
94
|
+
dev["Write evals<br/>@pytest.mark.evaltrack"] --> run["pytest -m evaltrack<br/>→ a recorded run"]
|
|
95
|
+
run --> ui["evaltrack ui<br/>browse + diff"]
|
|
96
|
+
run -->|open PR| pr["CI: push pr/N"]
|
|
97
|
+
pr -->|merge| base["CI: promote → baseline"]
|
|
98
|
+
base -.->|review against baseline| ui
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Getting Started
|
|
102
|
+
|
|
103
|
+
The quickstart below uses pydantic-evals. If you are new to it, [start here]. If you write your
|
|
104
|
+
evals in [DeepEval], [Eval runners] goes through the same steps with a DeepEval run.
|
|
105
|
+
|
|
106
|
+
### 1. Install
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# The quick start uses pydantic-evals as the eval runner and evaluates an agent built in pydantic-ai, but neither is required for evaltrack.
|
|
110
|
+
uv add "evaltrack[ui,pydantic-evals]" "pydantic-ai-slim[openai]"
|
|
111
|
+
# or
|
|
112
|
+
pip install "evaltrack[ui,pydantic-evals]" "pydantic-ai-slim[openai]"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
<!-- prettier-ignore -->
|
|
116
|
+
> [!NOTE]
|
|
117
|
+
> Linux and macOS are supported, on Python 3.11 to 3.14.
|
|
118
|
+
> If your machine runs Windows, run evaltrack under WSL2.
|
|
119
|
+
|
|
120
|
+
### 2. Write a tracked eval
|
|
121
|
+
|
|
122
|
+
Add `@pytest.mark.evaltrack` to a test and hand the eval to `evaltrack.run()`. The test below is
|
|
123
|
+
sync. For an async test, use `await evaltrack.run_async(dataset.evaluate, task)` with your async
|
|
124
|
+
plugin.
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
import pytest
|
|
128
|
+
from pydantic_ai import Agent
|
|
129
|
+
from pydantic_evals import Case, Dataset
|
|
130
|
+
from pydantic_evals.evaluators import LLMJudge
|
|
131
|
+
|
|
132
|
+
import evaltrack
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
@pytest.mark.evaltrack(score_bars={"helpfulness": 0.8}, flake_reruns=2)
|
|
136
|
+
def test_support_agent() -> None:
|
|
137
|
+
agent = Agent(
|
|
138
|
+
"openai:gpt-4o-mini",
|
|
139
|
+
instructions=(
|
|
140
|
+
"Support the Snapwombat photo app. Deleted photos are restorable from "
|
|
141
|
+
"Settings > Backups for 30 days. Never promise or rule out a refund. Send "
|
|
142
|
+
"billing questions to support@snapwombat.example."
|
|
143
|
+
),
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
async def support_task(prompt: str) -> str:
|
|
147
|
+
return (await agent.run(prompt)).output
|
|
148
|
+
|
|
149
|
+
dataset = Dataset(
|
|
150
|
+
name="snapwombat-support",
|
|
151
|
+
cases=[
|
|
152
|
+
Case(name="refund-demand", inputs="The app deleted my photos. I want my money back!"),
|
|
153
|
+
Case(name="restore-backup", inputs="How do I restore a backup?"),
|
|
154
|
+
],
|
|
155
|
+
evaluators=[
|
|
156
|
+
# An assertion: must be true, or the case fails.
|
|
157
|
+
LLMJudge(rubric="The reply neither promises nor rules out a refund", include_input=True),
|
|
158
|
+
# A score, gated at 0.8 by the marker's score bar.
|
|
159
|
+
LLMJudge(
|
|
160
|
+
rubric=(
|
|
161
|
+
"Rate how helpful and clear the reply is, from 0.0 to 1.0. "
|
|
162
|
+
"Declining to promise a refund is not unhelpful."
|
|
163
|
+
),
|
|
164
|
+
include_input=True,
|
|
165
|
+
score={"evaluation_name": "helpfulness", "include_reason": True},
|
|
166
|
+
assertion=False,
|
|
167
|
+
),
|
|
168
|
+
],
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
# The marker gates here: a failed assertion, or a score under 0.8, fails the test.
|
|
172
|
+
# `flake_reruns=2` runs the eval again while a case is failing, up to twice.
|
|
173
|
+
evaltrack.run(dataset.evaluate_sync, support_task)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
The agent and the two LLM judges all call a real model, so this test needs an API key (here
|
|
177
|
+
`OPENAI_API_KEY`). The [examples] run without one — [`test_05_llm_judge.py`][llm judge example] is
|
|
178
|
+
the same pattern, an `LLMJudge` guardrail plus a `score_bars`-gated score, with the model and the
|
|
179
|
+
judge scripted.
|
|
180
|
+
|
|
181
|
+
<!-- prettier-ignore -->
|
|
182
|
+
> [!IMPORTANT]
|
|
183
|
+
> One test needs to be one eval. evaltrack records one eval per test, whichever runner produced it,
|
|
184
|
+
> and the test's name identifies that eval everywhere. If you want two evals, write two tests.
|
|
185
|
+
|
|
186
|
+
### 3. Run it
|
|
187
|
+
|
|
188
|
+
`evaltrack` is a registered pytest marker. You can select only your evals:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
pytest -m "evaltrack"
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Each pytest session produces a **run**, a snapshot of all recorded eval results, saved to
|
|
195
|
+
`.evaltrack/` by default (add `.evaltrack/` to your project's `.gitignore`).
|
|
196
|
+
|
|
197
|
+
CI can run the same command. See [CI/CD].
|
|
198
|
+
|
|
199
|
+
### 4. See the results
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
evaltrack ui
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
This serves the dashboard at `http://127.0.0.1:8765` and prints the link. Browse scores and
|
|
206
|
+
pass-rates per case, and diff any two runs. Open a case to see each score against its bar and its
|
|
207
|
+
history over the mainline.
|
|
208
|
+
|
|
209
|
+
<!-- prettier-ignore -->
|
|
210
|
+
> [!NOTE]
|
|
211
|
+
> The dashboard's React frontend is beta, written largely by AI coding agents. The security notes
|
|
212
|
+
> are in the [security policy].
|
|
213
|
+
|
|
214
|
+
### 5. Track a shared remote (optional)
|
|
215
|
+
|
|
216
|
+
Declare your repositories in `pyproject.toml`. `local` is where the plugin saves runs. `remote` is a
|
|
217
|
+
shared repository that your CI writes to (right now only Azure Blob Storage is supported). It stores
|
|
218
|
+
the baseline (the run recorded for what is currently deployed) and the PR history.
|
|
219
|
+
|
|
220
|
+
```toml
|
|
221
|
+
[tool.evaltrack]
|
|
222
|
+
local = "./.evaltrack"
|
|
223
|
+
remote = "azure://account/evals"
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
`evaltrack ui` then mounts both and opens on your latest local run. Click **Compare to mainline** to
|
|
227
|
+
diff your run against the baseline run, the one recorded for what is deployed. See [Repositories and
|
|
228
|
+
storage][configuring repositories] for the full setup.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Documentation
|
|
233
|
+
|
|
234
|
+
Guides:
|
|
235
|
+
|
|
236
|
+
- [The shape of an eval]: cases, evaluators, results, attempts, rounds and runs.
|
|
237
|
+
- [The evaltrack marker]: the gate, score bars, exceptions, xfail.
|
|
238
|
+
- [Flakiness & reliability]: `flake_reruns`, `repeats`, cross-run pass-rates, when to bump
|
|
239
|
+
`eval_version`.
|
|
240
|
+
- [Eval runners]: using pydantic-evals and DeepEval, and connecting another runner ([Translators]).
|
|
241
|
+
- [Repositories and storage]: the run/ref/baseline model, where runs are stored, cleaning up, and
|
|
242
|
+
reading runs from Python.
|
|
243
|
+
- [CI/CD]: recording a run per PR, promoting on merge, and what CI has to get right.
|
|
244
|
+
- [Examples]: runnable evals that you can copy.
|
|
245
|
+
|
|
246
|
+
Reference: [CLI] and [Configuration].
|
|
247
|
+
|
|
248
|
+
Design note: [the dashboard's trust model][dashboard trust model].
|
|
249
|
+
|
|
250
|
+
## Compatibility
|
|
251
|
+
|
|
252
|
+
evaltrack is pre-1.0, so breaking changes can happen and the changelog will say so. What I intend to
|
|
253
|
+
keep stable: the names `import evaltrack` exports, `evaltrack.translators.register` and the
|
|
254
|
+
`Translator` protocol, the marker kwargs, the CLI commands and flags and what its exit codes mean,
|
|
255
|
+
the `[tool.evaltrack]` keys, and the stored run JSON, where fields may be added but keep their
|
|
256
|
+
meaning. `raw_results` is the exception, since the runner decides its shape.
|
|
257
|
+
|
|
258
|
+
[pydantic-evals]: https://ai.pydantic.dev/evals/
|
|
259
|
+
[DeepEval]: https://deepeval.com/
|
|
260
|
+
[Eval runners]: https://github.com/jesrav/evaltrack/blob/main/docs/eval-runners.md
|
|
261
|
+
[the overall shape]: https://github.com/jesrav/evaltrack/blob/main/docs/eval-shape.md
|
|
262
|
+
[translators]: https://github.com/jesrav/evaltrack/blob/main/docs/translators.md
|
|
263
|
+
[start here]: https://ai.pydantic.dev/evals/
|
|
264
|
+
[online evals]: https://pydantic.dev/docs/ai/evals/online-evaluation/
|
|
265
|
+
[logfire]: https://pydantic.dev/docs/logfire/get-started/
|
|
266
|
+
[dashboard-demo]:
|
|
267
|
+
https://raw.githubusercontent.com/jesrav/evaltrack/main/docs/images/dashboard-demo.gif
|
|
268
|
+
[the evaltrack marker]: https://github.com/jesrav/evaltrack/blob/main/docs/marker.md
|
|
269
|
+
[the shape of an eval]: https://github.com/jesrav/evaltrack/blob/main/docs/eval-shape.md
|
|
270
|
+
[flakiness & reliability]: https://github.com/jesrav/evaltrack/blob/main/docs/flakiness.md
|
|
271
|
+
[configuring repositories]:
|
|
272
|
+
https://github.com/jesrav/evaltrack/blob/main/docs/repositories.md#configuring-repositories
|
|
273
|
+
[repositories and storage]: https://github.com/jesrav/evaltrack/blob/main/docs/repositories.md
|
|
274
|
+
[examples]: https://github.com/jesrav/evaltrack/blob/main/examples/README.md
|
|
275
|
+
[llm judge example]: https://github.com/jesrav/evaltrack/blob/main/examples/test_05_llm_judge.py
|
|
276
|
+
[ci/cd]: https://github.com/jesrav/evaltrack/blob/main/docs/ci-cd.md
|
|
277
|
+
[cli]: https://github.com/jesrav/evaltrack/blob/main/docs/cli.md
|
|
278
|
+
[configuration]: https://github.com/jesrav/evaltrack/blob/main/docs/configuration.md
|
|
279
|
+
[security policy]: https://github.com/jesrav/evaltrack/blob/main/SECURITY.md
|
|
280
|
+
[dashboard trust model]:
|
|
281
|
+
https://github.com/jesrav/evaltrack/blob/main/SECURITY.md#dashboard-trust-model
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/jesrav/evaltrack/main/assets/wordmark.svg" alt="evaltrack" width="320">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://pypi.org/project/evaltrack/"><img src="https://img.shields.io/pypi/v/evaltrack.svg" alt="PyPI version"></a>
|
|
7
|
+
<a href="https://pypi.org/project/evaltrack/"><img src="https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="Python versions"></a>
|
|
8
|
+
<a href="https://github.com/jesrav/evaltrack/actions/workflows/ci.yml"><img src="https://github.com/jesrav/evaltrack/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
9
|
+
<a href="https://github.com/jesrav/evaltrack/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License: MIT"></a>
|
|
10
|
+
<img src="https://img.shields.io/badge/basedpyright-checked-42b983" alt="basedpyright: strict">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
# evaltrack
|
|
14
|
+
|
|
15
|
+
Evals are tests. They belong in your test suite, running in CI and gating your pull requests.
|
|
16
|
+
|
|
17
|
+
evaltrack is a pytest plugin that records, gates and tracks your evals. Your evals run in the pytest
|
|
18
|
+
suite and CI pipeline that you already have, with the eval runner you already use. Mark a test with
|
|
19
|
+
`@pytest.mark.evaltrack` and you get two things:
|
|
20
|
+
|
|
21
|
+
- **Gate on assertions and scores.** Keep using your existing eval runner and evaltrack turns your
|
|
22
|
+
runner's assertions into a pass/fail gate, so a failing case fails the test. It also adds **score
|
|
23
|
+
bars**. Most runners record a numeric score without judging it, and a bar turns that score into a
|
|
24
|
+
gate that fails any case under it. See [The evaltrack marker].
|
|
25
|
+
- **Handle flakiness without rerunning CI.** LLM output is nondeterministic, so evaltrack lets you
|
|
26
|
+
rerun only the evals that fail (not the whole CI pipeline) and track each case's pass-rate over
|
|
27
|
+
time. See [Flakiness & reliability].
|
|
28
|
+
|
|
29
|
+
evaltrack records every run in a repository you own (local files, or Azure Blob as the supported
|
|
30
|
+
remote), with a dashboard you run locally to inspect runs and compare them across PRs and releases.
|
|
31
|
+
Over the mainline (the runs you have promoted) it tracks each case's pass-rate and each score, so
|
|
32
|
+
changes in quality that never trip the gate are still visible.
|
|
33
|
+
|
|
34
|
+
![Animated demo: a failing eval run in the dashboard, with per-case verdicts, scores against their bars, reliability history, and a comparison against the baseline][dashboard-demo]
|
|
35
|
+
|
|
36
|
+
[pydantic-evals] and [DeepEval] are supported out of the box. Another runner that fits [the overall
|
|
37
|
+
shape] needs a small translator ([Eval runners]).
|
|
38
|
+
|
|
39
|
+
<!-- prettier-ignore -->
|
|
40
|
+
> [!NOTE]
|
|
41
|
+
> evaltrack is for batch evals: you run a fixed dataset through your agent or LLM logic and score
|
|
42
|
+
> the results offline. For live production monitoring and tracing, see something like [online evals] and
|
|
43
|
+
> [Logfire].
|
|
44
|
+
|
|
45
|
+
## What you end up with
|
|
46
|
+
|
|
47
|
+
```mermaid
|
|
48
|
+
flowchart LR
|
|
49
|
+
dev["Write evals<br/>@pytest.mark.evaltrack"] --> run["pytest -m evaltrack<br/>→ a recorded run"]
|
|
50
|
+
run --> ui["evaltrack ui<br/>browse + diff"]
|
|
51
|
+
run -->|open PR| pr["CI: push pr/N"]
|
|
52
|
+
pr -->|merge| base["CI: promote → baseline"]
|
|
53
|
+
base -.->|review against baseline| ui
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Getting Started
|
|
57
|
+
|
|
58
|
+
The quickstart below uses pydantic-evals. If you are new to it, [start here]. If you write your
|
|
59
|
+
evals in [DeepEval], [Eval runners] goes through the same steps with a DeepEval run.
|
|
60
|
+
|
|
61
|
+
### 1. Install
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# The quick start uses pydantic-evals as the eval runner and evaluates an agent built in pydantic-ai, but neither is required for evaltrack.
|
|
65
|
+
uv add "evaltrack[ui,pydantic-evals]" "pydantic-ai-slim[openai]"
|
|
66
|
+
# or
|
|
67
|
+
pip install "evaltrack[ui,pydantic-evals]" "pydantic-ai-slim[openai]"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
<!-- prettier-ignore -->
|
|
71
|
+
> [!NOTE]
|
|
72
|
+
> Linux and macOS are supported, on Python 3.11 to 3.14.
|
|
73
|
+
> If your machine runs Windows, run evaltrack under WSL2.
|
|
74
|
+
|
|
75
|
+
### 2. Write a tracked eval
|
|
76
|
+
|
|
77
|
+
Add `@pytest.mark.evaltrack` to a test and hand the eval to `evaltrack.run()`. The test below is
|
|
78
|
+
sync. For an async test, use `await evaltrack.run_async(dataset.evaluate, task)` with your async
|
|
79
|
+
plugin.
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
import pytest
|
|
83
|
+
from pydantic_ai import Agent
|
|
84
|
+
from pydantic_evals import Case, Dataset
|
|
85
|
+
from pydantic_evals.evaluators import LLMJudge
|
|
86
|
+
|
|
87
|
+
import evaltrack
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@pytest.mark.evaltrack(score_bars={"helpfulness": 0.8}, flake_reruns=2)
|
|
91
|
+
def test_support_agent() -> None:
|
|
92
|
+
agent = Agent(
|
|
93
|
+
"openai:gpt-4o-mini",
|
|
94
|
+
instructions=(
|
|
95
|
+
"Support the Snapwombat photo app. Deleted photos are restorable from "
|
|
96
|
+
"Settings > Backups for 30 days. Never promise or rule out a refund. Send "
|
|
97
|
+
"billing questions to support@snapwombat.example."
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
async def support_task(prompt: str) -> str:
|
|
102
|
+
return (await agent.run(prompt)).output
|
|
103
|
+
|
|
104
|
+
dataset = Dataset(
|
|
105
|
+
name="snapwombat-support",
|
|
106
|
+
cases=[
|
|
107
|
+
Case(name="refund-demand", inputs="The app deleted my photos. I want my money back!"),
|
|
108
|
+
Case(name="restore-backup", inputs="How do I restore a backup?"),
|
|
109
|
+
],
|
|
110
|
+
evaluators=[
|
|
111
|
+
# An assertion: must be true, or the case fails.
|
|
112
|
+
LLMJudge(rubric="The reply neither promises nor rules out a refund", include_input=True),
|
|
113
|
+
# A score, gated at 0.8 by the marker's score bar.
|
|
114
|
+
LLMJudge(
|
|
115
|
+
rubric=(
|
|
116
|
+
"Rate how helpful and clear the reply is, from 0.0 to 1.0. "
|
|
117
|
+
"Declining to promise a refund is not unhelpful."
|
|
118
|
+
),
|
|
119
|
+
include_input=True,
|
|
120
|
+
score={"evaluation_name": "helpfulness", "include_reason": True},
|
|
121
|
+
assertion=False,
|
|
122
|
+
),
|
|
123
|
+
],
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
# The marker gates here: a failed assertion, or a score under 0.8, fails the test.
|
|
127
|
+
# `flake_reruns=2` runs the eval again while a case is failing, up to twice.
|
|
128
|
+
evaltrack.run(dataset.evaluate_sync, support_task)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The agent and the two LLM judges all call a real model, so this test needs an API key (here
|
|
132
|
+
`OPENAI_API_KEY`). The [examples] run without one — [`test_05_llm_judge.py`][llm judge example] is
|
|
133
|
+
the same pattern, an `LLMJudge` guardrail plus a `score_bars`-gated score, with the model and the
|
|
134
|
+
judge scripted.
|
|
135
|
+
|
|
136
|
+
<!-- prettier-ignore -->
|
|
137
|
+
> [!IMPORTANT]
|
|
138
|
+
> One test needs to be one eval. evaltrack records one eval per test, whichever runner produced it,
|
|
139
|
+
> and the test's name identifies that eval everywhere. If you want two evals, write two tests.
|
|
140
|
+
|
|
141
|
+
### 3. Run it
|
|
142
|
+
|
|
143
|
+
`evaltrack` is a registered pytest marker. You can select only your evals:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pytest -m "evaltrack"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Each pytest session produces a **run**, a snapshot of all recorded eval results, saved to
|
|
150
|
+
`.evaltrack/` by default (add `.evaltrack/` to your project's `.gitignore`).
|
|
151
|
+
|
|
152
|
+
CI can run the same command. See [CI/CD].
|
|
153
|
+
|
|
154
|
+
### 4. See the results
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
evaltrack ui
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
This serves the dashboard at `http://127.0.0.1:8765` and prints the link. Browse scores and
|
|
161
|
+
pass-rates per case, and diff any two runs. Open a case to see each score against its bar and its
|
|
162
|
+
history over the mainline.
|
|
163
|
+
|
|
164
|
+
<!-- prettier-ignore -->
|
|
165
|
+
> [!NOTE]
|
|
166
|
+
> The dashboard's React frontend is beta, written largely by AI coding agents. The security notes
|
|
167
|
+
> are in the [security policy].
|
|
168
|
+
|
|
169
|
+
### 5. Track a shared remote (optional)
|
|
170
|
+
|
|
171
|
+
Declare your repositories in `pyproject.toml`. `local` is where the plugin saves runs. `remote` is a
|
|
172
|
+
shared repository that your CI writes to (right now only Azure Blob Storage is supported). It stores
|
|
173
|
+
the baseline (the run recorded for what is currently deployed) and the PR history.
|
|
174
|
+
|
|
175
|
+
```toml
|
|
176
|
+
[tool.evaltrack]
|
|
177
|
+
local = "./.evaltrack"
|
|
178
|
+
remote = "azure://account/evals"
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`evaltrack ui` then mounts both and opens on your latest local run. Click **Compare to mainline** to
|
|
182
|
+
diff your run against the baseline run, the one recorded for what is deployed. See [Repositories and
|
|
183
|
+
storage][configuring repositories] for the full setup.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Documentation
|
|
188
|
+
|
|
189
|
+
Guides:
|
|
190
|
+
|
|
191
|
+
- [The shape of an eval]: cases, evaluators, results, attempts, rounds and runs.
|
|
192
|
+
- [The evaltrack marker]: the gate, score bars, exceptions, xfail.
|
|
193
|
+
- [Flakiness & reliability]: `flake_reruns`, `repeats`, cross-run pass-rates, when to bump
|
|
194
|
+
`eval_version`.
|
|
195
|
+
- [Eval runners]: using pydantic-evals and DeepEval, and connecting another runner ([Translators]).
|
|
196
|
+
- [Repositories and storage]: the run/ref/baseline model, where runs are stored, cleaning up, and
|
|
197
|
+
reading runs from Python.
|
|
198
|
+
- [CI/CD]: recording a run per PR, promoting on merge, and what CI has to get right.
|
|
199
|
+
- [Examples]: runnable evals that you can copy.
|
|
200
|
+
|
|
201
|
+
Reference: [CLI] and [Configuration].
|
|
202
|
+
|
|
203
|
+
Design note: [the dashboard's trust model][dashboard trust model].
|
|
204
|
+
|
|
205
|
+
## Compatibility
|
|
206
|
+
|
|
207
|
+
evaltrack is pre-1.0, so breaking changes can happen and the changelog will say so. What I intend to
|
|
208
|
+
keep stable: the names `import evaltrack` exports, `evaltrack.translators.register` and the
|
|
209
|
+
`Translator` protocol, the marker kwargs, the CLI commands and flags and what its exit codes mean,
|
|
210
|
+
the `[tool.evaltrack]` keys, and the stored run JSON, where fields may be added but keep their
|
|
211
|
+
meaning. `raw_results` is the exception, since the runner decides its shape.
|
|
212
|
+
|
|
213
|
+
[pydantic-evals]: https://ai.pydantic.dev/evals/
|
|
214
|
+
[DeepEval]: https://deepeval.com/
|
|
215
|
+
[Eval runners]: https://github.com/jesrav/evaltrack/blob/main/docs/eval-runners.md
|
|
216
|
+
[the overall shape]: https://github.com/jesrav/evaltrack/blob/main/docs/eval-shape.md
|
|
217
|
+
[translators]: https://github.com/jesrav/evaltrack/blob/main/docs/translators.md
|
|
218
|
+
[start here]: https://ai.pydantic.dev/evals/
|
|
219
|
+
[online evals]: https://pydantic.dev/docs/ai/evals/online-evaluation/
|
|
220
|
+
[logfire]: https://pydantic.dev/docs/logfire/get-started/
|
|
221
|
+
[dashboard-demo]:
|
|
222
|
+
https://raw.githubusercontent.com/jesrav/evaltrack/main/docs/images/dashboard-demo.gif
|
|
223
|
+
[the evaltrack marker]: https://github.com/jesrav/evaltrack/blob/main/docs/marker.md
|
|
224
|
+
[the shape of an eval]: https://github.com/jesrav/evaltrack/blob/main/docs/eval-shape.md
|
|
225
|
+
[flakiness & reliability]: https://github.com/jesrav/evaltrack/blob/main/docs/flakiness.md
|
|
226
|
+
[configuring repositories]:
|
|
227
|
+
https://github.com/jesrav/evaltrack/blob/main/docs/repositories.md#configuring-repositories
|
|
228
|
+
[repositories and storage]: https://github.com/jesrav/evaltrack/blob/main/docs/repositories.md
|
|
229
|
+
[examples]: https://github.com/jesrav/evaltrack/blob/main/examples/README.md
|
|
230
|
+
[llm judge example]: https://github.com/jesrav/evaltrack/blob/main/examples/test_05_llm_judge.py
|
|
231
|
+
[ci/cd]: https://github.com/jesrav/evaltrack/blob/main/docs/ci-cd.md
|
|
232
|
+
[cli]: https://github.com/jesrav/evaltrack/blob/main/docs/cli.md
|
|
233
|
+
[configuration]: https://github.com/jesrav/evaltrack/blob/main/docs/configuration.md
|
|
234
|
+
[security policy]: https://github.com/jesrav/evaltrack/blob/main/SECURITY.md
|
|
235
|
+
[dashboard trust model]:
|
|
236
|
+
https://github.com/jesrav/evaltrack/blob/main/SECURITY.md#dashboard-trust-model
|