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๏ƒ

Indices and tables๏ƒ