PraisonAITest
A minimal and simple testing framework for Large Language Models (LLMs) using LiteLLM.
Installation
pip install PraisonAITest
For development installation:
pip install -e ./
Usage
from praisonaitest import Test
# Example with string validation
test1 = Test(model="openai/gpt-4o-mini", instruction="What is the capital of France?", validate="Paris")
result = test1.run()
print(f"Test result: {'Passed' if result['passed'] else 'Failed'}")
print(f"Response: {result['response']}")
print(f"Latency: {result['latency']:.2f} seconds")
print(f"Token usage: {result['token_usage']}")
# Example with a validation function
def validate_france_response(response):
"""Custom validator that checks if response mentions Paris and France"""
return "Paris" in response and "France" in response
# Create a test with function validation
test2 = Test(
model="openai/gpt-4o-mini",
instruction="Tell me about the capital of France",
validate=validate_france_response
)
result2 = test2.run()
Environment Variables
Create a .env file with your API keys:
# LiteLLM API Key (Required)
LITELLM_API_KEY=your_api_key_here
# Default OpenAI API Key (Optional, if using OpenAI models directly)
OPENAI_API_KEY=your_openai_api_key_here
License
This project is licensed under the MIT License.
Metadata
Release files for PraisonAITest 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| praisonaitest-0.0.1.tar.gz | 3.7 kB | Without provenance | Details for praisonaitest-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| praisonaitest-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for praisonaitest-0.0.1-py3-none-any.whl |
Total release size: 7.5 kB
Release files / praisonaitest-0.0.1.tar.gz
| Download URL | praisonaitest-0.0.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b06a2754fdb2fd143568146afde0187dc37c4c45572df3c66221d225320700c6
|
|
BLAKE2b-256 checksum How to use checksums |
3bf8bd66071a149454767aacd964f07e18dc534bfc236ea7540a0cb9503993f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.8
|
Release files / praisonaitest-0.0.1-py3-none-any.whl
| Download URL | praisonaitest-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4c2f566f289405364f4331f513a003823fc6889c8da41c9405844f00c604bc6
|
|
BLAKE2b-256 checksum How to use checksums |
a611d721863d574dd82f5c9af74e37a77a9fa49e31a6fd7c3ed6845e1be67087
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.8
|
Security for PraisonAITest 0.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.