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.3.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

patronus-0.0.3-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: patronus-0.0.3.tar.gz
  • Upload date:
  • Size: 14.4 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.3.tar.gz
Algorithm Hash digest
SHA256 a1f42fb47b0d39ac856fb0877b8ba47144f1b718476142e16b9163d29d054970
MD5 a9b1f9cd9b4d60a5c39e789e33bd9d3c
BLAKE2b-256 66694518cf90dac7d1f15fff664b610a51a14e5796b77f1b4c1091cc687fd64a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: patronus-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a1506005aeee5115527904c26c5a47f027beb7235d773d101e1bef20dc796357
MD5 7a5da4725477d85bf18d2a69d0322aa8
BLAKE2b-256 956f8e6bf139c0224c747fe857b3d9626c9cb7492c816b1b09870568c08844e7

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