Skip to main content

llm-compare

PyPI License

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:

  1. Send the prompt to multiple models in parallel
  2. Gather their responses
  3. Use an evaluator model to analyze and compare the responses
  4. 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:

  1. Individual responses from each model
  2. Detailed comparison and analysis
  3. Scores for each response
  4. Key points of agreement and disagreement
  5. 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.

Metadata

Release files for llm-compare 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-compare 0.1.0
File Size Uploaded Provenance
llm_compare-0.1.0.tar.gz 7.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-compare 0.1.0
File Interpreter ABI Platform
llm_compare-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.4 kB

Release files / llm_compare-0.1.0.tar.gz

Download URL llm_compare-0.1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d3bc8b0b5382536d8095f8c76e0b643d0dbcfb0af284157531272d039074015d
BLAKE2b-256 checksum
How to use checksums
0b2ad4dd67ee87957fff39aed4ddff6d02b960322ec0f46827241c2d929ba477
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / llm_compare-0.1.0-py3-none-any.whl

Download URL llm_compare-0.1.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
023b3c585ebcdc52e30793bb35a37aa8ebccda5a212998ea48ddfd26262d691d
BLAKE2b-256 checksum
How to use checksums
0f7804a9062d1a73294c54624ea13997e2f83aedfc75c9890034b63631a7999f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Security for llm-compare 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page