Enterprise prompt engineering library with testing, versioning, and management
A structured, enterprise-grade prompt engineering library. Prompts are treated as managed assets β categorized, versioned, tested, and documented with metadata including model recommendations, expected token usage, and example inputs/outputs.
Includes a Streamlit management UI for browsing, testing, and managing prompts, plus a testing framework for automated quality validation against the Gemini API.
- 50+ Categorized Prompts β Organized across 6 domains: summarization, analysis, code generation, content creation, data extraction, and customer service
- YAML-Based Format β Each prompt includes metadata, parameters, model recommendation, and example I/O
- Prompt Testing Framework β Automated testing with Gemini API for quality validation and regression detection
- Streamlit Management UI β Browse, search, test, and manage prompts through an interactive dashboard
- Version Tracking β Track prompt versions with changelog and performance metrics
- Quality Metrics β Track response quality, latency, and cost per prompt
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Streamlit UI (app.py) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Prompt Manager β CRUD & Search Engine β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ€
β Prompt Tester β Prompt Templates (YAML) β
β (Gemini API) β 6 categories Γ ~9 prompts each β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββ
# Clone and install
git clone https://github.com/onurcandonmezer/prompt-library.git
cd prompt-library
make install
# Browse prompts
python -m src.prompt_manager list
# Test a prompt with Gemini API (bring your own key)
cp .env.example .env # then add your GEMINI_API_KEY
export GEMINI_API_KEY="your-api-key-here"
python -m src.prompt_tester --prompt prompts/summarization/executive_summary.yaml
# Launch the Streamlit UI
make runfrom src.prompt_manager import PromptManager
manager = PromptManager(prompts_dir="prompts")
all_prompts = manager.list_prompts()
summaries = manager.get_by_category("summarization")
prompt = manager.get_prompt("executive_summary")
print(f"Name: {prompt.name}")
print(f"Template: {prompt.template}")
print(f"Recommended Model: {prompt.metadata.recommended_model}")from src.prompt_tester import PromptTester
tester = PromptTester(api_key=os.environ["GEMINI_API_KEY"])
result = tester.test_prompt(
prompt_path="prompts/summarization/executive_summary.yaml",
test_input="Your test document text here...",
)
print(f"Quality Score: {result.quality_score}/10")
print(f"Latency: {result.latency_ms}ms")
print(f"Output: {result.output}")Each prompt is a YAML file with this structure:
name: executive_summary
version: "1.0"
category: summarization
description: "Generate an executive summary from a document"
template: |
Summarize the following document into a concise executive summary.
Focus on key findings, decisions, and action items.
Document:
{document}
parameters:
- name: document
type: string
required: true
description: "The document text to summarize"
metadata:
recommended_model: "gemini-2.5-flash-lite"
expected_tokens: 500
temperature: 0.3
tags: ["business", "document", "summary"]
examples:
- input:
document: "Q3 revenue grew 15%..."
expected_output_contains: ["revenue", "growth"]prompt-library/
βββ README.md
βββ pyproject.toml
βββ Makefile
βββ prompts/
β βββ summarization/ # 9 summarization prompts
β βββ analysis/ # 9 analysis prompts
β βββ code_generation/ # 8 code generation prompts
β βββ content_creation/ # 8 content creation prompts
β βββ data_extraction/ # 8 data extraction prompts
β βββ customer_service/ # 8 customer service prompts
βββ src/
β βββ prompt_manager.py # CRUD & search engine
β βββ prompt_tester.py # Gemini API testing
β βββ app.py # Streamlit UI
βββ tests/
β βββ test_prompt_manager.py
β βββ test_prompt_tester.py
βββ .github/
βββ workflows/
βββ ci.yml
MIT License β see LICENSE for details.
Built for enterprise prompt engineering by Onurcan DΓΆnmezer