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

Uploaded Source

Built Distribution

patronus-0.0.2-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: patronus-0.0.2.tar.gz
  • Upload date:
  • Size: 13.5 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.2.tar.gz
Algorithm Hash digest
SHA256 add1be9b72947760b1ad40ea6de56b1403d97319a0a1f26c10b3f23a81f74fc3
MD5 d337769dc350e352dc9bc351d0550686
BLAKE2b-256 49c9fa77b49ceeacc2a1b14905e386a785f9714a6ea574cbb1a6afb0b39d48cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: patronus-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9b521e38301ec0b6d9d0e7404bc9c3a31a3ec0c966b5d6e0eaa2a4a86072269
MD5 b308e93913f925052841b894878c6a75
BLAKE2b-256 b8060a0f52679cd1599e9b616e5f023d344768a17d4e1da1b1dbf4c01089869c

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