Skip to main content

Tool designed to automate the generation, execution, and analysis of prompts for use in language learning models (LLMs). It simplifies the task of creating multiple prompts by automatically filling variables within a template, generating a Cartesian product of prompts, and analyzing the results returned by the model's API.

Project description

🤖 PromptBlender

A no-code tool for LLM prompt testing and experimentation at scale

Version Python License

🎯 What is PromptBlender?

PromptBlender is a no-code automation tool that simplifies how you test and optimize prompts for Large Language Models (LLMs). Instead of manually testing prompt variations one by one, PromptBlender automatically generates hundreds or thousands of prompt combinations, executes them against your chosen LLM, and provides comprehensive analysis of the results.

Perfect for researchers, data scientists, prompt engineers, and anyone who needs to systematically evaluate LLM performance across different scenarios.

✨ Key Features

🎲 Prompt Generation

  • Template-Based Approach: Create prompt templates with variables that get automatically filled
  • Cartesian Product Generation: Automatically generates all possible combinations of your parameters
  • Multiple Prompt Variants: Test different prompt formulations simultaneously

📊 Flexible Data Input

  • Multiple Formats: Excel (xlsx, xls), CSV, JSON/JSONL, plain text, PDF, DOCX, and images
  • Directory Loading: Bulk load data from entire directories
  • Dynamic Parameter Merging: Combine data from multiple sources

🔌 LLMs Support

  • OpenAI GPT Models: ChatGPT API integration with cost tracking
  • Groq Cloud: Lightning-fast inference with Llama models
  • Browser-Based Agents: Automated web interface interaction via BrowserUse
  • Plugin System: Easy integration with custom APIs and LLM applications

🔄 Execution Management

  • Multiple LLMs Execution: Execute multiple LLM configurations to compare results
  • Cache System: Avoid redundant API calls with caching
  • Batch Processing: Optimize API usage with batching

📈 Analysis & Reporting

  • Automated Results Processing: Built-in analysis modules for different response types
  • Cost Tracking: Budget monitoring and spend limits
  • Export & Sharing: Complete results packaging with historical tracking

🖥️ Dual Interface Options

  • Graphical User Interface (GUI): User-friendly graphical interface for interactive use
  • Command Line Interface (CLI): Command-line interface for automation and scripting

🚀 Quick Start

Prerequisites

  • Python 3.11+ (Required)
  • LLM API Access (OpenAI or Groq)

📦 Installation

Standard Installation

pip install prompt-blender

With Browser Automation Support

pip install "prompt-blender[browseruse]"

Current Development Version

pip install git+https://github.com/edanssandes/prompt-blender

🟢 Using Conda (Recommended)

Create an isolated environment for better dependency management:

# Create environment
conda create -n prompt-blender python=3.11

# Activate environment
conda activate prompt-blender

# Install PromptBlender
pip install prompt-blender

Linux Users

Install wxPython with conda before installing prompt-blender:

conda install wxpython

💻 Usage

🖥️ Graphical User Interface (GUI)

Launch the GUI for interactive prompt experimentation:

python -m prompt-blender

The GUI provides a complete workflow:

  1. Import Data: Load your variables from various file formats
  2. Create Templates: Design prompt templates with placeholders
  3. Configure LLMs: Set up your preferred AI models
  4. Generate & Execute: Automatically create and run all prompt combinations
  5. Analyze Results: Review comprehensive analysis and export findings
Main Interface Execution Configuration
Main Window Execution Configuration

⌨️ Command-Line Interface (CLI)

For automation and scripting, create a project using GUI then use CLI to automate runs:

# Run a prompt blending project
python -m prompt-blender config.pbp --run

# Merge external data
python -m prompt-blender config.pbp --run --merge "questions=new_data.csv"

# Set custom output location
python -m prompt-blender config.pbp --run --output results.zip --overwrite

# Use custom cache directory
python -m prompt-blender config.pbp --run --cache-dir /tmp/cache

# Analyze existing results
python -m prompt-blender --dump-results results.zip

CLI Options

  • --run: Execute without GUI
  • --merge: Merge external CSV/JSON data files
  • --output: Specify output file location
  • --overwrite: Overwrite existing results
  • --cache-dir: Custom cache directory
  • --dump-results: Analyze existing result files

🛠️ Advanced Features

Plugin System

Extend PromptBlender with custom integrations:

  • Custom LLM Providers: Add support for new APIs
  • Analysis Modules: Create specialized result processors
  • Data Loaders: Support new file formats

Batch Processing

Optimize API usage with intelligent batching:

Result Analysis

Comprehensive analysis tools:

  • JSON Response Parsing: Extract structured data
  • Cost Calculation: Detailed spending reports
  • Performance Metrics: Spreadsheets presents Response time and allow further results evaluation
  • Export Options: Full zip export of results

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. 🐛 Report Issues: Found a bug? Open an issue with details
  2. 💡 Feature Requests: Suggest new capabilities
  3. 🔧 Pull Requests: Submit code improvements
  4. 📖 Documentation: Help improve our docs
  5. 🧪 Testing: Add test cases and examples

Development Setup

git clone https://github.com/edanssandes/prompt-blender
cd prompt-blender
conda create -n prompt-blender-dev python=3.11
conda activate prompt-blender-dev

📄 License

PromptBlender is released under the MIT License. See LICENSE for details.

⚠️ Use at your own risk!

🔗 Links


Made with ❤️ for the AI community

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

prompt_blender-0.2.5.tar.gz (66.1 kB view details)

Uploaded Source

Built Distribution

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

prompt_blender-0.2.5-py3-none-any.whl (82.3 kB view details)

Uploaded Python 3

File details

Details for the file prompt_blender-0.2.5.tar.gz.

File metadata

  • Download URL: prompt_blender-0.2.5.tar.gz
  • Upload date:
  • Size: 66.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for prompt_blender-0.2.5.tar.gz
Algorithm Hash digest
SHA256 0789f55addadf76bdda0066ca58d4464e91ad193e7832c70bb0cb02dc890a179
MD5 e050025a551447e7155e1d0d2a3a4d0b
BLAKE2b-256 d78c5a328540eb1ab83d56a5ccf52aab4cc4f74500fe6ea710aa2f432fc8961b

See more details on using hashes here.

File details

Details for the file prompt_blender-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: prompt_blender-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 82.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for prompt_blender-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 56752fc1534fe620a7442220018f8d29041186c493f3431087445735d63879f7
MD5 30d3ca0ed411907de18be35208acbf4e
BLAKE2b-256 6e1b7ad1cd1a2e9a7e065eb01ee9aa8a7c9e0c7f285082f98abddc49f0dce8bc

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