testrelic-deepeval
The TestRelic Python SDK for DeepEval. Capture LLM evaluation results from your existing DeepEval test suite and ship them to your TestRelic workspace in one line of install.
pip install testrelic-deepeval
testrelic login
deepeval test run tests/
That's it. The pytest plugin captures DeepEval's in-memory TestRun at session finish
and uploads cases + metrics to TestRelic's /api/v1/evals/* endpoints.
What this is (and isn't)
- Is: a pytest plugin + Python client for sending DeepEval results to TestRelic
- Is: a drop-in
testrelic.evaluate()wrapper for programmatic eval runs - Is: a CLI (
testrelic login,testrelic test,testrelic view) - Is not: a replacement for DeepEval (use DeepEval to author tests; we just receive the results)
- Is not: a Confident AI proxy — we use TestRelic's own API, not Confident's
Install
pip install testrelic-deepeval # core
pip install "testrelic-deepeval[deepeval]" # also pull deepeval if not already installed
pip install "testrelic-deepeval[otel]" # OTel tracing (Phase 4, preview)
Supported Python versions: 3.9, 3.10, 3.11, 3.12.
Authenticate
testrelic login --api-key tr_yourkey_here
Credentials are stored at ~/.testrelic/credentials.toml with 0600 permissions on
POSIX. Or pass credentials via environment:
export TESTRELIC_API_KEY=tr_yourkey
export TESTRELIC_BASE_URL=https://platform.testrelic.ai/api/v1/evals # only override if self-hosted
Precedence (highest to lowest): explicit configure() args → env vars → credentials
file → built-in defaults.
Use with pytest
No code changes needed. After install + login:
deepeval test run tests/
# or, if you want the wrapper that double-checks credentials:
testrelic test tests/
Every test run uploads as a new eval run in TestRelic, annotated with the current branch, commit, and CI run URL (auto-detected for GitHub Actions, GitLab, Jenkins, CircleCI, and Buildkite).
Use programmatically
from deepeval.test_case import LLMTestCase
from deepeval.metrics import AnswerRelevancyMetric
from testrelic import evaluate
results = evaluate(
test_cases=[LLMTestCase(input="Hi", actual_output="Hello")],
metrics=[AnswerRelevancyMetric(threshold=0.7)],
)
# results is whatever deepeval.evaluate() returns; upload is automatic
Datasets
from testrelic import datasets
# Pull a dataset version into a deepeval EvaluationDataset
ds = datasets.pull("customer-support-qa", label="latest")
# Push goldens up to a new version
datasets.push(
alias="customer-support-qa",
goldens=[{"input": "...", "expected_output": "..."}],
label="v2",
description="Refreshed Q1 2026 examples",
)
Migrating from Confident AI
See docs/migration-from-confident-ai.md. The TL;DR is:
pip install testrelic-deepevaltestrelic login- Remove
CONFIDENT_API_KEYfrom CI - Run your existing tests unchanged
Or, in one shot: testrelic migrate-from-confident.
Offline / flaky networks
Failed uploads land in ~/.testrelic/queue/. Replay them with:
testrelic drain
The plugin never fails your test run because of an upload error — uploads run at
pytest_sessionfinish(trylast=True) and swallow exceptions with a warning log.
CLI
| Command | Purpose |
|---|---|
testrelic login |
Save credentials |
testrelic logout |
Remove credentials |
testrelic test <path> |
Wrap deepeval test run with credential check |
testrelic view [run_id] |
Open latest (or specific) eval run in browser |
testrelic drain |
Replay queued offline uploads |
testrelic version |
Print SDK version |
testrelic migrate-from-confident |
Print migration steps |
Development
git clone https://github.com/testrelic-ai/testrelic-python-sdk
cd testrelic-python-sdk
pip install -e ".[dev]"
ruff check src tests
mypy src/testrelic
pytest
License
GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See LICENSE.
Note for integrators: AGPL-3.0 is a strong copyleft license. If you distribute or run a modified version of this SDK as part of a network service, the AGPL's network-use clause requires you to make the corresponding source available to users of that service. If you only use the SDK as a library to upload results to TestRelic, you are not distributing or modifying it and the AGPL terms do not encumber your application code.
Metadata
Release files for testrelic-deepeval 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| testrelic_deepeval-0.1.4.tar.gz | 348.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| testrelic_deepeval-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 390.0 kB
Release files / testrelic_deepeval-0.1.4.tar.gz
| Download URL | testrelic_deepeval-0.1.4.tar.gz |
|---|---|
| Size | 348.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bdc1ad249108ef54f378565eba79a0f9b7566535562bfef43b7a924a10b351f0
|
|
BLAKE2b-256 checksum How to use checksums |
94618d49a885b24d07239b8da4e668a42369ec44a65060b24d86392d7d1e2b27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.
Transparency logRelease files / testrelic_deepeval-0.1.4-py3-none-any.whl
| Download URL | testrelic_deepeval-0.1.4-py3-none-any.whl |
|---|---|
| Size | 41.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a45df236379e2b6a93fd9cb5534718a559559fff717285157679ec5ec7252f5
|
|
BLAKE2b-256 checksum How to use checksums |
9bf6560c04368d592d5be1c7d346391fe29b019479a06d2c4cff9d0b347b5d03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.
Transparency log