Production-grade prompt patterns and multi-cloud AI orchestration for product teams building with Claude, GPT, and Gemini. Now with AWS Bedrock and Google Vertex AI support. Proven at scale: 5K+ signals/week, 95% accuracy, $0.001/signal cost.
Status: Production-ready | Last Updated: 2025-10-27 | Maintenance: Active development
Problem: Most prompt libraries showcase toy examples. Production systems need battle-tested patterns with real metrics.
Solution: Enterprise-grade toolkit combining 200+ production prompts, multi-model orchestration, and cost optimization strategies.
Key Benefits:
- Proven ROI: 99.7% cost reduction through intelligent model cascading (Haiku β Sonnet β Opus)
- Production Metrics: 95% accuracy on 5K+ weekly signals, validated on $100M+ ARR systems
- Multi-Model Expertise: Optimized patterns for Claude 4.x, GPT-4o, Gemini 2.5 families
- Zero to Production: Complete examples with evaluation methodology, not just prompts
- Developer Tools: Python package with YAML-based model registry, pricing service, capability validation
Get operational in under 5 minutes:
# Clone and install
git clone https://github.com/awoods187/PM-Prompt-Patterns.git
cd PM-Prompt-Patterns
pip install -e .
# Verify installation
python -c "from ai_models import get_model; print(get_model('claude-sonnet-4-5').name)"Next Steps by Role:
- New to prompts? β Design Principles
- Optimizing costs? β Model Selection Guide
- Building production systems? β Epic Categorization Example
- Understanding the codebase? β Project Structure
| Tool | Version | Verification | Purpose |
|---|---|---|---|
| Python | 3.9+ | python --version |
Core runtime |
| pip | Latest | pip --version |
Package management |
| API Keys | - | Set in .env |
Claude/GPT/Gemini access |
API Key Setup (Optional)
Create .env file:
ANTHROPIC_API_KEY=your_key_here
OPENAI_API_KEY=your_key_here
GOOGLE_API_KEY=your_key_hereKeys only required for live API testing. Browse prompts without keys.
The toolkit supports 6 AI providers with intelligent routing and cost optimization:
Supported Providers:
- Anthropic Claude (direct API) - Haiku, Sonnet, Opus
- AWS Bedrock - Claude models via AWS infrastructure
- Google Vertex AI - Claude models via Google Cloud
- OpenAI - GPT-5 (all variants), GPT-4.1, o3, o4-mini, GPT-4o
- Google Gemini - Gemini 2.5 Pro, Flash, Flash Lite
- Mock Provider - Zero-cost testing provider
Installation:
# Base installation (Anthropic Claude + Mock)
pip install -e .
# With AWS Bedrock support
pip install -e ".[bedrock]"
# With Google Vertex AI support
pip install -e ".[vertex]"
# With OpenAI support
pip install -e ".[openai]"
# With Google Gemini support
pip install -e ".[gemini]"
# With all providers
pip install -e ".[all]"Provider Configuration (.env file):
# Anthropic Claude (direct API)
ANTHROPIC_API_KEY=your_key_here
# AWS Bedrock
ENABLE_BEDROCK=true
AWS_ACCESS_KEY_ID=your_key_here
AWS_SECRET_ACCESS_KEY=your_secret_here
AWS_REGION=us-east-1
# Google Vertex AI
ENABLE_VERTEX=true
GCP_PROJECT_ID=your-project-id
GCP_REGION=us-central1
GCP_CREDENTIALS_PATH=/path/to/credentials.json # Optional
# OpenAI
ENABLE_OPENAI=true
OPENAI_API_KEY=sk-your_key_here
OPENAI_ORG_ID=org-your_org_here # Optional
# Google Gemini
GOOGLE_API_KEY=your_key_hereUsage Examples:
from pm_prompt_toolkit.providers import get_provider
# Explicit provider selection with prefix
claude = get_provider("anthropic:claude-sonnet-4-5")
bedrock = get_provider("bedrock:claude-sonnet-4-5")
vertex = get_provider("vertex:claude-sonnet-4-5")
openai = get_provider("openai:gpt-5") # GPT-5 flagship with auto-routing
gemini = get_provider("gemini:gemini-2-5-pro")
# Automatic routing (Claude models prefer Bedrock if enabled)
provider = get_provider("claude-sonnet-4-5") # Uses Bedrock if enabled
result = provider.classify("We need SSO integration")
# Direct model routing
openai_provider = get_provider("gpt-5") # Routes to OpenAI if enabled (auto-routing Instant/Thinking)
gemini_provider = get_provider("gemini-2-5-flash") # Routes to Gemini
# Mock provider for testing (zero cost)
mock = get_provider("mock:claude-sonnet")Provider Benefits:
- Bedrock: Enterprise AWS infrastructure, AWS-native billing, regional data residency
- Vertex AI: Google Cloud integration, GCP-native billing, unified GCP experience
- OpenAI: Advanced function calling, structured outputs, multimodal
- Gemini: 2M token context (Pro), ultra-low cost (Flash Lite), context caching
- Fallback: Automatically falls back to direct Anthropic API if cloud providers unavailable
from ai_models import get_model, has_vision, has_prompt_caching
# Get model specifications
model = get_model("gpt-5") # GPT-5 flagship
print(f"Context: {model.metadata.context_window_input:,} tokens")
print(f"Cost: ${model.pricing.input_per_1m}/M input tokens")
# Calculate costs with caching
cost = model.calculate_cost(
input_tokens=10_000,
output_tokens=2_000,
cached_input_tokens=5_000 # 90% discount on cached tokens
)
# Validate capabilities before API calls
if has_vision("gpt-5"): # GPT-5 has vision capabilities
process_image()from ai_models import ModelRegistry
budget_models = ModelRegistry.filter_by_cost_tier("budget")
# Returns: Haiku 4.5, GPT-5 mini, GPT-4.1 mini, Gemini 2.5 FlashAdvanced Examples: API Documentation | Production Architecture
All 13 production prompts now have provider-specific optimizations for Claude, OpenAI, and Gemini:
from ai_models import get_prompt, get_model, list_prompts
# See all available prompts
prompts = list_prompts()
# Returns: ['analytics/signal-classification', 'developing-internal-tools/claude-md-generator', ...]
# Automatically select best prompt variant for your model
model = get_model("gpt-5") # GPT-5 default model
prompt = get_prompt("analytics/signal-classification", model=model.id)
# Or explicitly choose a provider optimization
claude_prompt = get_prompt("developing-internal-tools/code-review-refactoring", provider="claude")
openai_prompt = get_prompt("product-strategy/meta-prompt-designer", provider="openai")
gemini_prompt = get_prompt("stakeholder-communication/executive-deck-review", provider="gemini")Provider-Specific Features:
| Provider | Key Optimizations | Best For | Cost/1K Operations |
|---|---|---|---|
| Claude | XML tags, chain-of-thought, caching | Complex reasoning, accuracy | $1-15 |
| OpenAI | Auto-routing modes, reasoning (o3/o4), function calling, JSON mode | Coding (4.1), reasoning (o3), general tasks (GPT-5) | $0.15-40 |
| Gemini | 2M context, caching, batch processing | High volume, cost optimization | $0.038-5 |
All 13 Prompts Available:
- Analytics: signal-classification
- Development: claude-md-generator, code-review-refactoring, enterprise-readme-generator, github-actions-python-cicd, llm-orchestration-system, prompt-extraction-cataloging, pytest-cicd-optimization, python-80-percent-test-coverage
- Strategy: meta-prompt-designer, opus-code-execution-pattern
- Communication: executive-deck-review, remove-ai-writing-patterns
Total: 13 prompts Γ 4 variants (base + Claude + OpenAI + Gemini) = 52 optimized prompt variants
β Learn more about provider-optimized prompts | β Migration tool
Choose the right model for your workload:
| Model | Input/Output (per 1M) | Context | Best For | Our Usage |
|---|---|---|---|---|
| Claude Haiku 4.5 | $1/$5 | 200K | High-volume classification | 70% |
| Claude Sonnet 4.5 | $3/$15 | 200K | Production workhorse | 25% |
| Claude Opus 4.1 | $15/$75 | 200K | High-stakes decisions | 5% |
| GPT-5 | $3/$12 | 256K | Flagship auto-routing (Instant/Thinking modes) | Default |
| GPT-5 mini | $0.20/$0.80 | 128K | Fast, efficient GPT-5 variant | Budget |
| GPT-4.1 | $2.5/$10 | 200K | Specialized for coding, precise instructions | Coding |
| GPT-4.1 mini | $0.15/$0.60 | 128K | Fast coding model, replaced 4o-mini | Budget coding |
| o3 | $10/$40 | 128K | Advanced reasoning, full tool access | Complex reasoning |
| o4-mini | $1/$4 | 128K | Fast, cost-efficient reasoning | Math/coding |
| GPT-4o | $2.5/$10 | 128K | Multimodal specialist (voice, vision) | Multimodal |
| Gemini 2.5 Pro | $1.25/$5 | 2M | Massive context analysis | Large docs |
| Gemini 2.5 Flash | $0.075/$0.30 | 1M | Speed-critical apps | Real-time |
Pricing verified October 2025. See MODEL_OPTIMIZATION_GUIDE.md for detailed comparison.
Don't use one model for everything. Intelligent routing saves 99.7%:
Keyword Filter (free) β 70% resolved
β
Haiku ($0.0003/signal) β 25% resolved
β
Sonnet ($0.002/signal) β 4.5% resolved
β
Opus ($0.015/signal) β 0.5% resolved
Average: $0.001/signal (vs $0.015 naive approach)
PM-Prompt-Patterns/
βββ prompts/ # Production-ready prompts by category
β βββ analytics/ # Monitoring, reporting, investigation (MECE)
β βββ product-strategy/ # Roadmapping, prioritization
β βββ technical-docs/ # API docs, CLAUDE.md generation
βββ ai_models/ # Python model management system
β βββ registry.py # YAML-based model registry
β βββ pricing.py # Cost calculation with caching
β βββ definitions/ # Model specs (Anthropic, OpenAI, Google)
βββ examples/ # Complete production systems
β βββ epic-categorization/ # 95% accuracy, $0.001/signal
βββ tests/ # 97 tests for model validation
βββ docs/ # Deep-dive guides
Navigate by Experience:
- π’ Beginner: prompts/ basic patterns
- π‘ Intermediate: MODEL_OPTIMIZATION_GUIDE.md
- π΄ Advanced: examples/epic-categorization/
Security Scanning: Multi-layer (Bandit, Safety, pip-audit, Semgrep, TruffleHog)
Dependency Updates: Automated weekly via Dependabot
API Key Management: Environment variables only, never committed
Vulnerability Reporting: Open GitHub issue with security label
CI/CD Status: All security scans pass. See workflows for details.
Proven Metrics:
- Throughput: 5,000+ signals/week in production
- Accuracy: 95% (vs 85% manual baseline)
- Cost Efficiency: $0.001/signal average (99.7% reduction)
- Latency: <2s p95 with model cascading
- Cache Hit Rate: 95% on repeat patterns
Scalability:
- Batch processing: 50-100 signals/batch for 92% cost reduction
- Prompt caching: 90% discount on cached tokens
- Model registry: LRU-cached for <1ms lookups
Team: Product Infrastructure Issues: GitHub Issues Contributions: CONTRIBUTING.md | CODE_OF_CONDUCT.md Response Time: Best effort (open source project)
Getting Help:
- Check docs/ for guides
- Search existing issues
- Open new issue with reproduction steps
| Section | Update Frequency | Next Update |
|---|---|---|
| Model Definitions | Weekly (automated staleness check) | Continuous |
| Model Pricing | Monthly | Nov 2025 |
| Model Specs | As released | Ongoing |
| Security Scans | Weekly (automated) | Continuous |
| Dependencies | Weekly (Dependabot) | Continuous |
| Prompts | Ad-hoc | As contributed |
Model Update Process: Automated weekly staleness checks via GitHub Actions. See Model Update System for manual update procedures.
Deprecation Policy: 90-day notice for breaking changes. See CHANGELOG.md.
Fundamentals (Start here):
- Prompt Design Principles - Core patterns
- Model Optimization Guide - Provider techniques
- Cost Optimization - ROI strategies
Production Systems:
- Epic Categorization Example - End-to-end architecture
- Quality Evaluation - Testing methodology
- Meta-Prompting - Iterative improvement
Migration:
- Old β New System - Upgrade from legacy registry
We welcome production-tested contributions with real metrics:
Quality Bar:
- β Quantified results from actual usage (no toy examples)
- β Before/after metrics (accuracy, cost, latency)
- β Failure modes documented
- β Tests included (97 existing tests for reference)
Process:
- Review CONTRIBUTING.md
- Sign commits with DCO:
git commit -s - Submit PR using template
Recognition: All contributors listed in ATTRIBUTION.md.
MIT License - Commercial use, modification, distribution allowed. No warranty.
TL;DR: Use freely in commercial products, no attribution required (appreciated).
Details: LICENSE | LICENSE_FAQ.md | CONTENT_LICENSE.md
Getting Started: Design Principles β Model Guide β Examples
Repository Structure: Project Structure Guide | Changelog Developer API: ai_models Package | Migration Guide CI/CD: Workflows | Run Tests Model Registry: Definitions | Pricing
Note: All examples genericized for public sharing. No proprietary data included. Metrics approximate and rounded for privacy.