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.3.tar.gz (60.4 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.3-py3-none-any.whl (75.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prompt_blender-0.2.3.tar.gz
  • Upload date:
  • Size: 60.4 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.3.tar.gz
Algorithm Hash digest
SHA256 1574503441d9e6d41a8706cf5531da06eee3bf18e3bde8997b3d4ece56f87adc
MD5 e633ac158e93ad8403d68d80ee169d16
BLAKE2b-256 20e94ef22f368fddc9ae8aed9b8d0bb8b568db07e98e877c13d11139b5030a32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prompt_blender-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 75.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c621b5cfee4f2bd94ea24eb18e945b4ace07fbdc21bf861e88e5dc70942454f1
MD5 eaec6f21ed660578724b3718246ce974
BLAKE2b-256 d9a5db5d31a7e734d74c2e6c8b9d95293afc58a98d4f5d910c8c0b0d4eec26e8

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