Skip to content

onurcandonmezer/prompt-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Prompt Library

Enterprise prompt engineering library with testing, versioning, and management

Python Prompts Streamlit Gemini License CI


Overview

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.

Key Features

  • 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

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Streamlit UI (app.py)                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚            Prompt Manager β€” CRUD & Search Engine              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Prompt Tester      β”‚       Prompt Templates (YAML)         β”‚
β”‚   (Gemini API)       β”‚   6 categories Γ— ~9 prompts each     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

# 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 run

Usage Examples

Browse Prompts Programmatically

from 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}")

Test a Prompt

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}")

Prompt Format

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"]

Tech Stack

Python Streamlit Gemini YAML Pydantic

Project Structure

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

License

MIT License β€” see LICENSE for details.


Built for enterprise prompt engineering by Onurcan DΓΆnmezer

About

Enterprise prompt engineering library with testing and management

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors