Promptify  by promptslab

Prompt engineering SDK for structured LLM output

created 2 years ago
4,011 stars

Top 12.5% on sourcepulse

GitHubView on GitHub
Project Summary

Promptify simplifies Natural Language Processing (NLP) tasks by enabling users to generate structured outputs from Large Language Models (LLMs) like GPT and PaLM. It targets developers and researchers looking to leverage LLMs for tasks such as Named Entity Recognition (NER), text classification, and question answering without requiring custom model training. The library's core benefit is its ability to abstract away prompt complexity and LLM output variability, providing consistent, parseable Python objects.

How It Works

Promptify utilizes a pipeline approach, combining pre-defined or custom Jinja2 prompt templates with various LLM integrations (OpenAI, Huggingface Hub models, Azure). Users select a task-specific template (e.g., ner.jinja), provide input text, and the pipeline constructs the appropriate prompt for the chosen LLM. This method allows for zero-shot or few-shot learning, directly extracting structured data from LLM responses, thereby avoiding the need for fine-tuning and simplifying integration into applications.

Quick Start & Requirements

  • Install via pip: pip3 install promptify or pip3 install git+https://github.com/promptslab/Promptify.git
  • Tested on Python 3.7+ and openai 0.25+.
  • Requires API keys for services like OpenAI.
  • Official Docs: https://promptify.readthedocs.io/
  • Colab Notebooks for various tasks are linked in the README.

Highlighted Details

  • Supports a wide range of NLP tasks including NER, multi-label/class/binary classification, question-answering, relation extraction, summarization, and SQL generation.
  • Outputs are consistently formatted as Python objects (lists, dictionaries) for easy parsing.
  • Allows easy integration of few-shot examples into prompts.
  • Can run inference on any model stored on the Huggingface Hub.

Maintenance & Community

The project is open-source with a call for contributions. Community discussions are encouraged via Discord.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. This requires further investigation for commercial use or closed-source linking.

Limitations & Caveats

The README mentions "Optimized prompts to reduce OpenAI token costs (coming soon)," indicating this feature is not yet implemented. The lack of an explicit license is a significant caveat for adoption.

Health Check
Last commit

5 months ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.