Skip to main content

ParametricBench

PyPI License: MPL 2.0

Catch LLM and VLM regressions by running the same evaluation cases across configurable prompts, models, and generation settings.

ParametricBench is a lightweight, provider-independent test runner for validating model behavior with plain Python. Use it to compare configurations, test prompt changes, validate text or multimodal responses, and run repeatable model checks locally or in CI.

Installation

pip install parametricbench

Usage

Run several checks in one benchmark while keeping case-specific expectations and settings together:

from parametricbench import benchmark


def model(prompt, temperature=0):
    return prompt.upper()


def contains_expected(response, case):
    return case["expected"] in response


cases = [
    {"name": "uppercase-greeting", "input": "hello", "expected": "HELLO"},
    {
        "name": "uppercase-question",
        "input": "how are you?",
        "expected": "HOW ARE YOU?",
        "params": {"temperature": 0.2},
    },
    {
        "name": "contains-keyword",
        "input": "parametric benchmarks",
        "expected": "BENCHMARKS",
    },
]

report = benchmark(
    target=model,
    cases=cases,
    evaluators=[contains_expected],
    params={"temperature": 0},
)

print(f"Passed: {report['passed_count']}/{report['total']}")
for result in report["results"]:
    print(result["name"], result["passed"], result["score"])

Why ParametricBench?

Model behavior can change when prompts, providers, models, retrieved context, or generation settings change. Manual checks are difficult to reproduce and easy to forget. ParametricBench turns them into reusable Python benchmarks for development, automated tests, production checks, and CI.

It is intentionally smaller than a complete evaluation platform:

  • No provider lock-in or required model SDK
  • No server, database, dashboard, or configuration language
  • No runtime dependencies or infrastructure to deploy

Use it when an ad hoc script is too fragile but a full evaluation platform is unnecessary.

Compare configurations

report = benchmark(
    target=model,
    cases=cases,
    variants=[
        {"name": "deterministic", "params": {"temperature": 0}},
        {"name": "creative", "params": {"temperature": 0.8}},
    ],
    evaluators=[contains_expected],
)

Each case runs once with every named variant. Parameters are merged without mutation in this order: global, then variant, then case-specific parameters, with later values taking precedence.

Custom evaluators

Evaluators receive the response and complete benchmark case:

def exact_match(response, case):
    return response == case["expected"]

They may return a boolean or a numeric score from 0.0 to 1.0. Multiple scores are averaged. Without evaluators, a successful target call scores 1.0; a target error scores 0.0. Target and evaluator errors are captured without stopping later cases.

LLM and VLM inputs

Inputs can be any Python value:

case = {
    "input": {"image": "traffic-light.png", "prompt": "Which object is shown?"},
    "expected": "traffic light",
}

ParametricBench passes the value to your target without loading or interpreting it.

Use cases

  • Detect regressions after prompt or model changes
  • Compare model versions, providers, temperatures, or environments
  • Validate structured, text, and multimodal responses
  • Reuse the same checks in development, production, and CI

Features

  • Any Python callable and arbitrary inputs
  • Global, variant, and case parameters
  • Boolean or numeric evaluators and configurable thresholds
  • Ordered dictionary reports with timing and concise errors
  • No runtime dependencies

Issues

Report issues at https://github.com/edujbarrios/parametricbench.

Author

Eduardo J. Barrios — edujbarrios@outlook.com

License

Mozilla Public License 2.0

Release files for parametricbench 0.1.0

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

Source distribution (sdist)

Source distribution for parametricbench 0.1.0
File Size Uploaded
parametricbench-0.1.0.tar.gz 12.8 kB Details

Built distribution (wheel)

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

Total release size: 23.7 kB

Release files / parametricbench-0.1.0.tar.gz

Download URL parametricbench-0.1.0.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cb18b4c828345a8fc74fa581cb7aec5525e5a8c0b8f0150e140f79fb9f9fede5
BLAKE2b-256 checksum
How to use checksums
59fa565622bfcbb968b8c0ac0bf2b6e0ff4f1629ed35a13339126e0ac7617fe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / parametricbench-0.1.0-py3-none-any.whl

Download URL parametricbench-0.1.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0666f5d81f1cc7cf1a122a8ab737e0ab77dd1005a47a21e6d97deec2270a26f
BLAKE2b-256 checksum
How to use checksums
1e5f8b8451db350a33baca424e9bee671ea3839e3475b32328567b9e14ce7644
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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