LLM plugin to compare responses from multiple language models
Project description
llm-compare
LLM plugin to compare responses from multiple language models and evaluate their performance.
Installation
Install this plugin in the same environment as LLM:
llm install llm-compare
Usage
The plugin adds a new compare command that allows you to send the same prompt to multiple models and compare their responses:
llm compare "What are the key considerations for AI safety?"
This will:
- Send the prompt to multiple models in parallel
- Gather their responses
- Use an evaluator model to analyze and compare the responses
- Generate a synthesis of the best elements from each response
Options
-m, --models: Models to include in comparison (can specify multiple)--evaluator: Model to use as evaluator (default: gpt-4)--score-threshold: Minimum score threshold (default: 0.7)--output: Save full results to a JSON file--stdin/--no-stdin: Read additional input from stdin (default: True)
Examples
Basic usage with default models:
llm compare "Explain quantum computing"
Using specific models:
llm compare "Explain blockchain technology" \
-m gpt-4 \
-m claude-3-sonnet \
-m gemini-pro \
--evaluator claude-3-opus-20240229
Reading from a file:
cat prompt.txt | llm compare "Analysis request:"
Saving full results:
llm compare "Complex technical question" \
-m gpt-4 \
-m claude-3-opus \
--output results.json
Output Format
The command outputs:
- Individual responses from each model
- Detailed comparison and analysis
- Scores for each response
- Key points of agreement and disagreement
- A synthesized best answer
Development
To set up this plugin locally:
git clone https://github.com/yourusername/llm-compare
cd llm-compare
python -m venv venv
source venv/bin/activate
pip install -e '.[test]'
Run tests:
pytest
License
This project is licensed under the Apache License 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_compare-0.1.0.tar.gz.
File metadata
- Download URL: llm_compare-0.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3bc8b0b5382536d8095f8c76e0b643d0dbcfb0af284157531272d039074015d
|
|
| MD5 |
136b01db56a3dbb160812870dada88a3
|
|
| BLAKE2b-256 |
0b2ad4dd67ee87957fff39aed4ddff6d02b960322ec0f46827241c2d929ba477
|
File details
Details for the file llm_compare-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llm_compare-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
023b3c585ebcdc52e30793bb35a37aa8ebccda5a212998ea48ddfd26262d691d
|
|
| MD5 |
e78ca408687628f5a260210719d565a9
|
|
| BLAKE2b-256 |
0f7804a9062d1a73294c54624ea13997e2f83aedfc75c9890034b63631a7999f
|