PromptKit Documentation๏
A production-grade library for structured prompt engineering for LLMs. Define, validate, and execute LLM prompts using YAML files with input validation, engine abstraction, and CLI support.
Features๏
๐ YAML-based prompt definitions with Jinja2 templating
๐ Input validation using Pydantic schemas
๐๏ธ Engine abstraction supporting OpenAI and local models
๐ฐ Token estimation and cost calculation
๐ฅ๏ธ CLI interface for quick prompt execution
๐งช Fully tested with comprehensive test suite
Quick Start๏
Install PromptKit:
pip install promptkit-core
Define a prompt in YAML:
name: greet_user
description: Basic greeting
template: |
Hello {{ name }}, how can I help you today?
input_schema:
name: str
Use in Python:
from promptkit.core.loader import load_prompt
from promptkit.core.runner import run_prompt
from promptkit.engines.openai import OpenAIEngine
# Load prompt from YAML
prompt = load_prompt("greet_user")
# Configure engine
engine = OpenAIEngine(api_key="sk-...")
# Run prompt
response = run_prompt(prompt, {"name": "Alice"}, engine)
print(response)
Documentation Contents๏
Getting Started
Examples
API Reference