Skip to main content

Compare responses from different LLMs to the same prompt

Project description

Optimus Prompt 🤖

Compare responses from different Language Learning Models (LLMs) to the same prompt.

Features

  • Support for multiple LLM providers:
    • OpenAI (GPT-3.5, GPT-4)
    • Anthropic (Claude)
  • Simple prompt input via text file
  • Human-readable output format
  • Easy to extend with new providers

Installation

pip install optimus-prompt

Quick Start

  1. Create a prompt.txt file with your prompt:
Explain quantum computing in simple terms
  1. Set up your API keys in a .env file:
OPENAI_API_KEY=your_openai_key_here
ANTHROPIC_API_KEY=your_anthropic_key_here
  1. Run Prompt Prism:
from optimus_prompt.core import Prompt
from optimus_prompt.providers import OpenAIProvider, AnthropicProvider
from optimus_prompt.core import ResponseWriter

# Initialize providers
providers = [
    OpenAIProvider(model="gpt-4"),
    AnthropicProvider(model="claude-3")
]

# Read prompt from file
with open("prompt.txt", "r") as f:
    prompt_text = f.read().strip()
prompt = Prompt(prompt_text)

# Collect responses
responses = []
for provider in providers:
    response = provider.generate(prompt)
    responses.append(response)

# Write responses to file
writer = ResponseWriter("output.txt")
writer.write(prompt, responses)

Development

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/optimus-prompt.git
cd optimus-prompt
  1. Install Poetry (if not already installed):
pip install poetry
  1. Install dependencies:
poetry install

Running Tests

poetry run pytest

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

optimus_prompt-0.1.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optimus_prompt-0.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file optimus_prompt-0.1.0.tar.gz.

File metadata

  • Download URL: optimus_prompt-0.1.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.11.0-24-generic

File hashes

Hashes for optimus_prompt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4bf277843c9e92abc7f7f5a9dfec3b906fe18940719ae2b21e9cc52b27dc0c9c
MD5 bc68030ffe511e05ec1343ec08e29adc
BLAKE2b-256 a975233f2ff572d76138f67522925c98b8cc124b6f6f3b5a6e794f1d0b6cfbe6

See more details on using hashes here.

File details

Details for the file optimus_prompt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: optimus_prompt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.11.0-24-generic

File hashes

Hashes for optimus_prompt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00c9cdb0037d209b22c4fb1025bba1dd86f584a7701cf63eb765e5814187f0a9
MD5 9bb162956fe1735b98900148c7451d20
BLAKE2b-256 c122400256cba084603d096c2132f49089f5212b4dfd42692062a0316c0351e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page