Skip to main content

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


Download files

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

Source Distribution

llm_test_harness-0.1.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

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

llm_test_harness-0.1.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

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

Hashes for llm_test_harness-0.1.0.tar.gz
Algorithm Hash digest
SHA256 25f9dd1a4297885f56285c56bee1f1887a160a574cfa4de14b6f3e52fa0d90d3
MD5 bbe098b55cabfe73541fb47357654d93
BLAKE2b-256 1b87e1c259e175276e26fb50cee00cce0fb6836728ebd23dd37cc7357c099343

See more details on using hashes here.

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

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

File details

Details for the file llm_test_harness-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_test_harness-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e87c2e0d4b203306e5825a4cb53f34e4c807775e81df40f4cda670821f3ee03
MD5 3beeb6d92b04fb10dd978a2f1b5eea5c
BLAKE2b-256 dbc00504a0f8c457e1c63cdcde1f1f5cbdc0fa6ae228c26c7d281e4fda9ead8c

See more details on using hashes here.

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

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page