{"id":30115864,"url":"https://github.com/walterpinem/gpt-5-api-testing-streamlit","last_synced_at":"2026-04-20T19:03:23.139Z","repository":{"id":308951687,"uuid":"1034692331","full_name":"walterpinem/gpt-5-api-testing-streamlit","owner":"walterpinem","description":"A comprehensive Streamlit-based testing dashboard for OpenAI's GPT-5 API, providing systematic evaluation of all model variants, advanced parameter testing, and detailed performance analytics.","archived":false,"fork":false,"pushed_at":"2025-08-08T20:51:21.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-08T22:21:10.784Z","etag":null,"topics":["gpt-5","gpt-5-api","openai","openai-api","python","streamlit"],"latest_commit_sha":null,"homepage":"https://walterpinem.com/gpt-5-api-testing-streamlit/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walterpinem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-08T20:18:54.000Z","updated_at":"2025-08-08T20:51:26.000Z","dependencies_parsed_at":"2025-08-08T22:33:41.899Z","dependency_job_id":null,"html_url":"https://github.com/walterpinem/gpt-5-api-testing-streamlit","commit_stats":null,"previous_names":["walterpinem/gpt-5-api-testing-streamlit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/walterpinem/gpt-5-api-testing-streamlit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterpinem%2Fgpt-5-api-testing-streamlit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterpinem%2Fgpt-5-api-testing-streamlit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterpinem%2Fgpt-5-api-testing-streamlit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterpinem%2Fgpt-5-api-testing-streamlit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walterpinem","download_url":"https://codeload.github.com/walterpinem/gpt-5-api-testing-streamlit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterpinem%2Fgpt-5-api-testing-streamlit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32061251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gpt-5","gpt-5-api","openai","openai-api","python","streamlit"],"created_at":"2025-08-10T08:54:18.899Z","updated_at":"2026-04-20T19:03:23.122Z","avatar_url":"https://github.com/walterpinem.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPT-5 API Testing Dashboard - Python \u0026 Streamlit\n\n![Python](https://img.shields.io/badge/Python-3.8%2B-green?style=for-the-badge\u0026logo=python)\n![Streamlit](https://img.shields.io/badge/Streamlit-1.28%2B-red?style=for-the-badge\u0026logo=streamlit)\n\nA comprehensive [**Streamlit**](https://walterpinem.com/tag/streamlit/)-based testing dashboard for OpenAI's [**GPT-5**](https://walterpinem.com/openai-gpt-5/) API, providing systematic evaluation of all model variants, advanced parameter testing, and detailed performance analytics.\n\nRead the comprehensive blog post: [**GPT-5 API Testing: Building GPT-5 API Testing Dashboard with Streamlit**](https://walterpinem.com/gpt-5-api-testing-streamlit/).\n\n---\n\n![GPT-5 Testing Dashboard](https://i.ibb.co.com/KxqBpC6C/GPT-5-API-Testing-Dashboard.png)\n\n---\n\n## 🚀 Features\n\n### Core Testing Capabilities\n- **Multi-Model Support**: Test all GPT-5 variants (gpt-5, gpt-5-mini, gpt-5-nano, gpt-5-chat-latest)\n- **Advanced Parameter Testing**: Reasoning effort, verbosity controls, and custom tools\n- **Real-Time Progress Tracking**: Live updates during API calls with detailed status information\n- **Comprehensive Error Handling**: Robust response parsing with fallback strategies\n\n### Testing Categories\n- **Basic Tests**: Connectivity validation and model comparison\n- **New Features**: Reasoning effort and verbosity parameter exploration\n- **Capabilities**: Coding tests, instruction following, and factual accuracy\n- **Performance**: Speed comparison and token efficiency analysis\n\n### Analytics \u0026 Visualization\n- **Interactive Dashboard**: Real-time performance metrics and trend analysis\n- **Advanced Charts**: Plotly-powered visualizations for response time, token usage, and efficiency\n- **Export Options**: JSON export for test results\n- **Session Management**: Persistent result tracking across testing sessions\n\n## 📦 Installation\n\n### Prerequisites\n- Python 3.8 or higher\n- OpenAI API key with GPT-5 access\n- 4GB+ available RAM for optimal performance\n\n### Quick Start\n\n1. **Save the code**\n   Save the provided `gpt-5-testing.py` file to your local directory\n\n2. **Create a virtual environment**\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. **Install dependencies**\n   ```bash\n   pip install streamlit openai pandas plotly python-dotenv requests\n   ```\n\n4. **Set up environment variables (optional)**\n   ```bash\n   export OPENAI_API_KEY=your_openai_api_key_here\n   ```\n\n5. **Run the application**\n   ```bash\n   streamlit run gpt-5-testing.py\n   ```\n\nThe dashboard will open in your browser at `http://localhost:8501`\n\n## 🔧 Configuration\n\n### API Key Setup\n\nYou can provide your OpenAI API key in two ways:\n1. **Environment variable**: Set `OPENAI_API_KEY` in your environment\n2. **Direct input**: Enter your key in the sidebar when running the app\n\n### Optional Environment Variables\n\n```bash\nexport OPENAI_API_KEY=your_openai_api_key_here\nexport LOG_LEVEL=INFO\nexport MAX_CONCURRENT_TESTS=3\nexport RESULTS_RETENTION_DAYS=7\n```\n\n## 📊 Usage Guide\n\n### Available Test Categories\n\n#### Basic Tests\n- **Basic Connectivity**: Validates API access across all GPT-5 models\n- **Model Comparison**: Side-by-side performance analysis\n\n#### New Features\n- **Reasoning Effort**: Tests minimal, low, medium, and high reasoning levels\n- **Verbosity Controls**: Compares low, medium, and high verbosity outputs\n- **Custom Tools**: (Framework provided for future implementation)\n- **Allowed Tools**: (Framework provided for future implementation)\n\n#### Capabilities\n- **Coding Tests**: Frontend generation, bug fixing, SQL generation, algorithm implementation\n- **Instruction Following**: (Framework provided)\n- **Factual Accuracy**: (Framework provided)\n\n#### Performance\n- **Speed Comparison**: (Framework provided)\n- **Token Efficiency**: (Framework provided)\n\n### Custom Testing\n\nThe custom test tab allows you to:\n- Select any GPT-5 model variant\n- Configure reasoning effort (minimal, low, medium, high)\n- Set verbosity levels (low, medium, high)\n- Specify custom test names\n- Set maximum output tokens\n- Enter custom prompts\n\n### Results Dashboard\n\nView comprehensive analytics including:\n- Total tests run and success rates\n- Average response times and token usage\n- Interactive charts showing performance trends\n- Detailed results table with filtering options\n- JSON export functionality\n\n## 🏗️ Code Structure\n\n### Main Components\n\n```\ngpt-5-testing.py                 # Complete Streamlit application (single file)\n```\n\n### Key Classes and Functions\n\n- **`GPT5StreamlitTester`**: Core testing framework class\n- **`TestResult`**: Dataclass for storing test outcomes\n- **`make_responses_api_call()`**: Handles GPT-5 Responses API integration\n- **`extract_response_content()`**: Multi-layered response parsing\n- **`display_result()`**: Formats and displays test results\n\n## 📈 Performance Metrics Tracked\n\n| Metric | Description |\n|--------|-------------|\n| Response Time | API call latency in seconds |\n| Token Usage | Input/output token consumption |\n| Success Rate | Percentage of successful API calls |\n| Word Count | Length of generated responses |\n| Test Parameters | All API parameters used for each test |\n\n## 🔒 Security Features\n\n- Password-type input for API keys (not stored permanently)\n- Session-based API key management\n- No persistent storage of sensitive data\n- Built-in error handling for API failures\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n**\"Required packages not installed\" Error**\n```bash\npip install openai requests python-dotenv streamlit plotly pandas\n```\n\n**\"Failed to create OpenAI client\" Error**\n- Verify your OpenAI API key is correct\n- Check that you have GPT-5 access enabled\n- Ensure your account has sufficient credits\n\n**\"Response received but content extraction failed\" Warning**\n- This indicates a response parsing issue\n- The raw response will be displayed for debugging\n- Try different model variants or simpler prompts\n\n**Empty Results or Slow Performance**\n- Check your internet connection\n- Verify API rate limits aren't exceeded\n- Clear test results using the sidebar button\n\n## 💡 Usage Tips\n\n1. **Start with Basic Connectivity** to verify your setup\n2. **Use Model Comparison** to understand performance differences\n3. **Test Reasoning Effort** with complex problems to see the impact\n4. **Experiment with Verbosity** for different response lengths\n5. **Export Results** regularly to track performance over time\n6. **Clear Results** periodically to maintain performance\n\n## 📝 Example Test Scenarios\n\n### Reasoning Effort Test\nDefault prompt: \"You have 12 balls, one of which is either heavier or lighter than the others. Using a balance scale exactly 3 times, how can you identify the odd ball and determine if it's heavier or lighter?\"\n\n### Verbosity Test\nDefault prompt: \"Explain how HTTPS encryption works and why it's important for web security\"\n\n### Coding Tests\n- **Frontend Generation**: React component with TypeScript and Tailwind CSS\n- **Bug Fixing**: Python function debugging\n- **SQL Generation**: Complex database queries\n- **Algorithm Implementation**: Dynamic programming solutions\n\n## 🔄 Session Management\n\n- Test results persist during your browser session\n- Use \"Clear All Results\" in the sidebar to reset\n- Session data is not saved between browser sessions\n- Export important results before closing the application\n\n## 📄 Notes\n\n- This is a single-file Streamlit application\n- All functionality is contained in `gpt-5-testing.py`\n- No external configuration files are required\n- API keys are handled securely without persistent storage\n\n---\n\n**Single-file GPT-5 testing solution for comprehensive API evaluation and performance analysis.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalterpinem%2Fgpt-5-api-testing-streamlit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalterpinem%2Fgpt-5-api-testing-streamlit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalterpinem%2Fgpt-5-api-testing-streamlit/lists"}