Skip to main content

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:

  1. pip install testrelic-deepeval
  2. testrelic login
  3. Remove CONFIDENT_API_KEY from CI
  4. 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testrelic_deepeval-0.1.4.tar.gz (348.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testrelic_deepeval-0.1.4-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file testrelic_deepeval-0.1.4.tar.gz.

File metadata

  • Download URL: testrelic_deepeval-0.1.4.tar.gz
  • Upload date:
  • Size: 348.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for testrelic_deepeval-0.1.4.tar.gz
Algorithm Hash digest
SHA256 bdc1ad249108ef54f378565eba79a0f9b7566535562bfef43b7a924a10b351f0
MD5 12b5732a81ba4f082407fa152dc3af19
BLAKE2b-256 94618d49a885b24d07239b8da4e668a42369ec44a65060b24d86392d7d1e2b27

See more details on using hashes here.

Provenance

The following attestation bundles were made for testrelic_deepeval-0.1.4.tar.gz:

Publisher: publish-prod.yml on testrelic-ai/testrelic-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file testrelic_deepeval-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for testrelic_deepeval-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6a45df236379e2b6a93fd9cb5534718a559559fff717285157679ec5ec7252f5
MD5 275eb8191f1b1cccca5b35b4fe8594e7
BLAKE2b-256 9bf6560c04368d592d5be1c7d346391fe29b019479a06d2c4cff9d0b347b5d03

See more details on using hashes here.

Provenance

The following attestation bundles were made for testrelic_deepeval-0.1.4-py3-none-any.whl:

Publisher: publish-prod.yml on testrelic-ai/testrelic-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page