Deterministic testing framework for LLM-powered apps — record/replay cassettes, eval scoring, regression testing
Project description
llm-test-harness
Deterministic testing framework for LLM-powered apps — record/replay cassettes, eval scoring, and regression testing.
Installation
pip install llm-test-harness
pip install "llm-test-harness[anthropic]" # with Anthropic support
pip install "llm-test-harness[openai]" # with OpenAI support
Quick Start
from llm_test_harness import Harness, Metrics
import anthropic
harness = Harness(cassettes_dir='./cassettes', mode='replay')
client = harness.wrap(anthropic.Anthropic())
response = client.messages.create(
model='claude-haiku-4-5-20251001',
max_tokens=100,
messages=[{'role': 'user', 'content': 'Say hello.'}]
)
result = harness.evaluate(response.content[0].text, [
Metrics.contains('hello'),
])
assert result.passed
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 llm_test_harness-0.1.0.tar.gz.
File metadata
- Download URL: llm_test_harness-0.1.0.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25f9dd1a4297885f56285c56bee1f1887a160a574cfa4de14b6f3e52fa0d90d3
|
|
| MD5 |
bbe098b55cabfe73541fb47357654d93
|
|
| BLAKE2b-256 |
1b87e1c259e175276e26fb50cee00cce0fb6836728ebd23dd37cc7357c099343
|
Provenance
The following attestation bundles were made for llm_test_harness-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on piyushgupta344/llm-test-harness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_test_harness-0.1.0.tar.gz -
Subject digest:
25f9dd1a4297885f56285c56bee1f1887a160a574cfa4de14b6f3e52fa0d90d3 - Sigstore transparency entry: 1109851338
- Sigstore integration time:
-
Permalink:
piyushgupta344/llm-test-harness@816e05e9396325828c4b5933f088b89f90eb5aa5 -
Branch / Tag:
refs/tags/py-v0.1.0 - Owner: https://github.com/piyushgupta344
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@816e05e9396325828c4b5933f088b89f90eb5aa5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file llm_test_harness-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llm_test_harness-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e87c2e0d4b203306e5825a4cb53f34e4c807775e81df40f4cda670821f3ee03
|
|
| MD5 |
3beeb6d92b04fb10dd978a2f1b5eea5c
|
|
| BLAKE2b-256 |
dbc00504a0f8c457e1c63cdcde1f1f5cbdc0fa6ae228c26c7d281e4fda9ead8c
|
Provenance
The following attestation bundles were made for llm_test_harness-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on piyushgupta344/llm-test-harness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_test_harness-0.1.0-py3-none-any.whl -
Subject digest:
0e87c2e0d4b203306e5825a4cb53f34e4c807775e81df40f4cda670821f3ee03 - Sigstore transparency entry: 1109851342
- Sigstore integration time:
-
Permalink:
piyushgupta344/llm-test-harness@816e05e9396325828c4b5933f088b89f90eb5aa5 -
Branch / Tag:
refs/tags/py-v0.1.0 - Owner: https://github.com/piyushgupta344
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@816e05e9396325828c4b5933f088b89f90eb5aa5 -
Trigger Event:
push
-
Statement type: