pytest for LLMs
Project description
prompttest
pytest for LLMs.
You wouldn't ship code without tests. ✋😮🤚
Hold your prompts to the same standard. 😎👌🔥
Features
-
🔤 Test in Plain English: Write your tests in English, and let an AI grade the response.
-
🚀 Write Tests Faster: Just list your inputs and criteria in a simple file—no code needed.
-
🔓 Avoid Vendor Lock-in: Test against any LLM with a single, free OpenRouter API key.
Quick Start
1. Install prompttest
pip install prompttest
2. Set up prompttest
prompttest init
3. Run your tests
prompttest
How It Works
prompttest is built around 2 types of files:
Prompt
A .txt file for your prompt template with ---[SECTIONS]--- and {variables}.
Example: prompts/customer_service.txt
---[SYSTEM]---
You are an expert on the "{product_name}".
Your responses must be helpful and polite.
---[USER]---
Customer tier: {user_tier}
Customer query: {user_query}
Test
A .yml file for test cases with config, inputs and criteria.
Example: prompttests/test_customer_service.yml
config:
prompt: customer_service
tests:
- id: check-simple-greeting
inputs:
product_name: "Chrono-Watch"
user_tier: "Standard"
user_query: "Hello"
criteria: "The response must be a simple, polite greeting."
Advanced Usage
Run all tests in a folder
prompttest run folder_name/
Run all tests in a file
prompttest run file_name.yml
Run specific test
prompttest run test_id
Contributing
We're building the pytest for LLMs—and we need your help.
Report a bug, propose a feature, or contribute a single line.
Help shape a foundational tool for AI development.
License
This project is licensed under the MIT License.
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
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 prompttest-0.2.0.tar.gz.
File metadata
- Download URL: prompttest-0.2.0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a872b498efcc7a8b8dd391fb20644b0b3d103e05b07866063b386aa044be5729
|
|
| MD5 |
a7b5d235103e2b02a6ae684530098c2a
|
|
| BLAKE2b-256 |
5c482543daa3ec035670922be1325bbf25385baa847cbe323d8405782eaebce1
|
Provenance
The following attestation bundles were made for prompttest-0.2.0.tar.gz:
Publisher:
publish.yml on decodingchris/prompttest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prompttest-0.2.0.tar.gz -
Subject digest:
a872b498efcc7a8b8dd391fb20644b0b3d103e05b07866063b386aa044be5729 - Sigstore transparency entry: 423501712
- Sigstore integration time:
-
Permalink:
decodingchris/prompttest@6222973bc66c6bcc84d0a60c8a43f78ed13804b5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/decodingchris
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6222973bc66c6bcc84d0a60c8a43f78ed13804b5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file prompttest-0.2.0-py3-none-any.whl.
File metadata
- Download URL: prompttest-0.2.0-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d33a7be58990e990215f4330b5902ef874bef3f655015d3e1a5e12af854e41c9
|
|
| MD5 |
9db8db93e8fdadbf8ac2956ff0eb569e
|
|
| BLAKE2b-256 |
535435d2c69c9e31e2bf3b57f8638d787f5db3d47f07906a2b08a7d0ac47f402
|
Provenance
The following attestation bundles were made for prompttest-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on decodingchris/prompttest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prompttest-0.2.0-py3-none-any.whl -
Subject digest:
d33a7be58990e990215f4330b5902ef874bef3f655015d3e1a5e12af854e41c9 - Sigstore transparency entry: 423501745
- Sigstore integration time:
-
Permalink:
decodingchris/prompttest@6222973bc66c6bcc84d0a60c8a43f78ed13804b5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/decodingchris
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6222973bc66c6bcc84d0a60c8a43f78ed13804b5 -
Trigger Event:
release
-
Statement type: