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

Uploaded Source

Built Distribution

patronus-0.0.6-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: patronus-0.0.6.tar.gz
  • Upload date:
  • Size: 15.6 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.6.tar.gz
Algorithm Hash digest
SHA256 f008c7114f4c4bdcfb1e6823d4ce8374b873e5cbf3069562e258cc920ee8c5b2
MD5 3b11c1e753c0d97d77e9756a1b86bdb2
BLAKE2b-256 0901e589bed1e1142504590498d9a3ab580eb02dcb1c44d437b913f846a79301

See more details on using hashes here.

File details

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

File metadata

  • Download URL: patronus-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 18.5 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0d6ef7db62e989ea2810c641e9dcffb85da3312ea1ae1cd3e83cd98e65ccf1a6
MD5 67c19b3e7041390e7d58612428888d84
BLAKE2b-256 c8c1d6cb77b57eae21d34d735d213f5b5712a6927f287daad1cf547c5962d119

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