Skip to main content

LLM Tests

Summary

This package aims to make LLM testing easier and repeatable.

The primary intention is for testing LLM memory solutions like RAG, but the functionality can be used for other purposes as well. Including tool testing.

Test files are stored as JSON using the following template.

The following example explains most of the functionality of the template.

{
    "setups": [
        {
            "summary": "An optional summary of the prior conversations",
            "prior_conversations": [
                [{
                    "role": "user",
                    "content": "My name is User"
                },
                {
                    "role": "assistant",
                    "content": "Hi User"
                }
                ],
                [{
                    "role": "user",
                    "content": "Do you know my name"
                },
                {
                    "role": "assistant",
                    "content": "This is a new context, I can only remember across contexts with external tools"
                }]
            ]
        }
    ], 
    "tests" : [
        {
            "summary": "An optional summary for this test",
            "case_sensitive": false,
            "ignoring_thinking": true,
            "messages": [{
                    "role": "system",
                    "content": "Respond only with the word Hello"
                }],
            "expected_response": "Hello"
        },
        {
            "messages": [{
                    "role": "system",
                    "content": "Respond only with the user's name"
                }],
            "expected_response": "User"
        }
    ]
}
# Here is a simple inefficient example
import llmtests
import ollama

def chatfn(messages):
    resp = ollama.chat(model='deepseek-r1:8b', messages=messages)
    return resp["message"]

def resetMemory(context_reset, memory_reset):
    if memory_reset:
        # Reset Database. E.g. wipe everything
        pass
    if context_reset:
        pass
        # Reset context of current conversation

results = llmtests.test_all(chatfn, resetMemory)
report = llmtests.test_results_as_text_report(results)
print("Score:",report["pass_count"],"/",report["test_count"])

if report["failed_report"]:
    print("Failed tests")
    print(report["failed_report"])
else:
    print("No failed tests")

Metadata

Release files for llmtests 0.0.16.281

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llmtests 0.0.16.281
File Size Uploaded Provenance
llmtests-0.0.16.281.tar.gz 18.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llmtests 0.0.16.281
File Interpreter ABI Platform
llmtests-0.0.16.281-py3-none-any.whl Python 3 none any Details

Total release size: 36.6 kB

Release files / llmtests-0.0.16.281.tar.gz

Download URL llmtests-0.0.16.281.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8769b6023f1d2bbfc92b587647b9f301bdd919a087baae1fc06127b28d5b46a1
BLAKE2b-256 checksum
How to use checksums
5ada6c4a1a48800a5f4c514cd6a386684f3efd53f37fa4f92a73cb435dd56ac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Sep 4, 2025.

Transparency log

Release files / llmtests-0.0.16.281-py3-none-any.whl

Download URL llmtests-0.0.16.281-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cbc6e87ba37e0b26a9589ff69d9b9f6514b897f8060009626a3ff8a24d14540
BLAKE2b-256 checksum
How to use checksums
2a6eb1b2a3f3b25b5cae1bba3b4ce351bfc0f73322e2b00b6afe6afa3a12734e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Sep 4, 2025.

Transparency log

Security for llmtests 0.0.16.281

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llmtests-0.0.16.281.tar.gz

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 Sep 4, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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