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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for patronus-0.0.7.tar.gz
Algorithm Hash digest
SHA256 4898b52a1aa92cc0a310251789e2740bb9edc7406363143a6ad3655003413a4f
MD5 81241bca629be2b5afb1e4ec0ecd3e80
BLAKE2b-256 b1474ef82e4981f72f79d1bacec2bee19c6881787002ad2d82502f8e83c6097b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: patronus-0.0.7-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.12.5 Darwin/23.4.0

File hashes

Hashes for patronus-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d2097550a45e77a5e0f2ff022f55fedd4e21d3a1d69758edff19dce7107f6552
MD5 265d8a152825efb784f062f565f0e7d4
BLAKE2b-256 bf1257a243858e16680e5571c74e33366439a7cd917d238a281dc371da665722

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