evalring 0.2.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.
- evalring-0.2.0/.env.example +28 -0
- evalring-0.2.0/AGENTS.md +79 -0
- evalring-0.2.0/CHANGELOG.md +99 -0
- evalring-0.2.0/CODE_OF_CONDUCT.md +56 -0
- evalring-0.2.0/CONTRIBUTING.md +137 -0
- evalring-0.2.0/LICENSE +21 -0
- evalring-0.2.0/MANIFEST.in +22 -0
- evalring-0.2.0/PKG-INFO +454 -0
- evalring-0.2.0/README.md +398 -0
- evalring-0.2.0/SECURITY.md +62 -0
- evalring-0.2.0/docs/API_REFERENCE.md +378 -0
- evalring-0.2.0/docs/CLI.md +182 -0
- evalring-0.2.0/docs/CONFIGURATION.md +167 -0
- evalring-0.2.0/docs/DATA.md +139 -0
- evalring-0.2.0/docs/DESIGN_SPEC.md +547 -0
- evalring-0.2.0/docs/README.md +51 -0
- evalring-0.2.0/docs/RELEASING.md +111 -0
- evalring-0.2.0/docs/USAGE.md +421 -0
- evalring-0.2.0/docs/dataset/arc_challenge.md +43 -0
- evalring-0.2.0/docs/dataset/hle.md +59 -0
- evalring-0.2.0/docs/providers/gemini.md +28 -0
- evalring-0.2.0/docs/providers/litellm.md +74 -0
- evalring-0.2.0/docs/providers/openai.md +30 -0
- evalring-0.2.0/docs/providers/openrouter.md +24 -0
- evalring-0.2.0/docs/sample/suicide_detection/README.md +322 -0
- evalring-0.2.0/pyproject.toml +156 -0
- evalring-0.2.0/setup.cfg +4 -0
- evalring-0.2.0/src/EvalRing/__init__.py +106 -0
- evalring-0.2.0/src/EvalRing/agent/__init__.py +33 -0
- evalring-0.2.0/src/EvalRing/agent/base.py +122 -0
- evalring-0.2.0/src/EvalRing/agent/classification.py +191 -0
- evalring-0.2.0/src/EvalRing/agent/errors.py +109 -0
- evalring-0.2.0/src/EvalRing/agent/implementations.py +575 -0
- evalring-0.2.0/src/EvalRing/agent/multi_role.py +305 -0
- evalring-0.2.0/src/EvalRing/cli.py +284 -0
- evalring-0.2.0/src/EvalRing/config.py +216 -0
- evalring-0.2.0/src/EvalRing/dataset/__init__.py +8 -0
- evalring-0.2.0/src/EvalRing/dataset/ai_data_generator.py +217 -0
- evalring-0.2.0/src/EvalRing/dataset/base.py +238 -0
- evalring-0.2.0/src/EvalRing/dataset/implementations.py +179 -0
- evalring-0.2.0/src/EvalRing/evaluator/__init__.py +36 -0
- evalring-0.2.0/src/EvalRing/evaluator/base.py +165 -0
- evalring-0.2.0/src/EvalRing/evaluator/implementations.py +404 -0
- evalring-0.2.0/src/EvalRing/evaluator/llm_judge/__init__.py +32 -0
- evalring-0.2.0/src/EvalRing/evaluator/llm_judge/evaluator.py +588 -0
- evalring-0.2.0/src/EvalRing/evaluator/llm_judge/judge.py +138 -0
- evalring-0.2.0/src/EvalRing/evaluator/llm_judge/metric.py +194 -0
- evalring-0.2.0/src/EvalRing/evaluator/llm_judge/rubric.py +160 -0
- evalring-0.2.0/src/EvalRing/evaluator/llm_judge/schema.py +147 -0
- evalring-0.2.0/src/EvalRing/evaluator/llm_judge/template.py +144 -0
- evalring-0.2.0/src/EvalRing/logging_utils.py +66 -0
- evalring-0.2.0/src/EvalRing/py.typed +0 -0
- evalring-0.2.0/src/EvalRing/utils/__init__.py +16 -0
- evalring-0.2.0/src/EvalRing/utils/generate_model_list.py +155 -0
- evalring-0.2.0/src/EvalRing/utils/global_cache.py +531 -0
- evalring-0.2.0/src/EvalRing/utils/suite_runner.py +836 -0
- evalring-0.2.0/src/EvalRing/utils/timeout.py +48 -0
- evalring-0.2.0/src/EvalRing/utils/visualizations.py +560 -0
- evalring-0.2.0/src/evalring.egg-info/PKG-INFO +454 -0
- evalring-0.2.0/src/evalring.egg-info/SOURCES.txt +62 -0
- evalring-0.2.0/src/evalring.egg-info/dependency_links.txt +1 -0
- evalring-0.2.0/src/evalring.egg-info/entry_points.txt +2 -0
- evalring-0.2.0/src/evalring.egg-info/requires.txt +30 -0
- evalring-0.2.0/src/evalring.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# EvalRing configuration. Copy to .env and fill in; .env is gitignored.
|
|
2
|
+
# Full reference: docs/CONFIGURATION.md
|
|
3
|
+
|
|
4
|
+
# --- Provider credentials --------------------------------------------------
|
|
5
|
+
# Vendor-neutral form. Works with any OpenAI-compatible chat-completions
|
|
6
|
+
# endpoint and takes precedence over the provider-specific variables below.
|
|
7
|
+
EVALRING_API_KEY=
|
|
8
|
+
# Leave EVALRING_BASE_URL unset for OpenAI itself. Set it for OpenRouter, a
|
|
9
|
+
# self-hosted gateway, vLLM, Ollama, or any other compatible endpoint.
|
|
10
|
+
EVALRING_BASE_URL=
|
|
11
|
+
# Default model when a script or agent does not name one explicitly.
|
|
12
|
+
EVALRING_MODEL=
|
|
13
|
+
|
|
14
|
+
# --- Provider-specific alternatives ---------------------------------------
|
|
15
|
+
# Any one of these is enough on its own. Checked in this order after
|
|
16
|
+
# EVALRING_API_KEY: OPENAI_API_KEY, OPENROUTER_API_KEY, OPEN_ROUTER_KEY,
|
|
17
|
+
# RADIUM_API_KEY.
|
|
18
|
+
# OPENAI_API_KEY=
|
|
19
|
+
# OPENROUTER_API_KEY=
|
|
20
|
+
|
|
21
|
+
# --- Behaviour -------------------------------------------------------------
|
|
22
|
+
# Transport used by OpenAIAgent: "litellm" (default) or "openai".
|
|
23
|
+
# EVALRING_LLM_TRANSPORT=litellm
|
|
24
|
+
# Per-request timeout in seconds. 0 or negative disables the timeout.
|
|
25
|
+
# OPENAI_REQUEST_TIMEOUT_S=120
|
|
26
|
+
# Directory that holds the _EvalRing/ cache and run artifacts.
|
|
27
|
+
# Defaults to the current working directory.
|
|
28
|
+
# EVALRING_WORKSPACE=
|
evalring-0.2.0/AGENTS.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Working in this repository
|
|
2
|
+
|
|
3
|
+
Orientation for coding agents and for anyone reading the codebase for the first
|
|
4
|
+
time. The documents under [`docs/`](docs/) are the authoritative description of
|
|
5
|
+
this system and ship with the code — read them before the source, and update
|
|
6
|
+
them in the same change that alters behaviour.
|
|
7
|
+
|
|
8
|
+
## Where to read first
|
|
9
|
+
|
|
10
|
+
| Question | Document |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| What is this and how is it built? | [`docs/DESIGN_SPEC.md`](docs/DESIGN_SPEC.md) |
|
|
13
|
+
| What can I call from Python? | [`docs/API_REFERENCE.md`](docs/API_REFERENCE.md) |
|
|
14
|
+
| How do I point it at a model? | [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md) |
|
|
15
|
+
| What does the CLI do? | [`docs/CLI.md`](docs/CLI.md) |
|
|
16
|
+
| How do I run a real evaluation? | [`docs/USAGE.md`](docs/USAGE.md) |
|
|
17
|
+
| Which datasets exist and what may I do with them? | [`docs/DATA.md`](docs/DATA.md) |
|
|
18
|
+
| How do I contribute a change? | [`CONTRIBUTING.md`](CONTRIBUTING.md) |
|
|
19
|
+
| How do I cut a release? | [`docs/RELEASING.md`](docs/RELEASING.md) |
|
|
20
|
+
|
|
21
|
+
If a document disagrees with the code, the code is what runs — fix the document
|
|
22
|
+
and say so in your summary.
|
|
23
|
+
|
|
24
|
+
## Layout
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
src/EvalRing/ the installable package; the only thing that ships
|
|
28
|
+
config.py credential and model resolution for every component
|
|
29
|
+
logging_utils.py logger namespace and entry-point logging setup
|
|
30
|
+
cli.py the `evalring` console script
|
|
31
|
+
dataset/ BaseDataset, DataSample, JSON/CSV/DataFrame readers
|
|
32
|
+
agent/ BaseAgent, AgentResponse, Mock/RuleBased/OpenAI agents,
|
|
33
|
+
classification parsing, error classification
|
|
34
|
+
evaluator/ BaseEvaluator, ClassificationEvaluator, llm_judge/
|
|
35
|
+
utils/ suite runner, response cache, model lists, charts
|
|
36
|
+
tests/ offline test suite
|
|
37
|
+
examples/ runnable evaluations; NOT packaged, NOT importable
|
|
38
|
+
docs/ authoritative documentation
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Ground rules
|
|
42
|
+
|
|
43
|
+
These are enforced by CI, so a change that breaks one will fail before review.
|
|
44
|
+
|
|
45
|
+
1. **`import EvalRing` must work with core dependencies only.** `openai`,
|
|
46
|
+
`litellm`, `matplotlib`, and `nest_asyncio` are optional. Import them inside
|
|
47
|
+
the function that needs them and raise an `ImportError` naming the extra.
|
|
48
|
+
2. **No `print()` inside `src/EvalRing/`**, except machine-readable output the
|
|
49
|
+
user explicitly asked the CLI for. Use `get_logger(__name__)`.
|
|
50
|
+
3. **No provider hard-coded anywhere.** Credentials and base URLs come from
|
|
51
|
+
`EvalRing.config.resolve_credentials()`. Never read a key from `os.environ`
|
|
52
|
+
directly, and never put an endpoint in a default argument.
|
|
53
|
+
4. **Tests stay offline.** No network in the default suite. Use a scripted
|
|
54
|
+
`BaseAgent` subclass, not SDK mocks.
|
|
55
|
+
5. **Nothing but `EvalRing` goes in the wheel.** `examples/` and `tests/` are
|
|
56
|
+
excluded; CI asserts the wheel's top-level contents.
|
|
57
|
+
6. **Do not commit datasets or credentials.** See
|
|
58
|
+
[`docs/DATA.md`](docs/DATA.md) and [`SECURITY.md`](SECURITY.md).
|
|
59
|
+
|
|
60
|
+
## Local commands
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install -e ".[dev]"
|
|
64
|
+
|
|
65
|
+
ruff check src tests
|
|
66
|
+
ruff format src tests
|
|
67
|
+
mypy
|
|
68
|
+
pytest
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Use `.agent_temp/` for scratch files and `.log/` for log output. Both are
|
|
72
|
+
gitignored. Do not leave working files in the repository root.
|
|
73
|
+
|
|
74
|
+
## Sensitive material
|
|
75
|
+
|
|
76
|
+
`examples/suicide_detection/` and `examples/sample/med_note/` involve
|
|
77
|
+
suicide-risk classification and clinical notes. Read
|
|
78
|
+
[`docs/DATA.md`](docs/DATA.md) before touching them: the datasets carry
|
|
79
|
+
redistribution conditions, and the outputs are not clinical tools.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project
|
|
5
|
+
follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.2.0] - 2026-09-01
|
|
10
|
+
|
|
11
|
+
First release prepared for public use. The framework's behaviour is largely
|
|
12
|
+
unchanged; this release makes the package honest about what it does, removes
|
|
13
|
+
vendor-specific defaults, and adds the tests and CI a published library needs.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `evalring` command-line interface with four subcommands: `info` (dataset
|
|
18
|
+
statistics), `check` (report the resolved provider configuration without
|
|
19
|
+
printing secrets), `models` (generate a model list), and `run-suite`
|
|
20
|
+
(multi-model evaluation). Previously the entry point was declared but the
|
|
21
|
+
module did not exist.
|
|
22
|
+
- `EvalRing.config` with `resolve_credentials()` and `resolve_model_name()`, a
|
|
23
|
+
single documented precedence order for API keys, endpoints, and model names
|
|
24
|
+
across every component.
|
|
25
|
+
- `EvalRing.logging_utils` with `get_logger()` and `configure_logging()`.
|
|
26
|
+
- `py.typed` marker, so downstream projects get type information.
|
|
27
|
+
- Test suite covering credentials, datasets, agents, evaluation, metrics,
|
|
28
|
+
caching, and the CLI. Every test runs offline.
|
|
29
|
+
- CI across Python 3.10-3.13 on Linux, plus Windows and macOS: lint, format,
|
|
30
|
+
types, tests, a core-only install check, and a wheel-contents assertion.
|
|
31
|
+
- Release workflow publishing to PyPI via Trusted Publishing on a version tag.
|
|
32
|
+
- `GlobalCache.reset_instance()` and the `EVALRING_WORKSPACE` variable, so the
|
|
33
|
+
cache location can be controlled instead of always following the working
|
|
34
|
+
directory.
|
|
35
|
+
- Documentation: `CONFIGURATION.md`, `API_REFERENCE.md`, `CLI.md`, `DATA.md`,
|
|
36
|
+
`RELEASING.md`, plus `AGENTS.md`, `SECURITY.md`, `CODE_OF_CONDUCT.md`, and
|
|
37
|
+
`.env.example`.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
|
|
41
|
+
- **Provider resolution is vendor-neutral.** `EVALRING_API_KEY` and
|
|
42
|
+
`EVALRING_BASE_URL` are the recommended variables. `OPENAI_API_KEY`,
|
|
43
|
+
`OPENROUTER_API_KEY`, `OPEN_ROUTER_KEY`, and `RADIUM_API_KEY` still work, in
|
|
44
|
+
that order. No private endpoint is used as a default any more; a provider's
|
|
45
|
+
base URL applies only when that provider's key is the one selected.
|
|
46
|
+
- **The library logs instead of printing.** Modules under `EvalRing/` emit
|
|
47
|
+
records on the `EvalRing` logger hierarchy and no longer write to stdout or
|
|
48
|
+
configure the root logger. Entry points call `configure_logging()`.
|
|
49
|
+
- Examples moved from `src/example/` to `examples/` and are no longer packaged.
|
|
50
|
+
Installing EvalRing previously also installed a top-level `example` package.
|
|
51
|
+
- Dependencies now reflect what the code imports. Core: `pandas`, `tqdm`,
|
|
52
|
+
`python-dotenv`, `requests`. Optional extras: `llm` (litellm, openai, httpx),
|
|
53
|
+
`viz` (matplotlib), `datagen` (openai, nest-asyncio), `all`, `dev`.
|
|
54
|
+
- Minimum Python is 3.10. The previously declared 3.8 floor was never valid:
|
|
55
|
+
`dataset/base.py` uses PEP 604 annotations evaluated at runtime.
|
|
56
|
+
- `BaseDataset.load_data()` declares `text_field`, `label_field`, and
|
|
57
|
+
`id_field` so concrete readers no longer widen the base signature.
|
|
58
|
+
- `run_suite()` takes `base_class=None` by default and forwards
|
|
59
|
+
`--base-class` only when set, instead of defaulting to a task-specific label.
|
|
60
|
+
- `run_suite()` skips its interactive confirmation when stdin is not a TTY,
|
|
61
|
+
so automated runs cannot hang.
|
|
62
|
+
- Package metadata: distribution renamed to `evalring` (the import name stays
|
|
63
|
+
`EvalRing`), real repository URLs, single version source in
|
|
64
|
+
`EvalRing.__version__`.
|
|
65
|
+
|
|
66
|
+
### Removed
|
|
67
|
+
|
|
68
|
+
- `setup.py` and `requirements.txt`. `pyproject.toml` is the single source of
|
|
69
|
+
build configuration and dependencies.
|
|
70
|
+
- `EvalRing.examples`, a module that could not be imported: it referenced
|
|
71
|
+
`EvalRing.base` and `EvalRing.implementations`, neither of which exists.
|
|
72
|
+
- The `sys.path` manipulation that `EvalRing.utils.suite_runner` performed at
|
|
73
|
+
import time, and the equivalent bootstrapping in the example scripts. Install
|
|
74
|
+
the package instead: `pip install -e .`.
|
|
75
|
+
- Unused declared dependencies: `numpy`, `scikit-learn`, `seaborn`, `pyyaml`.
|
|
76
|
+
The wrong `dotenv` distribution was replaced with `python-dotenv`.
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
|
|
80
|
+
- The README documented an API that did not exist (`Evaluator`,
|
|
81
|
+
`ClassificationMetrics`, `load_dataset`, `create_agent`, `EvalRing.agents`,
|
|
82
|
+
`EvalRing.datasets`, and a CLI). It now documents the real API, verified by a
|
|
83
|
+
test.
|
|
84
|
+
- A hardcoded absolute developer path in the suicide-detection suite runner.
|
|
85
|
+
- A duplicated `--ignore-errors` flag in the suite runner's subprocess command.
|
|
86
|
+
- `zip()` over ground truth and predictions is now strict, so a length mismatch
|
|
87
|
+
raises instead of silently truncating the metric computation.
|
|
88
|
+
- Trailing-whitespace, unused-variable, and un-narrowed-type issues across the
|
|
89
|
+
package; `ruff check`, `ruff format --check`, and `mypy` all pass.
|
|
90
|
+
|
|
91
|
+
### Security
|
|
92
|
+
|
|
93
|
+
- `.gitignore` no longer relies on a blanket `*.csv` rule that silently hid
|
|
94
|
+
files; credential files used by examples are ignored by explicit path.
|
|
95
|
+
- `evalring check` reports which variable supplied the API key without printing
|
|
96
|
+
the key, and a test asserts the key never reaches stdout.
|
|
97
|
+
|
|
98
|
+
[Unreleased]: https://github.com/CoronRing/EvalRing/compare/v0.2.0...HEAD
|
|
99
|
+
[0.2.0]: https://github.com/CoronRing/EvalRing/releases/tag/v0.2.0
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our pledge
|
|
4
|
+
|
|
5
|
+
We want EvalRing to be a project where anyone can contribute without being
|
|
6
|
+
harassed, belittled, or excluded. Everyone participating — in issues, pull
|
|
7
|
+
requests, discussions, or any other project space — is expected to help keep it
|
|
8
|
+
that way.
|
|
9
|
+
|
|
10
|
+
## Expected behaviour
|
|
11
|
+
|
|
12
|
+
- Be direct about code and considerate about people. Critique the change, not
|
|
13
|
+
the person who wrote it.
|
|
14
|
+
- Assume competence and good faith. Contributors have context you do not.
|
|
15
|
+
- Accept that reviewers and maintainers will sometimes say no, and give reasons
|
|
16
|
+
when you are the one saying it.
|
|
17
|
+
- Respect that people work in different time zones, languages, and levels of
|
|
18
|
+
availability.
|
|
19
|
+
|
|
20
|
+
## Unacceptable behaviour
|
|
21
|
+
|
|
22
|
+
- Harassment, intimidation, or sustained disruption.
|
|
23
|
+
- Insults or derogatory comments, including about someone's background,
|
|
24
|
+
identity, or experience level.
|
|
25
|
+
- Publishing anyone's private information without their explicit permission.
|
|
26
|
+
- Unwelcome sexual attention or imagery.
|
|
27
|
+
- Any other conduct that would reasonably be considered inappropriate in a
|
|
28
|
+
professional setting.
|
|
29
|
+
|
|
30
|
+
## A note on this project's subject matter
|
|
31
|
+
|
|
32
|
+
Some examples in this repository involve suicide-risk classification and
|
|
33
|
+
clinical data. Discuss that material with the seriousness it deserves. Do not
|
|
34
|
+
post identifiable data from any dataset in an issue, a pull request, or a
|
|
35
|
+
discussion.
|
|
36
|
+
|
|
37
|
+
## Scope
|
|
38
|
+
|
|
39
|
+
This applies in all project spaces — the repository, issues, pull requests,
|
|
40
|
+
discussions — and when someone is representing the project publicly.
|
|
41
|
+
|
|
42
|
+
## Reporting
|
|
43
|
+
|
|
44
|
+
Report unacceptable behaviour by opening a
|
|
45
|
+
[private security advisory](https://github.com/CoronRing/EvalRing/security/advisories/new),
|
|
46
|
+
which is the available private channel, or by contacting a maintainer directly.
|
|
47
|
+
Reports are handled confidentially and reviewed as promptly as we can manage.
|
|
48
|
+
|
|
49
|
+
Maintainers may edit or remove contributions that violate this policy, and may
|
|
50
|
+
temporarily or permanently ban anyone for behaviour they judge inappropriate,
|
|
51
|
+
threatening, or harmful.
|
|
52
|
+
|
|
53
|
+
## Attribution
|
|
54
|
+
|
|
55
|
+
Adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
|
|
56
|
+
version 2.1.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Contributing to EvalRing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest. This document covers how to get set up, what the code
|
|
4
|
+
should look like, and what a reviewable change looks like.
|
|
5
|
+
|
|
6
|
+
## Getting set up
|
|
7
|
+
|
|
8
|
+
EvalRing requires Python 3.10 or newer.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
git clone https://github.com/CoronRing/EvalRing.git
|
|
12
|
+
cd EvalRing
|
|
13
|
+
|
|
14
|
+
python -m venv .venv
|
|
15
|
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
16
|
+
|
|
17
|
+
pip install -e ".[dev]"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`[dev]` pulls in the full runtime (`llm`, `viz`, `datagen`) plus pytest, ruff,
|
|
21
|
+
mypy, and the build tooling.
|
|
22
|
+
|
|
23
|
+
## The checks CI runs
|
|
24
|
+
|
|
25
|
+
Run these before opening a pull request. They are exactly what
|
|
26
|
+
[`.github/workflows/ci.yml`](.github/workflows/ci.yml) runs.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
ruff check src tests # lint
|
|
30
|
+
ruff format --check src tests # formatting
|
|
31
|
+
mypy # types
|
|
32
|
+
pytest # tests
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`ruff format src tests` applies the formatting rather than just checking it.
|
|
36
|
+
|
|
37
|
+
### Tests must run offline
|
|
38
|
+
|
|
39
|
+
The whole suite runs without an API key and without network access. Provider
|
|
40
|
+
credentials are stripped from the environment by an autouse fixture in
|
|
41
|
+
[`tests/conftest.py`](tests/conftest.py), and cache and run artifacts are
|
|
42
|
+
redirected into a temporary directory.
|
|
43
|
+
|
|
44
|
+
If you add a test that genuinely needs the network, mark it:
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
@pytest.mark.network
|
|
48
|
+
def test_fetches_the_live_model_catalogue() -> None: ...
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Those tests are excluded with `pytest -m "not network"`.
|
|
52
|
+
|
|
53
|
+
To test code that calls a model, subclass `BaseAgent` with a scripted response
|
|
54
|
+
rather than mocking an SDK — see `ScriptedAgent` in
|
|
55
|
+
[`tests/test_evaluator.py`](tests/test_evaluator.py).
|
|
56
|
+
|
|
57
|
+
## Design principles
|
|
58
|
+
|
|
59
|
+
**Push shared logic down into the framework, not up into each task.** If two
|
|
60
|
+
evaluation tasks both need a behaviour, it belongs in `EvalRing/`, not copied
|
|
61
|
+
into two scripts under `examples/`. Dataset-level and evaluator-level
|
|
62
|
+
abstractions exist so a new task is a thin script, not a fork of the framework.
|
|
63
|
+
|
|
64
|
+
**Never hard-code a provider.** All credentials and endpoints resolve through
|
|
65
|
+
[`EvalRing/config.py`](src/EvalRing/config.py). A new backend adds an entry to
|
|
66
|
+
`_CREDENTIAL_SOURCES`; it does not read `os.environ` directly and it never bakes
|
|
67
|
+
in a base URL as a default argument.
|
|
68
|
+
|
|
69
|
+
**The library logs, the entry point prints.** Modules under `EvalRing/` use
|
|
70
|
+
`get_logger(__name__)` and never call `print()` or configure the root logger.
|
|
71
|
+
Only `EvalRing/cli.py` and scripts under `examples/` call
|
|
72
|
+
`configure_logging()`. The one exception is machine-readable output the user
|
|
73
|
+
asked for, which goes to stdout via `print()` in the CLI.
|
|
74
|
+
|
|
75
|
+
**Optional dependencies stay optional.** `import EvalRing` must succeed with
|
|
76
|
+
only the core dependencies installed. Import `openai`, `litellm`, `matplotlib`,
|
|
77
|
+
and `nest_asyncio` inside the function that needs them, and raise an
|
|
78
|
+
`ImportError` naming the extra to install. CI enforces this in the
|
|
79
|
+
`minimal-install` job.
|
|
80
|
+
|
|
81
|
+
## Code style
|
|
82
|
+
|
|
83
|
+
- Formatting and linting are ruff's job; do not hand-format around it.
|
|
84
|
+
- Public functions, classes, and methods need a docstring with `Args:`,
|
|
85
|
+
`Returns:`, and `Raises:` sections where they apply. Docstrings render in
|
|
86
|
+
Pylance, so keep the argument names accurate.
|
|
87
|
+
- Annotate public signatures. `EvalRing.config`, `EvalRing.logging_utils`, and
|
|
88
|
+
`EvalRing.cli` are checked under stricter mypy settings; new modules should
|
|
89
|
+
be added to that override list in `pyproject.toml` once they are fully typed.
|
|
90
|
+
- Do not reference previous versions of the code in comments. Comments explain
|
|
91
|
+
what the code does now and why, not what it used to be.
|
|
92
|
+
|
|
93
|
+
## Documentation is part of the change
|
|
94
|
+
|
|
95
|
+
Docs ship with the code so that a reader — human or agent — can trust them
|
|
96
|
+
without reading the source. A change that alters behaviour is not complete
|
|
97
|
+
until the affected document is updated in the same pull request:
|
|
98
|
+
|
|
99
|
+
| If you change | Update |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| Architecture, components, data flow | [`docs/DESIGN_SPEC.md`](docs/DESIGN_SPEC.md) and bump its version |
|
|
102
|
+
| Environment variables, provider resolution | [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md) |
|
|
103
|
+
| The public Python API | [`docs/API_REFERENCE.md`](docs/API_REFERENCE.md) |
|
|
104
|
+
| CLI flags or subcommands | [`docs/CLI.md`](docs/CLI.md) |
|
|
105
|
+
| How runs are operated | [`docs/USAGE.md`](docs/USAGE.md) |
|
|
106
|
+
| Anything user-visible | [`CHANGELOG.md`](CHANGELOG.md) under `Unreleased` |
|
|
107
|
+
|
|
108
|
+
[`AGENTS.md`](AGENTS.md) is the entry point for coding agents working in this
|
|
109
|
+
repository; keep it pointing at the right documents.
|
|
110
|
+
|
|
111
|
+
## Data and secrets
|
|
112
|
+
|
|
113
|
+
- Never commit an API key. Credentials come from the environment or a local
|
|
114
|
+
`.env`, both of which are gitignored. See [`.env.example`](.env.example).
|
|
115
|
+
- Never commit a dataset you do not have redistribution rights to. Datasets
|
|
116
|
+
used by examples are documented in [`docs/DATA.md`](docs/DATA.md) with their
|
|
117
|
+
source and licence; add an entry there before adding data.
|
|
118
|
+
- The suicide-detection and clinical examples involve sensitive material. Read
|
|
119
|
+
[`docs/DATA.md`](docs/DATA.md) before working on them.
|
|
120
|
+
|
|
121
|
+
## Pull requests
|
|
122
|
+
|
|
123
|
+
1. Branch from `main`.
|
|
124
|
+
2. Keep the change focused; unrelated formatting churn makes review harder.
|
|
125
|
+
3. Add or update tests covering the behaviour you changed.
|
|
126
|
+
4. Update the documents listed above.
|
|
127
|
+
5. Make sure the four checks pass locally.
|
|
128
|
+
|
|
129
|
+
Commits do not need to follow a strict convention, but a subject line that
|
|
130
|
+
names the behaviour that changed helps the changelog.
|
|
131
|
+
|
|
132
|
+
## Reporting bugs and requesting features
|
|
133
|
+
|
|
134
|
+
Open an issue using the templates under
|
|
135
|
+
[`.github/ISSUE_TEMPLATE`](.github/ISSUE_TEMPLATE). For anything with security
|
|
136
|
+
implications, follow [`SECURITY.md`](SECURITY.md) instead of opening a public
|
|
137
|
+
issue.
|
evalring-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CoronRing
|
|
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,22 @@
|
|
|
1
|
+
# The sdist carries the documentation alongside the code, so anyone reading an
|
|
2
|
+
# unpacked release — a person or an agent — has the authoritative reference
|
|
3
|
+
# without needing the repository.
|
|
4
|
+
include LICENSE
|
|
5
|
+
include README.md
|
|
6
|
+
include CHANGELOG.md
|
|
7
|
+
include CONTRIBUTING.md
|
|
8
|
+
include CODE_OF_CONDUCT.md
|
|
9
|
+
include SECURITY.md
|
|
10
|
+
include AGENTS.md
|
|
11
|
+
include .env.example
|
|
12
|
+
include src/EvalRing/py.typed
|
|
13
|
+
recursive-include docs *.md
|
|
14
|
+
|
|
15
|
+
# Not part of a release: runnable examples, the test suite, and the vendored
|
|
16
|
+
# upstream benchmark checkout.
|
|
17
|
+
prune examples
|
|
18
|
+
prune tests
|
|
19
|
+
prune CounselBench
|
|
20
|
+
prune .github
|
|
21
|
+
prune .agent_temp
|
|
22
|
+
global-exclude __pycache__ *.py[cod] *.so .DS_Store
|