promptimize  by preset-io

Prompt engineering toolkit for evaluating and testing prompts

created 2 years ago
474 stars

Top 65.3% on sourcepulse

GitHubView on GitHub
Project Summary

Promptimize is a Python toolkit for structured prompt engineering and evaluation, targeting developers building AI-powered products. It brings test-driven development (TDD) principles to prompt engineering, enabling users to define, execute, and compare prompt performance across various models and parameters with confidence.

How It Works

Promptimize treats prompts as "prompt cases," similar to unit tests, each associated with evaluation functions that score responses on a scale of 0 to 1. These cases are organized into "suites" for batch execution. The framework supports dynamic prompt generation, hyperparameter tuning (temperature, max tokens), and efficient re-runs of only changed or failed cases to minimize API calls. It leverages Langchain for LLM interactions, offering integrations for Langchain-specific prompt structures.

Quick Start & Requirements

  • Install via pip: pip install promptimize
  • Requires an OpenAI API key set as an environment variable (OPENAI_API_KEY).
  • Example usage: p9e run ./examples --output ./report.yaml
  • Official Docs: Preset Blog Promptimize DOCS

Highlighted Details

  • Configuration as code for prompt cases, suites, and evaluations.
  • Expressive DSL for defining prompts and assertions.
  • Supports prompt weighting and categorization for nuanced reporting.
  • Includes pre_run and post_run hooks for advanced response processing (e.g., executing generated code).
  • AI-powered suite expansion to generate new prompt cases.

Maintenance & Community

Licensing & Compatibility

  • License not explicitly stated in the README. Compatibility for commercial use or closed-source linking is therefore undetermined.

Limitations & Caveats

The project is in its early stages, indicating potential for rapid changes and evolving APIs. The license is not specified, which may pose a barrier for commercial adoption or integration into closed-source projects.

Health Check
Last commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
14 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
2 more.

prompt-engine by microsoft

0.0%
3k
NPM library for LLM prompt engineering
created 3 years ago
updated 2 years ago
Feedback? Help us improve.