← Back to All Projects

PromptCraft: AI Prompt Optimizer & Tester

A production-grade developer tool that transforms rough human inputs into structured 5-component AI prompts using meta-prompting and side-by-side output evaluation.

What I Built

PromptCraft is a full-stack developer tool designed to optimize and evaluate LLM prompts in real time using systematic meta-prompting. Built with Python 3.12, the Google GenAI SDK (gemini-2.5-flash), Streamlit, and python-dotenv, it provides both a CLI and an interactive web interface with automated session audit logging and cloud deployment.

Problem

Raw human prompts are often vague, missing key context, or lacking strict formatting parameters. This leads to inconsistent, low-quality LLM outputs, forcing developers to manually copy-paste and iterate through prompts in web interfaces without structured feedback, versioning, or baseline metrics.

Solution

PromptCraft automates the prompt engineering pipeline. It takes a raw user prompt, executes it against Google Gemini to establish a baseline output, and concurrently passes it through a Meta-Prompt Engine that restructures it into a 5-component framework (Role, Task, Context, Format, Constraints). It then runs the optimized prompt and presents a clear, side-by-side output comparison while automatically persisting session logs to a structured JSON file.

Design Decisions

Tradeoffs

Challenges

During integration with the latest google-genai SDK, direct calls to models.generate_content triggered SDK warnings regarding Automatic Function Calling (AFC) heuristics. By inspecting SDK internals and implementing explicit configuration parameters via types.GenerateContentConfig, the issue was resolved without altering model behavior or incurring chat-session overhead.

What I’d Improve

Demo

Live Demo on Streamlit Cloud

Source Code

GitHub Repository