This library provides a collection of classes and functions to evaluate and compare different large language models (LLMs). The main purpose of the library is to build chatbots and evaluate their responses based on given objectives.
-
LanguageModelWrapper A base class for wrapping different language models.
-
Prompt A class for managing prompt templates.
-
BinaryPreference A class for managing binary preferences between two different responses.
-
BinaryEvaluator A base class for evaluating binary preferences between two different responses.
-
GPT35Evaluator A class for evaluating binary preferences using the GPT-3.5 LLM.
-
OpenAIModel An enumeration class for listing available OpenAI LLM models.
-
OpenAIGPTWrapper A class for wrapping OpenAI's GPT models.
-
ClaudeWrapper A class for wrapping Anthropic's Claude LLM.
-
CohereWrapper A class for wrapping Cohere's LLM.
-
GrokWrapper A class for wrapping Grok's models.
-
MistralWrapper A class for wrapping Mistral's models.
-
DeepSeekWrapper A class for wrapping DeepSeek's models.
-
Llama3Wrapper A class for wrapping Llama 3 models via DeepInfra.
-
ChatBot A class for creating chatbot instances based on provided LLMs.
- Install all from requirements.txt
pip install -r requirements.txt- Create a
.envfile in the root of the project and add the following API keys:
OPENAI_API_KEY=your_openai_api_key
COHERE_API_KEY=your_cohere_api_key
GROK_API_KEY=your_grok_api_key
MISTRAL_API_KEY=your_mistral_api_key
DEEPSEEK_API_KEY=your_deepseek_api_key
DEEPINFRA_API_KEY=your_deepinfra_api_key
The main.py script provides an example of how to use the library. It initializes all the supported models, defines an objective, and then runs a series of evaluations comparing each model to GPT-3.5.
To run the example:
python main.py