TestRelic SDK for DeepEval - LLM evaluation results land in TestRelic instead of Confident AI.
Project description
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
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file testrelic_deepeval-0.1.0.tar.gz.
File metadata
- Download URL: testrelic_deepeval-0.1.0.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11003c1baa7c226f61e450a99fb2975707f06400e47fc398ea93fe363ffc4f6a
|
|
| MD5 |
f5b9683ccc9221fbfe380230fae051cd
|
|
| BLAKE2b-256 |
8947cdcc8fe910729813d4b153b70fc7dc48a7a02fba409322768b45f2b628d6
|
Provenance
The following attestation bundles were made for testrelic_deepeval-0.1.0.tar.gz:
Publisher:
publish-prod.yml on testrelic-ai/testrelic-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
testrelic_deepeval-0.1.0.tar.gz -
Subject digest:
11003c1baa7c226f61e450a99fb2975707f06400e47fc398ea93fe363ffc4f6a - Sigstore transparency entry: 1586839577
- Sigstore integration time:
-
Permalink:
testrelic-ai/testrelic-python-sdk@0623660e3e208d20bff56c8deac2115c8c0c90cf -
Branch / Tag:
refs/heads/prod - Owner: https://github.com/testrelic-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-prod.yml@0623660e3e208d20bff56c8deac2115c8c0c90cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file testrelic_deepeval-0.1.0-py3-none-any.whl.
File metadata
- Download URL: testrelic_deepeval-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a22b55ad0585e73df7bdce1dfac5bf8155830389003ef5eb4c7e419cad22ae42
|
|
| MD5 |
a376182158161e720c53d80d9957f037
|
|
| BLAKE2b-256 |
2a854454815b466241e8f493f93e7194efdc02d1b3aa24787daf025c0303e646
|
Provenance
The following attestation bundles were made for testrelic_deepeval-0.1.0-py3-none-any.whl:
Publisher:
publish-prod.yml on testrelic-ai/testrelic-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
testrelic_deepeval-0.1.0-py3-none-any.whl -
Subject digest:
a22b55ad0585e73df7bdce1dfac5bf8155830389003ef5eb4c7e419cad22ae42 - Sigstore transparency entry: 1586839633
- Sigstore integration time:
-
Permalink:
testrelic-ai/testrelic-python-sdk@0623660e3e208d20bff56c8deac2115c8c0c90cf -
Branch / Tag:
refs/heads/prod - Owner: https://github.com/testrelic-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-prod.yml@0623660e3e208d20bff56c8deac2115c8c0c90cf -
Trigger Event:
push
-
Statement type: