Spaces:
Running
Running
A newer version of the Streamlit SDK is available:
1.53.1
metadata
title: Prompt A/B Tester
emoji: π¬
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.52.1
app_file: app.py
pinned: false
license: mit
Prompt A/B Tester
Web application for testing and comparing the performance of two OpenAI GPT prompt versions with A/B testing methodology.
Author
Marek Staniszewski Heuristica π www.heuristica.pl π§ staniszewski@heuristica.pl For questions, suggestions, or support, please contact the author.
Features
- API Key Management: Securely store OpenAI API key in Streamlit secrets
- Model Selection: Choose from available GPT models (gpt-4o, gpt-4, gpt-3.5-turbo)
- Parameter Configuration:
- Temperature (0.0 - 2.0)
- Max Tokens (100 - 4000)
- Number of responses (1-50)
- Two Input Methods:
- Upload
.mdor.txtfiles - Paste text directly
- Upload
- Progress Tracking: Real-time progress bars and logs
- Interactive Rating: Rate responses on a 1-5 scale
- Results Visualization: Compare prompts with statistics
- CSV Export: Download results with metadata
Usage
1. Configuration
- Go to "βοΈ Configuration" tab
- Enter your OpenAI API key
- Select model and adjust parameters
- Save settings
2. Run Test
- Go to "π Test" tab
- Either upload two files OR paste two prompts
- Click "Run Test"
- Monitor progress
3. Rate Responses
- After generation, go to "β Rating" tab
- Rate each response (1-5)
- Click "Calculate Results"
4. View Results
- Review statistics in "π Results" tab
- Export to CSV if needed
Configuration on Hugging Face Spaces
To use this app on Hugging Face Spaces:
- Go to Settings β Repository secrets
- Add a new secret:
- Name:
OPENAI_API_KEY - Value: Your OpenAI API key
- Name:
Cost Estimation
Approximate costs per test (2025 pricing):
| Model | 10 responses (5A + 5B) | 20 responses (10A + 10B) |
|---|---|---|
| gpt-4o | ~$0.05 | ~$0.10 |
| gpt-4-turbo | ~$0.15 | ~$0.30 |
| gpt-4 | ~$0.30 | ~$0.60 |
| gpt-3.5-turbo | ~$0.01 | ~$0.02 |
Project Information
Version: 2.0 (Streamlit) Created: 2025-10-14 License: MIT Contact: www.Heuristica.pl