Skip to main content

A simple package for LLM application evaluation.

Project description

maibench Python SDK

Python toolings to help run evaluations on large langauge model chains.

Getting started

First, install the package.

pip install maibenchai

Next, create a completion function. This maps different inputs your LLM application response. Here's an example.

 from maibench import CompletionFn

 class ExampleCompletionFn(CompletionFn):
    @staticmethod
    def complete(**kwargs) -> str:
        return "This is an example response from an LLM application."

Next, create some text cases. These test cases should each contain the input kwargs of your completion function in additon to an expected output and a grade_fn. Supported grade functions are currently match, includes, fuzzy_match, not_match, not_includes, and not_fuzzy_match. More complex grading functions and model-based grading is coming soon.

EXAMPLE_TEST_CASES = [
    {
        "input": "This is an example input.",
        "expected": "This is an example response from an LLM application.",
        "grade_fn": "match",
    },
    {
        "input": "This is an example input 2.",
        "expected": "This is an example response from an LLM application.",
        "grade_fn": "match",
    },
]

Create and run.

EXAMPLE_TEST_SUITE = TestSuite(name="maibench.example_test_suite", completion_fn=ExampleCompletionFn, test_cases=EXAMPLE_TEST_CASES)
results, id = EXAMPLE_TEST_SUITE.run()

See results at https://maibench.ai/individual-result?id=[INSERT ID]

We hope you enjoy!

Contact support@maibench.ai with any questions.

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

maibenchai-0.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

maibenchai-0.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file maibenchai-0.2.tar.gz.

File metadata

  • Download URL: maibenchai-0.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for maibenchai-0.2.tar.gz
Algorithm Hash digest
SHA256 78725143e7e2916ab8d724f7d181a92ee9091ad09bab4b7c144300dbf46e3dd7
MD5 6bc1a42fa36a92ed60ef4b32099b2bbf
BLAKE2b-256 4f56dcad5909fcffc28d8ce647c0f4e3b0daabf09e8062620112ca1072e2f900

See more details on using hashes here.

File details

Details for the file maibenchai-0.2-py3-none-any.whl.

File metadata

  • Download URL: maibenchai-0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for maibenchai-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b4a0b978197a84c65f93fc32f23bbd5dc9a04f52c0be6b6038e406b8fd40be6
MD5 ff2798c70f84bad69b0100a5fdacfeae
BLAKE2b-256 226b76bb9800da29e1a148f4c9601dcef144e306297aa62ce6fe9c95c30aebb1

See more details on using hashes here.

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