Skip to main content

A command-line utility for quickly testing and interacting with various LLM APIs.

Project description

OmniPrompt

OmniPrompt is a command-line utility for quickly testing and interacting with various large language model (LLM) APIs from different providers. "Omni" reflects the tool's ability to connect to all different AI providers, and "Prompt" is the core action.

Features

  • Test prompts against multiple AI providers from a single interface.
  • Support for major providers: Google, OpenAI, Anthropic, Groq, and more.
  • List available models for each provider.
  • Generate images using Google's Imagen model.
  • Run a single prompt against all configured providers simultaneously.
  • Secure and discoverable API key configuration using environment variables.

Setup

  1. Clone the repository:

    git clone https://github.com/andkamau/omniprompt.git
    cd omniprompt
    
  2. Install the package: You can install OmniPrompt in editable mode for development:

    pip install -e .
    

    This will install all dependencies and create the omniprompt command.

  3. Configure API Keys: OmniPrompt reads API keys from environment variables. It looks for a config.yaml file in the following locations:

    • ~/.config/omniprompt/config.yaml
    • ~/.omniprompt.yaml
    • The current directory (./config.yaml)

    Step 1: Create your config file Copy the provided config.yaml to one of the locations above.

    Step 2: Set the Environment Variables Set the environment variables with your actual API keys as defined in your config.yaml.

    Example:

    export OPENAI_API_KEY="sk-..."
    export GOOGLE_API_KEY="AIza..."
    

Usage

Once installed, you can use the omniprompt command from anywhere.

Basic Prompt

omniprompt -P openai -m gpt-4o -p "What are the three laws of thermodynamics?"

List Available Models

omniprompt -l google

Image Generation

omniprompt -P google -i "A futuristic cityscape at sunset, digital art."

Test All Providers

python omniprompt.py -a -p "Write a haiku about a robot learning to paint."

Arguments

Full Argument Short Argument Description
--provider -P The API provider (e.g., google, openai).
--model -m The specific model to use (e.g., gpt-4o).
--prompt -p The text prompt to send to the model.
--list-models -l List available models for a given provider.
--generate-image -i The prompt for image generation.
--all-providers -a A flag to send a prompt to all configured providers.

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

omniprompt-1.0.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

omniprompt-1.0.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file omniprompt-1.0.0.tar.gz.

File metadata

  • Download URL: omniprompt-1.0.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for omniprompt-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dd66ca68e0b58c8e4b0554ac3fad3f7010fc611fd73646e924bb000698fb8658
MD5 e8cde4e3fdf94aad2b2831fa2e5aa707
BLAKE2b-256 48a7a13591de558197f82969f1ad51623786b08f23d6cf663764f1cf19e53cdc

See more details on using hashes here.

File details

Details for the file omniprompt-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: omniprompt-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for omniprompt-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21b00a719cc7df0b76a22a7486d4d7c9cab4b037be8485c87c8448e71210360e
MD5 2fa73428b37ac08deb648640360422f7
BLAKE2b-256 0d46a9f8815d0ff58c8779cf71dc96d3e679fe8d638e394b754423c5a3375369

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