Skip to main content

No project description provided

Project description

Patronus LLM Evaluation library

Patronus is a Python library developed by Patronus AI that provides a robust framework and utility functions for evaluating Large Language Models (LLMs). This library simplifies the process of running and scoring evaluations across different LLMs, making it easier for developers to benchmark model performance on various tasks.

Note: This library is currently in beta and is not stable. The APIs may change in future releases.

Note: This library requires Python 3.11 or greater.

Features

  • Modular Evaluation Framework: Easily plug in different models and evaluation/scoring mechanisms.
  • Seamless Integration with Patronus AI Platform: Effortlessly connect with the Patronus AI platform to run evaluations and export results.
  • Custom Evaluators: Use built-in evaluators, create your own based on various scoring methods, or leverage our state-of-the-art remote evaluators.

Documentation

For detailed documentation, including API references and advanced usage, please visit our documentation.

Installation

To get started with Patronus, clone the repository and install the package using Poetry:

git clone https://github.com/patronus-ai/patronus-py
cd patronus-py
poetry install

Usage

Prerequisites

Before running any examples, make sure you have the following API keys:

  • Patronus AI API Key: Required for all examples.
  • OpenAI API Key: Required for some examples that utilize OpenAI's services.

You can set these keys as environment variables:

export PATRONUSAI_API_KEY=<YOUR_PATRONUSAI_API_KEY>
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>

Running Examples

Patronus comes with several example scripts to help you understand how to use the library. These examples can be found in the examples directory.

Note: Some examples require additional dependencies. For instance:

  • If you are using an evaluator that depends on the Levenshtein scoring method, you need to install the Levenshtein package:

    pip install Levenshtein
    
  • If you are using examples that integrate with OpenAI, you need to install the openai package:

    pip install openai
    

You can then run an example script like this:

python examples/ex_0_hello_world.py

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

patronus-0.0.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

patronus-0.0.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file patronus-0.0.1.tar.gz.

File metadata

  • Download URL: patronus-0.0.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.4 Darwin/23.4.0

File hashes

Hashes for patronus-0.0.1.tar.gz
Algorithm Hash digest
SHA256 65d8afac46ec4d0ec7d4599221bb736dc2cbe92eba01fcfc01df6323949fec96
MD5 5b56cc7d3fc354ddc62a3a7632f08005
BLAKE2b-256 08d3cc1c998651548150b49ab2b0ffd1c74c73e1be86dc0ef29f09a32771057b

See more details on using hashes here.

File details

Details for the file patronus-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: patronus-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.4 Darwin/23.4.0

File hashes

Hashes for patronus-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d308ed7c140569e052036ae35f1872efdda64597a61890aafb7741eab9a536b5
MD5 4850eceea128d749e7d167e6ff4fae55
BLAKE2b-256 66f0fac45674de4df48fd300cb49253958f54cd51be6e020b2dda1f89768fb02

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page